This repo contains a basic Node and Express app to get you started in constructing an API. To get started, clone this repo and run npm install
in your terminal at the project root.
- Node.js
- Typescript
- express
- SQL
- ESLint
- Nodemon
- Jasmine
- Prettier
- postgresql
- postman
npm install
npm run build
npm run lint
npm run format
npm run test
npm run start
Here are some of packages that were installed.
npm i express
npm i --save-dev @types/express
npm i --save-dev typescript
npm install -g db-migrate
npm install --save rimraf
npm i bcrypt
npm i --save-dev @types/bcrypt
npm install --save morgan
npm i --save-dev @types/morgan
npm install jsonwebtoken
npm i --save-dev @types/jsonwebtoken
npm install dotenv --save
npm install jasmine @types/jasmine ts-node --save-dev
npm i supertest
npm i --save-dev @types/supertest
All endpoints are described in the REQUIREMENT.md file.
- id
- name
- price
- category
- id
- user_name
- first_Name
- last_Name
- password
- id
- user_id
- id
- order_id
- product_id (id of each product in the order )
- quantity (quantity of each product in the order)
After start up, the server will start on port 3000
and the database on port 5432
Tokens are passed along with the http header as
"Authorization " "Bearer <token>"
We should create the dev and test database.
- connect to the default postgres database as the server's root user
psql -U postgres
- In psql run the following to create a user
CREATE USER postgres WITH PASSWORD 'gemy200@';
- In psql run the following to create the dev and test database
CREATE DATABASE store_dev;
CREATE DATABASE store_test;
- Connect to the databases and grant all privileges
\c store_dev
\c store_test