Card buying/selling application
Stretch features:
- Add trading feature
- Add chat functionality for buyers and sellers to connect
- Git clone repo to local machine
- Run npm install to install dependencies
-
Install PostgreSQL on your machine
-
Go to your terminal and verify that you can run the psql command:
psql --version
-
If the psql command isn't recognized, you'll need to add it to your PATH.
- Linux and Mac: add the line
export PATH=$PATH:/Library/PostgreSQL/latest/bin
to your~/.bashrc
or~/.bash_profile
, respectively, and restart your terminal. The exact path may vary so be sure to confirm the location of the postgresql binaries. - Windows (native): go to the advanced system settings to modify the PATH environmental variable to include the
bin
directory within the postgresql install directory.
- Linux and Mac: add the line
-
Go to https://www.elephantsql.com/, create an account, and create a new database instance. Make sure to select the free 'Tiny Turtle' plan. Name your new database.
-
Grab the url of your new database so you can access it from the command line in your terminal.
- Create .env file in the root folder
- Add
PROD_DB = <url from elephantSQL>
- Invoke
psql -d <url from elephantSQL> -f sessions_postgres_create.sql
. This will open the connection to your database and execute the SQL statements that will create tables in your database and populate them with rows of data.
- Set up OAuth in Google dev console https://support.google.com/googleapi/answer/6158849?hl=en
- Add client secret to .env
GOOGLE_CLIENT_SECRET = <client secret>
- Add client id to .env
GOOGLE_CLIENT_ID = <client id>
- Create secret for session cookie signature and add to .env
SECRET = <session secret>
(see docs for more information - https://www.npmjs.com/package/express-session)
- Run
npm run dev
to start your server and bundle the frontend. It will launch the frontend application in a browser window on http://localhost:8080/