A full-stack project management platform for solar installation companies. Customers order solar panels, sales reps approve & assign jobs, construction crews execute installs, and managers oversee everything end-to-end.
SolarFlow β From order to installation, seamlessly.
| Role | Access Level | Key Actions |
|---|---|---|
| Customer | Limited | Submit solar installation orders, track order status |
| Sales Rep | Moderate | Review & approve orders, assign crews, manage quotes |
| Construction Crew | Task-based | View assigned jobs, update install progress, mark complete |
| Manager | Full Access | All of the above + resource management, analytics, reporting |
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS + shadcn/ui
- State Management: Zustand
- Data Fetching: TanStack Query (React Query)
- Forms: React Hook Form + Zod validation
- Maps: Google Maps API (for installation addresses)
- Charts: Recharts (manager dashboard analytics)
- Runtime: Node.js
- Framework: Express.js (REST API)
- Language: TypeScript
- Auth: JWT + Role-Based Access Control (RBAC)
- File Uploads: Multer + AWS S3 (photos of completed installs)
- Primary DB: PostgreSQL (relational β orders, users, assignments)
- ORM: Prisma
- Cache: Redis (session management, real-time job queue)
- Containerization: Docker + Docker Compose
- CI/CD: GitHub Actions
- Hosting: GCP Cloud Run (backend) + Vercel (frontend)
- Storage: GCP Cloud Storage (install photos, documents)
- Monitoring: GCP Cloud Logging + Sentry
solarflow/
βββ README.md
βββ docker-compose.yml
βββ .env.example
βββ .github/
β βββ workflows/
β βββ ci.yml
β βββ deploy.yml
β
βββ frontend/ # Next.js App
β βββ package.json
β βββ tailwind.config.ts
β βββ next.config.ts
β βββ tsconfig.json
β βββ public/
β β βββ assets/
β βββ src/
β βββ app/ # Next.js App Router
β β βββ layout.tsx
β β βββ page.tsx # Landing / redirect
β β βββ (auth)/
β β β βββ login/page.tsx
β β β βββ register/page.tsx
β β βββ (dashboard)/
β β β βββ layout.tsx # Shared dashboard shell
β β β βββ customer/
β β β β βββ page.tsx # Customer home
β β β β βββ orders/
β β β β β βββ page.tsx # My orders list
β β β β β βββ new/page.tsx # New order form
β β β β β βββ [id]/page.tsx # Order detail + status
β β β β βββ profile/page.tsx
β β β βββ sales/
β β β β βββ page.tsx # Sales dashboard
β β β β βββ orders/
β β β β β βββ page.tsx # Pending approval queue
β β β β β βββ [id]/page.tsx # Review & approve order
β β β β βββ assignments/
β β β β β βββ page.tsx # Assign crew to jobs
β β β β βββ quotes/page.tsx
β β β βββ crew/
β β β β βββ page.tsx # Crew task board
β β β β βββ jobs/
β β β β β βββ page.tsx # My assigned jobs
β β β β β βββ [id]/page.tsx # Job detail + update status
β β β β βββ schedule/page.tsx
β β β βββ manager/
β β β βββ page.tsx # Manager overview
β β β βββ orders/page.tsx
β β β βββ crews/
β β β β βββ page.tsx # All crews + availability
β β β β βββ [id]/page.tsx
β β β βββ resources/
β β β β βββ page.tsx # Inventory (panels, inverters, etc.)
β β β β βββ order/page.tsx # Order more resources
β β β βββ analytics/page.tsx
β β β βββ settings/page.tsx
β βββ components/
β β βββ ui/ # shadcn/ui base components
β β βββ layout/
β β β βββ Sidebar.tsx
β β β βββ Topbar.tsx
β β β βββ RoleGuard.tsx # Route protection by role
β β βββ orders/
β β β βββ OrderCard.tsx
β β β βββ OrderForm.tsx
β β β βββ OrderStatusBadge.tsx
β β β βββ OrderTimeline.tsx
β β βββ jobs/
β β β βββ JobCard.tsx
β β β βββ JobStatusUpdater.tsx
β β β βββ InstallPhotoUpload.tsx
β β βββ crew/
β β β βββ CrewSelector.tsx
β β β βββ CrewAvailabilityCard.tsx
β β βββ resources/
β β β βββ InventoryTable.tsx
β β β βββ ResourceOrderForm.tsx
β β βββ analytics/
β β βββ KPICards.tsx
β β βββ InstallationsChart.tsx
β β βββ RevenueChart.tsx
β βββ hooks/
β β βββ useAuth.ts
β β βββ useOrders.ts
β β βββ useJobs.ts
β β βββ useResources.ts
β βββ lib/
β β βββ api.ts # Axios instance + interceptors
β β βββ auth.ts
β β βββ utils.ts
β βββ store/
β β βββ authStore.ts # Zustand auth state
β β βββ notificationStore.ts
β βββ types/
β βββ order.ts
β βββ job.ts
β βββ user.ts
β βββ resource.ts
β
βββ backend/ # Express.js API
β βββ package.json
β βββ tsconfig.json
β βββ Dockerfile
β βββ src/
β βββ server.ts # Entry point
β βββ app.ts # Express setup, middleware
β βββ config/
β β βββ database.ts # Prisma client
β β βββ redis.ts
β β βββ gcp.ts # GCP Storage client
β βββ middleware/
β β βββ auth.middleware.ts # JWT verification
β β βββ role.middleware.ts # RBAC guard
β β βββ upload.middleware.ts # Multer config
β β βββ error.middleware.ts
β βββ modules/
β β βββ auth/
β β β βββ auth.router.ts
β β β βββ auth.controller.ts
β β β βββ auth.service.ts
β β βββ orders/
β β β βββ orders.router.ts
β β β βββ orders.controller.ts
β β β βββ orders.service.ts
β β βββ jobs/
β β β βββ jobs.router.ts
β β β βββ jobs.controller.ts
β β β βββ jobs.service.ts
β β βββ crews/
β β β βββ crews.router.ts
β β β βββ crews.controller.ts
β β β βββ crews.service.ts
β β βββ resources/
β β β βββ resources.router.ts
β β β βββ resources.controller.ts
β β β βββ resources.service.ts
β β βββ notifications/
β β β βββ notifications.router.ts
β β β βββ notifications.service.ts
β β βββ analytics/
β β βββ analytics.router.ts
β β βββ analytics.service.ts
β βββ utils/
β βββ jwt.ts
β βββ email.ts # Nodemailer (status notifications)
β βββ logger.ts
β
βββ database/ # DB schema & migrations
βββ schema.prisma
βββ migrations/
β βββ 001_init.sql
β βββ 002_add_resources.sql
β βββ 003_add_notifications.sql
βββ seed/
βββ seed.ts # Dev seed data (roles, demo users)
Customer submits order
β
Order lands in Sales queue (status: PENDING)
β
Sales Rep reviews β Approves + assigns Construction Crew (status: APPROVED)
β
Crew sees job on their dashboard β Travels to site β Updates status (IN_PROGRESS)
β
Install complete β Crew uploads photo evidence β Marks COMPLETED
β
Manager sees real-time analytics, can order more inventory resources
| Feature | Customer | Sales | Crew | Manager |
|---|---|---|---|---|
| Submit order | β | β | β | β |
| View own orders | β | β | β | β |
| Approve/reject orders | β | β | β | β |
| Assign crew to job | β | β | β | β |
| View assigned jobs | β | β | β | β |
| Update job status | β | β | β | β |
| Upload install photos | β | β | β | β |
| Manage resources/inventory | β | β | β | β |
| Order new resources | β | β | β | β |
| View analytics | β | πΈ Own | β | β Full |
| Manage users | β | β | β | β |
DRAFT β PENDING β APPROVED β ASSIGNED β IN_PROGRESS β COMPLETED
β REJECTED
- Node.js 20+
- Docker & Docker Compose
- PostgreSQL 15+
# Clone the repo
git clone https://github.com/your-org/solarflow.git
cd solarflow
# Copy env files
cp .env.example .env
cp frontend/.env.example frontend/.env.local
cp backend/.env.example backend/.env
# Start services with Docker
docker-compose up -d
# Install dependencies
cd frontend && npm install
cd ../backend && npm install
# Run DB migrations + seed
cd backend
npx prisma migrate dev
npx ts-node src/database/seed/seed.ts
# Start dev servers (in separate terminals)
# Terminal 1 - Backend
cd backend && npm run dev # http://localhost:4000
# Terminal 2 - Frontend
cd frontend && npm run dev # http://localhost:3000| Role | Password | |
|---|---|---|
| Customer | [email protected] | demo1234 |
| Sales | [email protected] | demo1234 |
| Crew | [email protected] | demo1234 |
| Manager | [email protected] | demo1234 |
# Backend (.env)
DATABASE_URL=postgresql://user:password@localhost:5432/solarflow
REDIS_URL=redis://localhost:6379
JWT_SECRET=your_jwt_secret_here
JWT_EXPIRES_IN=7d
GCP_PROJECT_ID=your-gcp-project
GCP_BUCKET_NAME=solarflow-uploads
AWS_REGION=us-east-1
SMTP_HOST=smtp.sendgrid.net
SMTP_USER=apikey
SMTP_PASS=your_sendgrid_key
PORT=4000
# Frontend (.env.local)
NEXT_PUBLIC_API_URL=http://localhost:4000/api
NEXT_PUBLIC_GOOGLE_MAPS_KEY=your_maps_keyPOST /api/auth/login
POST /api/auth/register
GET /api/orders β List orders (filtered by role)
POST /api/orders β Create new order (customer)
PATCH /api/orders/:id/approve β Approve order (sales/manager)
PATCH /api/orders/:id/reject β Reject order (sales/manager)
PATCH /api/orders/:id/assign β Assign crew (sales/manager)
GET /api/jobs β My jobs (crew) / all jobs (manager)
PATCH /api/jobs/:id/status β Update job status (crew)
POST /api/jobs/:id/photos β Upload install photos (crew)
GET /api/resources β Inventory list (manager)
POST /api/resources/order β Order new resources (manager)
GET /api/analytics/overview β KPI summary (manager)
GET /api/analytics/installs β Install trends (manager)
- Fork the repo
- Create feature branch:
git checkout -b feature/your-feature - Commit changes:
git commit -m 'feat: add your feature' - Push to branch:
git push origin feature/your-feature - Open a Pull Request
MIT License β see LICENSE for details.
Built with βοΈ to make solar accessible for everyone.