Backend storefront API with Node.JS, Express.JS, TypeScript and PostgresSQL Database (FWD_Udacity NanoDegree)
- [TypeScript] (https://www.typescriptlang.org/docs/)
- [Node.JS] (https://nodejs.org/dist/latest-v16.x/docs/api/)
- [Express] (https://expressjs.com/)
- [PostgresSQL] (https://www.postgresql.org/)
- [DB_migrate] (https://db-migrate.readthedocs.io/)
- [JsonWebToken] (https://jwt.io/)
- [Prettier] (https://prettier.io/docs/en/index.html)
- [ESLint] (https://eslint.org/docs/user-guide/getting-started)
- [Jasmine] (https://jasmine.github.io/)
- [supertest] (https://www.npmjs.com/package/supertest)
npm i
EXPRESS_PORT=
NODE_ENV=
POSTGRESS_DB_HOST=
POSTGRESS_DB=
POSTGRESS_DB_TEST=
POSTGRESS_DB_PORT=
POSTGRESS_DB_USER=
POSTGRESS_DB_PASS=
BCRYPT_SALT=
BCRYPT_SECRET=
JWT_SECRET=
PostgresSQL Database runs on port 5432
So make sure it's available
CREATE DATABASE %db_name%;
CREATE DATABASE %test_db_name%;
npm run migrate:up
npm run build
npm start
The server will start on port: the user environment port, or the default host is on: http://localhost:3000.
- 'dev': 'nodemon ./src/server.ts'
- 'build': 'npm run clean && npx tsc'
- 'start': 'npm run build && nodemon build/server.js'
- 'format:src': 'prettier --write src/*/.ts'
- 'format:build': 'prettier --write build/*/.js'
- 'lint': 'eslint . --ext .ts'
- 'migrate:up': 'db-migrate up'
- 'migrate:down': 'db-migrate down'
- 'clean': 'rimraf build/'
- 'test': 'set NODE_ENV=test && db-migrate up --config ./database.json -e test && npx tsc && jasmine && db-migrate down --config ./database.json -e test'