- Git - Download & Install Git.
- Node.js - Download & Install Node.js and the npm package manager.
- Docker - Download & Install Docker.
git clone [email protected]:SpaNb4/nodejs2024Q1-service.git
npm ci
docker compose up
By default, the application will run on port 4000, in development mode, so it will automatically restart when you make changes to the code in the src
directory.
docker compose down
POSTGRES_HOST=localhost
docker compose up -d postgres
npx prisma migrate deploy
npm run start:dev
Create a .env
file in the root directory of the project and add the following environment variables:
- BACKEND_PORT: The port on which the backend application will run.
- POSTGRES_HOST: The hostname of the Postgres database.
- POSTGRES_PORT: The port number of the Postgres database.
- POSTGRES_USER: The username for accessing the Postgres database.
- POSTGRES_PASSWORD: The password for accessing the Postgres database.
- POSTGRES_DB: The name of the Postgres database.
- PGADMIN_PORT: The port on which PgAdmin will run.
- PGADMIN_DEFAULT_EMAIL: The default email address for PgAdmin.
- PGADMIN_DEFAULT_PASSWORD: The default password for PgAdmin.
- DATABASE_URL: The connection URL for the Prisma ORM.
If you want to access the PgAdmin interface and manage the Postgres database, you can do so by visiting http://localhost:5050 in your browser. You can log in using the email and password you provided in the .env
file.
You can access the OpenAPI documentation by typing http://localhost:4000/api/ in your browser. For more information about OpenAPI/Swagger please visit https://swagger.io/.
After application running open new terminal and enter:
- To run all tests without authorization
npm run test
- To run only one of all test suites
npm run test -- <path to suite>
- To run all test with authorization
npm run test:auth
- To run only specific test suite with authorization
npm run test:auth -- <path to suite>
npm run lint
npm run format