Skip to content

Backend of a ToDo Application (built to demonstrate my development practices)

Notifications You must be signed in to change notification settings

bjspatel/todo-api

Repository files navigation

ToDo API

This is a ToDo application API built using NestJS, and MongoDB. The application serves endpoints for managing tasks, users, and authentication. For protecting the endpoints, authentication is done with the help of short-living access-token, and long-living refresh-token. It also provides Swagger documentation for the API.

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/bjspatel/todo-api.git
    cd todo-api
  2. Install the dependencies:

    npm install

Running the Application

  1. Make sure you have MongoDB running on local machine or on the free MongoDB Atlas cluster.

  2. Create a .env file in the root directory of the project and add the following environment variables (modify the values as needed):

    MONGODB_URI=mongodb://localhost:27017/todo
    FRONTEND_URL=http://localhost:5173
    PORT=8080
    • MONGODB_URI is the connection string for MongoDB.
    • FRONTEND_URL is used for CORS configuration.
    • PORT is the port on which the application will run.
  3. Start the application:

    npm run start
  4. The application will be running on http://localhost:8080.

API Documentation

The API is documented using the Swagger module. Once the application is running, you can access the Swagger documentation at http://localhost:8080/api.

Project Structure

TODO/
├── src/
│ ├── auth/ # Authentication module
│ ├── decorators/ # Custom decorators
│ ├── task/ # Task module
│ ├── user/ # User module
│ ├── app.module.ts # Root module
│ └── main.ts # Entry point
├── .env # Environment variables file
...

About

Backend of a ToDo Application (built to demonstrate my development practices)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published