The API for my stock trading dashboard. Please be aware that the production application is using free database instances, therefore reliability cannot be guaranteed and changes may be lost.
- Clone project
git clone https://github.com/aparrett/trading-dashboard-api.git
- cd into folder
cd trading-dashboard-api
- Download npm packages
yarn
-
Start PostgreSQL server
-
Create database called
trading_dashboard
(from outside psql command line utility)
createdb trading_dashboard
-
Add a user with the username
postgres
and passwordadmin
. You can choose your own username and password but be sure to specify them in the .env file. -
Connect to the database with psql and add the uuid extension:
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
- Install Redis
brew install redis
- Start Redis
brew services start redis
- Create a filed named
.env
that has the environment variables listed in .env.example. For example:
DATABASE_URL=postgresql://username:password@localhost:5432/trading_dashboard
REDIS_URL=127.0.0.1:6379
PORT=4000
SESSION_SECRET=my_secret
CORS_ORIGIN=http://localhost:3000
This app was initialized using a modified version of Ben Awad's template. Thanks Ben!