You will need to creat .env files based on the different environments you want to run your project.
.env.dev // Development environment
.env.test // Test environment
.env.prod // Production environment
This project needs to be run alongside a MongoDB instance.
If you don't want to run or launch your own MongoDB instance it is included a script to use docker-compose
to download and build a Docker instance of MongoDB. But before hand you would need to install in your machine docker-compose
.
You simply need to execute:
pnpm local:start:mongo-db
But before hand you will need to add to the corresponding environment variables files the entry:
MONGO_DB_URL=mongodb://127.0.0.1:27017 // Values needed when using the Docker Compose instance provided
These instructions refer to use pnpm
as the package manager but other options can be used.
- Get inside of the folder where the code is located
cd picnic-planner
- Install the project
pnpm install
- Build the project
pnpm build
- Run the project
pnpm start
These instructions refer to use pnpm
as the package manager but other options can be used.
- Get inside of the folder where the code is located
cd picnic-planner
- Install the project
pnpm install
- Build the project
pnpm build
- Run the project in watch mode. This mode will make the server to hot reload the changes done to the code
pnpm start:dev
There has been an implementation of E2E tests using Supertest and Jest.
To run them locally execute:
pnpm test:e2e
For the tests is mandatory that the MongoDB instance is running. But the tests will be executed in a different database than when running the project locally so no records should be lost.
This application server is based on the opinionated suggestions of Nest.js developers for the goal of providing a piece of functionality for this exercise. Real case scenario would lead me to different choices in regards of tooling, libraries, testing tools and coding style.