Skip to content

narenkram/dreaminfinity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EV Dealer Network (Distribution Management System)

DMS Architecture Stack

An enterprise-grade, highly scalable supply chain and distribution management web application tailored for the Electric Vehicle (EV) industry. Built to facilitate complex multi-tier transactions, vehicle/parts tracking, and service request lifecycles.

🚀 Tech Stack

  • Frontend: Vue 3 (Composition API), Vite, TypeScript, Bootstrap 5, Bootstrap Icons (No custom CSS)
  • Backend: Node.js, Express.js, TypeScript
  • Database: PostgreSQL (v16+)
  • ORM: Prisma (v7+)
  • Authentication: JWT (JSON Web Tokens)
  • Architecture: Monolithic API with strict Double-Entry Ledger mathematics.

📋 Core Features & Modules

The system is strictly designed around maintaining ACID-compliant ledgers rather than mutable integer variables. All stock and finances are tracked by immutable double-entry traces.

1. Unified Supply Chain Network

  • Hierarchical RBAC: System Admin (HQ) -> Super Stockist -> Dealership.
  • Operations automatically validate relationships verifying up-line and downline transactions.

2. Double-Entry Inventory Ledger

  • Stock levels natively derive from SUM(IN) - SUM(OUT).
  • Prevents direct integer modification of inventory values, guaranteeing an unbreakable audit trail of exact items inbound and outbound.
  • Traces refer to distinct transaction references (e.g. INVOICE, ADJUSTMENT, RETURN_IN).

3. Automated Invoicing & Financial Accounts

  • Generates Quotes and Proforma Invoices without impacting physical inventory.
  • Finalizing as CONFIRMED automatically orchestrates SALE_OUT inventory deductions and issues Financial Credit/Debit traces simultaneously using prisma.$transaction.
  • Native support for logging VIN (Vehicle Identification Numbers).

4. Enterprise Operations & Service

  • Service Requests: Dealerships can manage customer EV repair tickets and workflows.
  • Returns (Reverse Logistics): Native support for issuing RETURN_IN allocations and tracking Credit Notes.
  • Payment Collection Engine: Track global and localized pending debts and log exact monetary offsets.

⚙️ How to Run Locally

This project includes an automated startup script designed for Windows.

Prerequisites:

  1. Ensure PostgreSQL is actively running locally on port 5432.
  2. Database URL mapping: postgresql://postgres:123456@localhost:5432/dms (Matches seed logic).

Execution:

  1. Double-click start_dms.bat from the project root.
  2. The script will automatically:
    • Boot up the dms-api backend server on port :3000.
    • Launch the dms-web Frontend Vite development server natively.
    • Open your default browser to localhost:5173.
  3. To safely shut down, follow the terminal prompt and hit ENTER to sever active ports seamlessly.

👥 Technical Demo & Authentication

To access the system, utilize the production-grade secure login screen. Authentication relies entirely on stateless JWTs passed via HTTP headers.

The database is pre-seeded with the following hierarchical users. The universal password for all demo accounts is admin123:

  1. System Admin (HQ) | Phone: 9999999999
  2. Super Stockist | Phone: 8888888888
  3. Dealership | Phone: 7777777777

Note: The Sidebar navigation is strictly bound by RBAC constraints; logging in as lower-tier actors will correctly suppress restricted Admin-exclusive views (like Global Network & Products) directly from the DOM.

🗄️ Database Schema Snapshot

The ecosystem is heavily normalized relying on Prisma to enforce standard relational checks:

  • User: Global Actor authentication and hierarchical mapping limits.
  • Product: Segmented catalog (VEHICLE, PART, ACCESSORY) driving valuations.
  • InventoryLedger: The mathematical source-of-truth for physical objects.
  • AccountLedger: The mathematical source-of-truth for financial debts.
  • Invoice & InvoiceItem: Tracks pre-sale Quotes, Proformas, and finalized sales.
  • ServiceRequest & ServicePart: EV Repair ticketing and part consumption tracking.
  • Payment, CreditNote, Return, Damage: Administrative resolution trackers.

Architected and developed as a complete technical assessment demonstration of full-stack scalability protocols.

About

Distribution Management System

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors