Udacity FullStack Nanodegree
You can use this one as a guide
EXPRESS_PORT=3000
POSTGRES_HOST=127.0.0.1
POSTGRES_DB=storefront
POSTGRES_DB_TEST=storefront_test
POSTGRES_USER=postgres_storefront
POSTGRES_PASSWORD=password123
BCRYPT_PASSWORD=password123
SALT_ROUNDS=10
ENV=dev
TOKEN_SECRET=mysecrettoken123
- Install the migration package globally:
npm install -g db-migrate
- Install the migration package in the project:
npm i db-migrate db-migrate-pg --save-dev
- Install and run the postgres docker image - command
docker-compose up
this command will also automatically create a DataBase (specified in the.env
file) with the user and pass also specified in the.env
file - Port used: Default postgres port 5432 (specified in the
docker-composed.yml
file) - Production database - storefront (specified in the
.env
file) - Test Database - storefront_test (specified in the
.env
file) - User: postgres_storefront (specified in the
.env
file) - Password: password123 (specified in the
.env
file) - Create all the tables in the database - command
db-migrate up
node: 3000 postgres: 5432
Run the following command: npm install
- express - Node.js web app framework
- dotenv - Load environment variables
- pg - PostgreSQL client
- bcrypt - Password hashing
- jsonwebtoken - JSON web tokens
npm run build
- build production version of app in ./dist/ folder - "build": "npx tsc"npm run start-dev
- start development app /w nodemon monitoring for changes - "start-dev": "nodemon src/server.ts"npm run start-prod
- Start production app from ./dist folder - "start-prod": "node ./dist/server.js"npm run test
- create test database, run jasmine, then drop test database.npm run prettier
- run prettier check - "prettier": "npx prettier **/*.ts --check"npm run lint
- run lint with prettier plugin, and auto fix issues. - "lint": "eslint **/*.ts --fix --quiet"
- See the REQUIREMENTS.md file
- See the REQUIREMENTS.md file