Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

52 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏒 Service Request & Operations Management System (ERP)

Next.js React Node.js PostgreSQL Cloudinary

A full-stack ERP system for managing service requests, users, assignments, billing, and operations with role-based access.


πŸš€ Overview

This project is a modern ERP (Enterprise Resource Planning) system designed to manage:

  • Service Requests
  • User Management
  • Assignments & Operations
  • Billing & Invoices
  • Audit Trails

It provides Admin and Customer dashboards with a clean, responsive UI and real-time operations.


✨ Key Features

πŸ‘₯ User Management

  • Create users (Admin)
  • Update user profiles
  • Profile image upload (Cloudinary)
  • Role-based access (Admin / Customer)

πŸ“‹ Service Requests

  • Create and manage requests
  • View request details
  • Status updates (pending, approved, rejected)
  • Request timeline tracking

πŸ”§ Assignment Management

  • Assign/reassign jobs
  • Track assignment history
  • Operation logs (audit trail)

πŸ’° Billing System

  • Invoice creation
  • Payment tracking
  • Billing history

🧾 Audit Trail

  • Track all system actions:
    • Request approvals
    • Assignments
    • Invoice creation
    • Payments
    • Profile updates

πŸ–Ό Profile Management

  • Upload profile image (Cloudinary)
  • Image preview + progress bar
  • Replace image (auto delete old)
  • Remove profile image (with confirmation)

πŸ“± UI/UX

  • Responsive dashboard (mobile + desktop)
  • Collapsible sidebar
  • Mobile drawer navigation
  • Toast notifications
  • Skeleton loaders

πŸ›  Tech Stack

Frontend

  • Next.js (App Router)
  • React
  • Tailwind CSS
  • lucide-react (icons)
  • react-hot-toast
  • Framer Motion

Backend

  • Node.js + Express
  • PostgreSQL
  • Prisma ORM

External Services

  • Cloudinary β†’ Image uploads
  • JWT β†’ Authentication

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        Frontend            β”‚
β”‚   (Next.js App Router)     β”‚
β”‚                            β”‚
β”‚ - Dashboard UI             β”‚
β”‚ - Profile Management       β”‚
β”‚ - Requests / Billing       β”‚
β”‚ - Sidebar / Navigation     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚
             β”‚ HTTP (REST API)
             β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Backend            β”‚
β”‚     (Node.js + Express)    β”‚
β”‚                            β”‚
β”‚ - Authentication (JWT)     β”‚
β”‚ - User Management          β”‚
β”‚ - Request Services         β”‚
β”‚ - Assignment Logic         β”‚
β”‚ - Billing & Payments       β”‚
β”‚ - Audit Trail System       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚         β”‚
        β”‚         β”‚
        β”‚         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”  β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PostgreSQLβ”‚  β”‚   Cloudinary    β”‚
β”‚ Database  β”‚  β”‚ (Image Storage) β”‚
β”‚           β”‚  β”‚                 β”‚
β”‚ - Users   β”‚  β”‚ - Profile imgs  β”‚
β”‚ - Requestsβ”‚  β”‚ - Upload API    β”‚
β”‚ - Billing β”‚  β”‚                 β”‚
β”‚ - Audit   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“‚ Project Structure

🧩 Root Structure

Service-Request-and-Operations-Management-ERP-System/
β”‚
β”œβ”€β”€ frontend/          # Next.js frontend application
β”œβ”€β”€ backend/           # Node.js + Express backend
β”œβ”€β”€ README.md
└── .gitignore

🎨 Frontend Structure (Next.js)

frontend/
β”‚
β”œβ”€β”€ app/                          # App Router (Next.js)
β”‚   β”œβ”€β”€ dashboard/
β”‚   β”‚   β”œβ”€β”€ page.tsx              # Dashboard home
β”‚   β”‚   β”œβ”€β”€ layout.tsx            # Dashboard layout
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ profile/
β”‚   β”‚   β”‚   └── page.tsx          # Profile page
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ requests/
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ create/
β”‚   β”‚   β”‚   β”œβ”€β”€ my/
β”‚   β”‚   β”‚   └── [id]/             # Dynamic request details
β”‚   β”‚   β”‚       └── page.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ billing/
β”‚   β”‚   β”‚   └── my-invoices/
β”‚   β”‚   β”‚       └── page.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ users/
β”‚   β”‚   β”‚   └── create/
β”‚   β”‚   β”‚       └── page.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   └── audit/
β”‚   β”‚       └── page.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ login/
β”‚   β”œβ”€β”€ register/
β”‚   β”œβ”€β”€ layout.tsx
β”‚   └── globals.css
β”‚
β”œβ”€β”€ components/                   # Reusable UI components
β”‚   β”‚
β”‚   β”œβ”€β”€ layout/                  # Layout components
β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx
β”‚   β”‚   β”œβ”€β”€ MobileSidebar.tsx
β”‚   β”‚   β”œβ”€β”€ DashboardTopbar.tsx
β”‚   β”‚   β”œβ”€β”€ UserMenu.tsx
β”‚   β”‚   └── UserAvatar.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ ui/                      # Generic UI elements
β”‚   β”‚   β”œβ”€β”€ Button.tsx
β”‚   β”‚   β”œβ”€β”€ Input.tsx
β”‚   β”‚   β”œβ”€β”€ Table.tsx
β”‚   β”‚   β”œβ”€β”€ Modal.tsx
β”‚   β”‚   β”œβ”€β”€ ConfirmDialog.tsx
β”‚   β”‚   β”œβ”€β”€ SectionCard.tsx
β”‚   β”‚   └── StatusBadge.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ profile/                 # Profile-related components
β”‚   β”‚   └── ImageDropzone.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ requests/                # Request-related components
β”‚   β”‚   β”œβ”€β”€ RequestOverviewCard.tsx
β”‚   β”‚   β”œβ”€β”€ CustomerDetailsCard.tsx
β”‚   β”‚   β”œβ”€β”€ AssignmentHistoryCard.tsx
β”‚   β”‚   β”œβ”€β”€ BillingHistoryCard.tsx
β”‚   β”‚   └── StatusTimelineCard.tsx
β”‚   β”‚
β”‚   └── charts/                  # Dashboard charts
β”‚       β”œβ”€β”€ RequestsStatusChart.tsx
β”‚       β”œβ”€β”€ InvoiceStatusChart.tsx
β”‚       └── AssignmentsStatusChart.tsx
β”‚
β”œβ”€β”€ context/
β”‚   └── AuthContext.tsx          # Authentication context
β”‚
β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ useMediaQuery.ts
β”‚   β”œβ”€β”€ useDebounce.ts
β”‚   └── usePagination.ts
β”‚
β”œβ”€β”€ services/                    # API layer
β”‚   β”œβ”€β”€ api.ts
β”‚   β”œβ”€β”€ profile.ts
β”‚   β”œβ”€β”€ upload.ts
β”‚   β”œβ”€β”€ profile-image.ts
β”‚   β”œβ”€β”€ request.ts
β”‚   β”œβ”€β”€ billing.ts
β”‚   β”œβ”€β”€ assignment.ts
β”‚   └── audit.ts
β”‚
β”œβ”€β”€ lib/                         # Utilities
β”‚   β”œβ”€β”€ navigation.ts
β”‚   β”œβ”€β”€ formatDate.ts
β”‚   β”œβ”€β”€ formatCurrency.ts
β”‚   └── exportCsv.ts
β”‚
β”œβ”€β”€ types/                       # TypeScript types
β”‚
β”œβ”€β”€ public/                      # Static assets
β”‚
β”œβ”€β”€ next.config.ts
β”œβ”€β”€ package.json
└── tsconfig.json

