Skip to content

NathBabs/task-management

Repository files navigation

Task Management System

A scalable task management system built with NestJS, featuring real-time updates via WebSockets, Couchbase for data storage, and Redis for WebSocket scaling.

Features

  • ✨ Create, read, update and delete tasks
  • 🔄 Real-time updates using WebSockets
  • 🔍 Search functionality
  • ⚡ Horizontally scalable architecture

Prerequisites

Before you begin, ensure you have installed:

  • Docker and Docker Compose
  • Node.js (v16 or later)
  • Yarn package manager

Quick Start

  1. Clone the repository:
git clone https://github.com/yourusername/task-management-system.git
cd task-management-system
  1. install dependencies:
yarn install
  1. Create environment file:
cp .env.example .env
  1. Start infrastructure and initialize services:
yarn infra:start
  1. Run the application
yarn start:dev

The API will be available at:

REST API: http://localhost:8080/
Swagger Docs: http://localhost:8080/api/docs
WebSocket: ws://localhost:8080/socket.io/?EIO=4&transport=websocket

Development Commands

# Start development server
yarn start:dev

# Run tests
yarn test

# View logs
yarn docker:logs

# Stop services
yarn docker:stop

API Endpoints

Tasks

  • GET /tasks - List all tasks (with pagination)
  • POST /tasks - Create a new task
  • GET /tasks/:id - Get task details
  • PATCH /tasks/:id - Update a task
  • DELETE /tasks/:id - Delete a task

WebSocket Testing (via Postman)

  1. Connect to WebSocket:

    • Create new WebSocket Request
    • URL: ws://localhost:3000/socket.io/?EIO=4&transport=websocket
    • Click "Connect"
  2. Listen for Events: Click on the events tab and add the following events below and then toggle the "Listen" button beside each event:

    • TASK_CREATED: When a new task is created
    • TASK_UPDATED: When a task is modified
    • TASK_DELETED: When a task is removed
  3. Testing Flow:

    • Keep WebSocket connection open
    • Make REST API calls (create/update/delete tasks)
    • Watch real-time updates in the WebSocket Messages panel

Project Structure

src/
├── modules/
│   ├── tasks/         # Task management
│   ├── database/      # Database services
│   └── redis/         # Redis services
├── common/            # Shared utilities
└── config/           # Configuration files
└── main.ts            # Application entry point

Sample Screenshots

  • Create Task api request

    Screenshot 2024-12-21 at 16 16 46

  • TASK_CREATED websocket event received

    Screenshot 2024-12-21 at 16 16 23

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published