- Create Role = bk and database = bk2
- For Windows, run
psql.exe -U postgres -f sql/db.sql
- For Mac / Linux, run
psql -U {default-db-admin-role} -f sql/db.sql
- For Windows, run
- With user and database created, create schema
- For Windows, run
psql.exe -U bk -d bk2 -f sql/schema.sql
- For Mac / Linux, run
psql -U bk -d bk2 -f sql/schema.sql
- For Windows, run
- Grant Permission to user bk (for dev mode)
- For Windows, run
psql.exe -U bk -d bk2 -f sql/grant.sql
- For Mac / Linux, run
psql -U bk -d bk2 -f sql/grant.sql
- For Windows, run
- Drop all tables in database
- For Windows, run
psql.exe -U bk -d bk2 -f sql/drop-tables.sql
- For Mac / Linux, run
psql -U bk -d bk2 -f sql/drop-tables.sql
- For Windows, run
- Populate currencies and bankrolls tables
- For Windows, run
psql.exe -U bk -d bk2 -f sql/populate.sql
- For Mac / Linux, run
psql -U bk -d bk2 -f sql/populate.sql
- For Windows, run
- Fake Deposit (For all registered, users and all currencies in db, credit balance)
- For Windows, run
psql.exe -U bk -d bk2 -f sql/fake-deposit.sql
- For Mac / Linux, run
psql -U bk -d bk2 -f sql/fake-deposit.sql
- For Windows, run
npm run install-all
- Installs dependencies in base and app directory
npm start
: (This should be sufficient to start the app for development)- Starts node server at port 3002 (Backend Server)
- Starts webpack-dev-middleware from
app/build/express-server
file (Frontend Server)
npm run lint
- runs eslint on base directory and app directory
npm run app:build
:- Builds web app for production in
app/dist
directory (This directory is not committed to the repo and created on running this command) - Backend server serves static content from
app/dist/static
directory at path/
(*Seesrc/server.js
)
- Builds web app for production in
npm run server:prod
:- Starts backend server with NODE_ENV = "production"
- (First time setup) Create a heroku app and provision
heroku-postgres
resource. An environment variableDATABASE_URL
will be created on heroku. - (First time setup) Create a new config variable
FRONTEND_HOST
which should have url of the heroku app deployed (to be used by links in emails) - (First time setup) Add heroku url in recaptcha allowed domains
- Setup Database / Refresh database:
- For Mac / Linux, run
npm run heroku:setup-databases
which executes heroku commands insidescripts/heroku-setup-databases.sh
file. - For Windows, TODO: setup a similar file
- NOTE: This runs the local version of sql file
- For Mac / Linux, run
- Push app to heroku, it should build and deploy
- Fake Deposit:
heroku pg:psql < sql/fake-deposit.sql
(For all registered, users and all currencies in db, credit balance)