βš™οΈ Backend Structure (Node.js + Express + Prisma)

backend/
β”‚
β”œβ”€β”€ src/
β”‚   β”‚
β”‚   β”œβ”€β”€ controllers/             # Request handlers
β”‚   β”‚   β”œβ”€β”€ auth.controller.ts
β”‚   β”‚   β”œβ”€β”€ user.controller.ts
β”‚   β”‚   β”œβ”€β”€ request.controller.ts
β”‚   β”‚   β”œβ”€β”€ assignment.controller.ts
β”‚   β”‚   β”œβ”€β”€ billing.controller.ts
β”‚   β”‚   └── audit.controller.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ services/                # Business logic
β”‚   β”‚   β”œβ”€β”€ user.service.ts
β”‚   β”‚   β”œβ”€β”€ request.service.ts
β”‚   β”‚   β”œβ”€β”€ assignment.service.ts
β”‚   β”‚   β”œβ”€β”€ billing.service.ts
β”‚   β”‚   └── audit.service.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ routes/                  # API routes
β”‚   β”‚   β”œβ”€β”€ auth.routes.ts
β”‚   β”‚   β”œβ”€β”€ user.routes.ts
β”‚   β”‚   β”œβ”€β”€ request.routes.ts
β”‚   β”‚   β”œβ”€β”€ assignment.routes.ts
β”‚   β”‚   β”œβ”€β”€ billing.routes.ts
β”‚   β”‚   └── audit.routes.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ middleware/              # Middleware
β”‚   β”‚   β”œβ”€β”€ auth.middleware.ts
β”‚   β”‚   β”œβ”€β”€ role.middleware.ts
β”‚   β”‚   β”œβ”€β”€ error.middleware.ts
β”‚   β”‚   └── upload.middleware.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ config/                  # Configurations
β”‚   β”‚   β”œβ”€β”€ prisma.ts
β”‚   β”‚   └── cloudinary.ts
β”‚   β”‚
β”‚   β”œβ”€β”€ utils/                   # Helper functions
β”‚   β”‚
β”‚   └── server.ts                # Entry point
β”‚
β”œβ”€β”€ prisma/
β”‚   β”œβ”€β”€ schema.prisma
β”‚   └── migrations/
β”‚
β”œβ”€β”€ package.json
└── tsconfig.json

βš™οΈ Setup Instructions

1️⃣ Clone Repository

git clone https://github.com/supunakalanka76/Service-Request-and-Operations-Management-ERP-System.git

2️⃣ Install Dependencies

cd frontend
npm install
cd backend
npm install

3️⃣ Environment Variables

Backend .env

DATABASE_URL=postgresql://user:password@localhost:5432/erp_db

JWT_SECRET=your_secret_key

CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_key
CLOUDINARY_API_SECRET=your_secret

Frontend .env.local

NEXT_PUBLIC_API_URL=http://localhost:5000/api

4️⃣ Run Project

cd backend
npm start
cd frontend
npm start

πŸ“Š Core Modules

Module Description
Users Manage system users
Requests Handle service requests
Assignments Job assignment tracking
Billing Invoices & payments
Audit Activity logs
Profile User profile management

πŸ”§ Future Improvements

  • πŸ” Role permissions (fine-grained RBAC)
  • πŸ“Š Advanced analytics dashboard
  • πŸ“§ Email notifications
  • πŸ“± Mobile app (React Native)
  • πŸ”„ Real-time updates (WebSockets)
  • πŸ§ͺ Unit & integration testing

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch
    git checkout -b feature/AmazingFeature
  3. Commit your changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

πŸ“„ License

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


πŸ“§ Support

For support, questions, or feedback:


Made with ❀️ by Supun Akalanka

GitHub


About

Full-stack ERP system for managing service requests, users, assignments, billing, and audit logs with role-based access and modern responsive UI.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages