This is a NestJS application with MongoDB integration. The application is containerized using Docker and Docker Compose.
- Clone the repository:
git clone https://github.com/lyxuansang91/task-management-api.git
cd task-management-api- Build and start the services:
2.1. Using docker-compose
docker-compose up --build2.2. Using NodeJS (locally)
- Create
.envfile using following commmand:
cp -R .env.example .envAnd modify .env file.
- To install package, using the following command:
yarn install- To run development environment, using following command:
yarn start:dev- To run production environment, using following command:
yarn start:prodor
yarn build && node dist/main- Access the application: Open your browser and navigate to
http://localhost:3000.
The application uses the following environment variables:
MONGODB_URI: The URI for connecting to MongoDB. Default ismongodb://mongo:27017/test.NODE_ENV: The NodeJS environment for app. Default isdevelopment.PORT: The port of this app. Default is3000.SECRET_KEY: The secret key for JWT token.SIGN_OPTIONS: JWT token sign expire time, default:4h.
The application will be available at http://localhost:3000.
To run the unit tests, use the following command:
yarn testThe docker-compose.yml file sets up the following services:
app: The NestJS application.mongo: The MongoDB database.