A comprehensive management system for electrical companies to manage jobs, quotations, invoices, customers, and finances.
- ✅ Job Management - Track jobs with status, priority, and service types (solar, electrical, plumbing)
- ✅ Customer Management - Manage customer information and contact details
- ✅ Quotations - Create, manage, and send quotations via email and WhatsApp
- ✅ Invoices - Generate invoices, track payments, and manage outstanding balances
- ✅ Financial Overview - Dashboard with revenue, expenses, profit, and outstanding amounts
- ✅ PDF Generation - Automatic PDF generation for quotations and invoices
- ✅ Email Integration - Send quotations and invoices via email
- ✅ WhatsApp Integration - Send quotations via WhatsApp
- ✅ Auto-numbering - Automatic quotation and invoice number generation
- Node.js + Express
- TypeScript
- PostgreSQL with Prisma ORM
- JWT Authentication
- PDFKit for PDF generation
- Nodemailer for email
- Twilio for WhatsApp
- Next.js 16 (App Router)
- React 19
- TypeScript
- Tailwind CSS
- Axios for API calls
- Node.js 20+
- PostgreSQL database (we recommend Neon - free serverless PostgreSQL)
- npm or yarn
- Clone and install dependencies:
# Install root dependencies
npm install
# Install server dependencies
cd server
npm install
# Install client dependencies
cd ../client
npm install- Set up the database:
Option A: Using Neon (Recommended - Free Serverless PostgreSQL)
- Sign up at https://neon.tech
- Create a new project
- Copy your connection string from the dashboard
- See
NEON_SETUP.mdfor detailed instructions
Option B: Local PostgreSQL
- Install PostgreSQL locally
- Create database:
CREATE DATABASE maxvolt; - Use connection string:
postgresql://user:password@localhost:5432/maxvolt?schema=public
Then run migrations:
cd server
# Create .env file with your DATABASE_URL
# DATABASE_URL="your-neon-connection-string-here"
# Run migrations
npm run prisma:migrate
# Generate Prisma client
npm run prisma:generate- Configure environment variables:
Edit server/.env with your configuration:
- Database URL
- JWT secret
- Email settings (Gmail or other SMTP)
- Twilio credentials for WhatsApp
- Company information
- Set up client environment:
Create client/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:5000/apiTerminal 1 - Backend:
cd server
npm run devServer runs on http://localhost:5000
Terminal 2 - Frontend:
cd client
npm run devApp runs on http://localhost:3000
Or use the root script to run both:
npm run dev- Register/Login: Create an account or login at http://localhost:3000/login
- Add Customers: Navigate to Customers and add your customers
- Create Jobs: Create jobs for different service types
- Generate Quotations: Create quotations for jobs and send via email/WhatsApp
- Create Invoices: Convert quotations to invoices or create new invoices
- Track Payments: Record payments against invoices
- View Finances: Check financial overview and reports
POST /api/auth/register- Register new userPOST /api/auth/login- Login user
GET /api/customers- List all customersGET /api/customers/:id- Get customer detailsPOST /api/customers- Create customerPUT /api/customers/:id- Update customerDELETE /api/customers/:id- Delete customer
GET /api/jobs- List all jobsGET /api/jobs/:id- Get job detailsPOST /api/jobs- Create jobPUT /api/jobs/:id- Update jobDELETE /api/jobs/:id- Delete job
GET /api/quotations- List all quotationsGET /api/quotations/:id- Get quotation detailsGET /api/quotations/:id/pdf- Download quotation PDFPOST /api/quotations- Create quotationPUT /api/quotations/:id- Update quotationPOST /api/quotations/:id/send-email- Send quotation via emailPOST /api/quotations/:id/send-whatsapp- Send quotation via WhatsAppDELETE /api/quotations/:id- Delete quotation
GET /api/invoices- List all invoicesGET /api/invoices/:id- Get invoice detailsGET /api/invoices/:id/pdf- Download invoice PDFPOST /api/invoices- Create invoicePOST /api/invoices/from-quotation/:quotationId- Create invoice from quotationPUT /api/invoices/:id- Update invoiceDELETE /api/invoices/:id- Delete invoice
GET /api/payments- List all paymentsPOST /api/payments- Record paymentDELETE /api/payments/:id- Delete payment
GET /api/expenses- List all expensesPOST /api/expenses- Create expensePUT /api/expenses/:id- Update expenseDELETE /api/expenses/:id- Delete expense
GET /api/financials/summary- Get financial summaryGET /api/financials/records- Get financial records
The system uses Prisma with the following main models:
- User (authentication)
- Customer
- Job
- Quotation
- Invoice
- Payment
- Expense
- FinancialRecord
cd server
npm run prisma:migratecd server
npm run prisma:studio# Build server
cd server
npm run build
# Build client
cd client
npm run buildMIT