Skip to content

A backend API for an ERP-style task management system built with Node.js, Express.js, TypeScript, Prisma ORM, and PostgreSQL. Features include user authentication, RBAC, task CRUD, status management, logging, and more.

Notifications You must be signed in to change notification settings

Adnaanahma/Project_Task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERP Task Management System

Project Overview

A backend API for an ERP-style task management system built with Node.js, Express.js, TypeScript, Prisma ORM, and PostgreSQL. Features include user authentication, RBAC, task CRUD, status management, logging, and more.


Features

  • User registration (admin-only)
  • JWT authentication
  • Role-based access control (RBAC)
  • Full CRUD for tasks
  • Task assignment (admin-only)
  • Status management with allowed transitions
  • Action logging to database

Project Structure

src/
  controllers/
  middlewares/
  prisma/
  routes/
  services/
  types/
  utils/

Setup Instructions

1. Clone the repository

git clone <repo-url>
cd <project-folder>

2. Install dependencies

npm install

3. Environment Variables

Create a .env file in the root directory:

DATABASE_URL="postgresql://*****@localhost:5432/task_db?schema=public"
JWT_SECRET="*****"
PORT=****

4. Database Setup

  • Ensure PostgreSQL is running and the database task_db exists.
  • Run Prisma migrations:
npx prisma migrate dev --name init

5. Generate Prisma Client

npx prisma generate

6. Start the Application

npm run dev

API Endpoints

See the exported Postman collection for all endpoints and example requests.

  • POST /auth/login — User login
  • POST /users — Register user (admin-only)
  • GET /tasks — List all tasks (admin-only)
  • POST /tasks — Create task (admin-only)
  • PUT /tasks/:id — Update task (with status management)
  • DELETE /tasks/:id — Delete task (admin-only)
  • POST /tasks/:id/assign — Assign task (admin-only)

What the App Does

  • Allows admins to register users and assign tasks
  • Team members can update and complete their assigned tasks
  • All actions are logged in the database
  • Status transitions are strictly enforced

Notes

  • All endpoints require JWT authentication except login
  • RBAC is enforced for sensitive actions
  • Logs are stored in the Log table

About

A backend API for an ERP-style task management system built with Node.js, Express.js, TypeScript, Prisma ORM, and PostgreSQL. Features include user authentication, RBAC, task CRUD, status management, logging, and more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published