Skip to content

Repository files navigation

Task-Management API

Description

This is a NestJS application with MongoDB integration. The application is containerized using Docker and Docker Compose.

Prerequisites

Installation

  1. Clone the repository:
git clone https://github.com/lyxuansang91/task-management-api.git
cd task-management-api
  1. Build and start the services:

2.1. Using docker-compose

docker-compose up --build

2.2. Using NodeJS (locally)

  • Create .env file using following commmand:
cp -R .env.example .env

And 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:prod

or

yarn build && node dist/main
  1. Access the application: Open your browser and navigate to http://localhost:3000.

Environment Variables

The application uses the following environment variables:

  • MONGODB_URI: The URI for connecting to MongoDB. Default is mongodb://mongo:27017/test.
  • NODE_ENV: The NodeJS environment for app. Default is development.
  • PORT: The port of this app. Default is 3000.
  • SECRET_KEY: The secret key for JWT token.
  • SIGN_OPTIONS: JWT token sign expire time, default: 4h.

Running the Application

The application will be available at http://localhost:3000.

Running tests

To run the unit tests, use the following command:

yarn test

Docker Compose

The docker-compose.yml file sets up the following services:

  • app: The NestJS application.
  • mongo: The MongoDB database.

About

No description, website, or topics provided.

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages