This app allows users to talk in real time with another of the a browser. There is also a bot that is useful for a variety of features.
- Open a terminal in your environment
- Clone this repository using git clone https://github.com/NJIT-CS490/project2-m2-mdm56
- 'npm install'
- 'npm install react-google-login'
- 'npm install react-dom'
- 'pip install flask'
- 'pip install flask_sqlalchemy'
- 'pip install flask_socketio'
- 'pip install dotenv'
- 'pip install requests'
- Install PostGreSQL using
sudo yum install postgresql postgresql-server postgresql-devel postgresql-contrib postgresql-docs
Be sure to enter yes to all prompts. - Start Your PSQL database:
A)
sudo service postgresql initdb
B)sudo service postgresql start
- Make a yourself a user with
sudo -u postgres createuser --superuser $USER
- Create a database with 'sudo -u postgres createdb $USER'
- Create a user for yourself with 'create user [your_username_here] superuser password '[your_password_here]'
- Create a new file called 'sql.env' and add the following text: export SQL_USER=[your_username_here] export SQL_PASSWORD=[your_password_here] export USER=[your_username_here] export DATABASE_URL='postgresql://[your_username_here]:[your_password_here]@localhost/postgres'
- Run
sudo vim /var/lib/pgsql9/data/pg_hba.conf
- Replace all values of
ident
withmd5
in Vim::%s/ident/md5/g
- run
sudo service postgresql restart
- Navigate to the root directory of the project
- In one terminal run 'npm run watch'
- In another terminal run flask-launcher.py using the terminal command 'python app.py'
- The app is now running locally and you should be able to see it using your local ip and port 8080 If you are running on aws, simply click preview to see the web app
- Sign up for heroku at heroku.com
- Install heroku in your terminal by running 'npm install -g heroku'
- Name the app 'chitchat'
- Go through the following steps: heroku login -i heroku create git push heroku master
- Add secret keys (from sql.env) by going to https://dashboard.heroku.com/apps and clicking into your app. Click on Settings, then scroll to "Config Vars." Click "Reveal Config Vars" and add the key value pairs for the five keys (use the same key names)
- In terminal push again to start app again with the command 'git push heroku master'
There should be none
- Working with sockets was very challenging
- Moving th db to heroku was tricky
- Getting react functional components to work how I want them to took some practice