Skip to content

web-rest-api/Task_Management_Application

Repository files navigation

Task Management Application

A task management application built with Node.js, designed using Domain-Driven Design (DDD) principles. This application allows users to organize tasks into categories, track due dates, manage priorities, and mark tasks as complete.

Features

  • Domain-Driven Design: Core entities like Tasks, Categories, and Users are defined to reflect the application's business logic.
  • Task Management: Create, update, and track tasks with attributes like title, description, due date, priority, and completion status.
  • Category Organization: Group tasks into categories (e.g., Work, Personal, Urgent) for better organization.
  • Express API: Exposes a REST API for managing tasks and categories.

Technologies Used

  • Node.js: JavaScript runtime for building backend services.
  • Express: Web framework for creating a RESTful API.
  • dotenv: For managing environment variables.
  • Nodemon: Development tool for auto-restarting the server.
  • json-server: a Node.js package that uses a JSON file as a database and automatically provides CRUD endpoints for each data type in the file

Getting Started

Prerequisites

  • Node.js (version 14 or higher recommended)
  • npm (Node package manager)

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/task-manager-app.git
cd task-manager-app
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory and define the port (or use the default port):
PORT=3000
  1. Start the application:
npm run start

Using json-server as a Mock Database

This project uses json-server to simulate a REST API for development.

  • Start json-server to serve data from db.json:
npm run json-server

Directory Structure

task-manager/
│   ├── domain/
│   │   ├── Task/
│   │   │   ├── Task.js
│   │   │   ├── TaskService.js
│   │   ├── Category/
│   │   │   ├── Category.js
│   │   │   ├── CategoryService.js
│   │   ├── User/
│   │   │   ├── User.js
│   │   │   ├── UserService.js
│   ├── infrastructure/
│   │   ├── Database.js
│   ├── app.js
│   ├── index.js

API Endpoints

Tasks

  • Create a Task: POST /tasks
  • Complete a Task: PATCH /tasks/:id/complete

Categories

  • Create a Category: POST /categories
  • Add a Task to a Category: POST /categories/:categoryId/tasks

Example Usage

To create a task, send a POST request to /tasks with a JSON payload:

{
	"id": "1",
	"title": "Complete DDD project",
	"description": "Finish initial setup",
	"dueDate": "2024-10-30",
	"priority": "high"
}

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •