A storefront RESTfulAPI provides products, orders, authorization, and cart functionality.
database: PostgreSQL
Server: Node, Express
Testing: jasmine, supertest
To run this project, you will need to add the following environment variables to your .env file
DB
TEST_DB
POSTGRES_PORT
POSTGRES_TEST_PORT
(must be different from POSTGRES_PORT
)
POSTGRES_HOST
POSTGRES_USER
POSTGRES_PASSWORD
HASHING_SALT_ROUNDS
HASHING_PEPPER
JWT_SECRET
ENV
Note
ENV
default value is "dev"
-
First, add
.env
file with the requiered variables above. -
second, you will need to create the database container with Docker.
docker-compose up
- Then you will need to install the required npm packages using the following command.
npm install
- after that you will need to run database migrations using the following command.
npx db-migrate up
- Finally, you can run the server using the following command.
npm start
-
database port can be specified in environment variables
-
test database port can be specified in environment variables
-
server port is (3000)
To run tests, run the following command
npm run test