Skip to content

Repository files navigation

Smart Service & Workforce Management Platform

A modern, full-stack operational portal for managing technical dispatches, scheduling customer requests, tracking technician GPS routes in real-time, and automating invoices.


🚀 Key Features

  • Authentication: JWT token validation with secure cryptographic refresh rotations and Google OAuth support.
  • Client Booking: Interface for customers to book service dispatches, pick slots, and set priority.
  • Real-Time GPS Tracking: Streams technician coordinates dynamically over SignalR.
  • Unified Portals: Role-based dashboards tailored for Customers, Technicians, and Administrators.
  • Automated Billing: Generates service reports, prints itemized invoices, and integrates PayHere sandboxed checkouts.
  • CI/CD Integration: Pre-configured GitHub Actions workflow checking code quality, formatting, linting, and compile states.

🛠️ Technology Stack

Layer Technology Version
Backend API ASP.NET Core Web API (Clean Architecture) .NET 7.0
Database PostgreSQL v15
WebSockets SignalR v7
Frontend UI Next.js (App Router, Tailwind CSS, Zustand) v14.2
Analytics Recharts Area Graphs v2.12
Containers Docker & Docker Compose v3.8

📁 Project Directory Structure

WorkforceManage_Platform/
├── backend/                            # ASP.NET Core Solution
│   ├── src/
│   │   ├── WorkforceManage.API/         # API Entrypoint, SignalR Hubs & Controllers
│   │   ├── WorkforceManage.Application/ # Business MediatR Commands, Queries & DTOs
│   │   ├── WorkforceManage.Domain/      # Shared Domain Entities & Enums
│   │   └── WorkforceManage.Infrastructure/ # DbContext, S3, Email, and JWT services
│   └── WorkforceManage.sln
│
├── frontend/                           # Next.js React Portal
│   ├── src/
│   │   ├── app/                        # App Router Pages & Shell Layouts
│   │   ├── components/                 # Role Specific Portal Dashboards
│   │   ├── hooks/                      # Custom React Hook for SignalR
│   │   └── store/                      # Zustand global session states
│
├── infra/                              # Deployment Configurations
│   └── docker/                         # Multi-stage optimized Dockerfiles
└── docker-compose.yml                  # Orchestrator

⚙️ Prerequisites

Before installing the project, ensure you have the following installed:

  • .NET SDK 7.0 or later
  • Node.js v20.x or later (includes npm)
  • Docker Desktop (optional, for container runs)
  • PostgreSQL instance (optional, if running backend manually)

💻 Installation & Startup Guide

Option A: Run via Docker Compose (Recommended)

This launches all layers (API, PostgreSQL, and Next.js) in the background with a single command:

  1. Clone the repository and navigate to the project directory.
  2. Build and spin up the containers:
    docker-compose up --build -d
  3. Access the services:

Option B: Local Manual Development

If you prefer running services outside containers for faster hot-reloading:

1. Setup Environment Configuration

  • Copy .env.example to .env in the root folder and fill in your keys.

2. Start Database & Backend

  1. Spin up a local PostgreSQL instance.
  2. Edit appsettings.json connection strings to match your PostgreSQL instance parameters.
  3. Open a terminal and run the backend:
    cd backend
    dotnet restore
    dotnet run --project src/WorkforceManage.API

3. Start Next.js Client

  1. Open a new terminal.
  2. Install Node dependencies and start the local development dev-server:
    cd frontend
    npm install
    npm run dev
  3. Open http://localhost:3000 in your browser.

🔌 WebSockets & SignalR Endpoints

Our app uses SignalR to stream real-time updates:

  • Job Status Broadcast: /hubs/job
    • Group naming: user_{userId} (personal notifications), role_{roleName} (dispatch alerts), job_{jobId} (active request tracker).
  • GPS Route Tracking: /hubs/tracking
    • Technician pushes location: SendLocationUpdate(jobId, lat, lng)
    • Clients listen to: ReceiveLocationUpdate

💳 Payment Gateway

Invoices generate sandboxed PayHere checkouts pointing to https://sandbox.payhere.lk/pay/checkout. During local runs, clicking "Pay with PayHere" generates mock payment orders using test credentials (Merchant ID: 1224400) and redirects safely to the payment return URLs.

About

A modern, full-stack operational portal for managing technical dispatches, scheduling customer requests, tracking technician GPS routes in real-time, and automating invoices.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages