Skip to content

A production-ready NestJS application for managing tasks with features like authentication, caching, message queues, and background job processing.

Notifications You must be signed in to change notification settings

babaie774/TaskSync

Repository files navigation

TaskSync - Task Management System

A production-ready NestJS application for managing tasks with features like authentication, caching, message queues, and background job processing.

Features

  • User authentication and authorization using JWT
  • CRUD operations for tasks
  • Redis caching for frequently accessed data
  • RabbitMQ for event-driven architecture
  • Bull queue for background job processing
  • Swagger API documentation
  • Rate limiting
  • Graceful shutdown handling

Project Structure

task-sync/ ├── src/ │ ├── auth/ # Authentication module │ │ ├── decorators/
│ │ ├── dto/
│ │ ├── guards/
│ │ ├── interfaces/
│ │ ├── strategies/
│ │ ├── auth.controller.ts
│ │ ├── auth.module.ts
│ │ └── auth.service.ts
│ ├── common/
│ │ ├── exceptions/
│ │ ├── filters/
│ │ ├── interceptors/
│ │ └── interfaces/
│ ├── config/
│ │ └── configuration.ts
│ ├── tasks/
│ │ ├── dto/
│ │ ├── entities/
│ │ ├── interfaces/
│ │ ├── tasks.controller.ts │ │ ├── tasks.module.ts
│ │ ├── tasks.service.ts
│ │ └── task.processor.ts
│ ├── users/
│ │ ├── dto/
│ │ ├── entities/
│ │ ├── users.controller.ts │ │ ├── users.module.ts
│ │ └── users.service.ts
│ ├── app.module.ts
│ └── main.ts
├── test/ # Testing ├── .env # Environment variables ├── .env.example # Example environment variables ├── .gitignore ├── package.json ├── tsconfig.json └── README.md

Prerequisites

  • Node.js (v16 or later)
  • PostgreSQL
  • Redis
  • RabbitMQ

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/task-sync.git
cd task-sync
  1. Install dependencies:
npm install
  1. Create a PostgreSQL database:
CREATE DATABASE task_sync;
  1. Configure environment variables:
cp .env.example .env
# Edit .env with your configuration

Running the Application

  1. Start the development server:
npm run start:dev
  1. Access the API documentation:
http://localhost:3000/api

API Endpoints

Authentication

  • POST /auth/register - Register a new user
  • POST /auth/login - Login user

Tasks

  • GET /tasks - Get all tasks
  • GET /tasks/:id - Get a specific task
  • POST /tasks - Create a new task
  • PATCH /tasks/:id - Update a task
  • DELETE /tasks/:id - Delete a task
  • PATCH /tasks/:id/complete - Mark a task as completed

Docker Support

To run the application using Docker:

  1. Build the Docker image:
docker build -t task-sync .
  1. Run the container:
docker run -p 3000:3000 task-sync

Testing

Run the test suite:

npm test

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A production-ready NestJS application for managing tasks with features like authentication, caching, message queues, and background job processing.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published