A full-stack CRM platform designed for solar energy companies to manage customers, installations, equipment, energy production, and customer support. This project demonstrates enterprise-grade backend architecture and domain-driven design, tailored for the renewable energy industry.
SolarCRM provides a structured solution for companies in the solar industry by covering the following:
- Customer Management β onboarding, document storage, and lifecycle tracking (Lead β Prospect β Active β Inactive).
- Installation Management β project workflow (Survey β Design β Permits β Installation β Inspection β Activation).
- Technician Assignment β manage and track crews working on installations.
- Equipment Tracking β inventory, assignment, warranties, and maintenance.
- Energy Monitoring β capture production data, compare expected vs. actual output, and log system health.
- Support & Communication β ticketing system with attachments, technician assignments, and resolution tracking.
- Document Management β unified file handling for customers, installations, and support cases.
- Backend: ASP.NET Core (Clean Architecture + CQRS)
- Database: PostgreSQL with Entity Framework Core
- Frontend: React (TypeScript + TailwindCSS)
- Authentication: JWT-based role management (Admin, Technician, Customer)
- Logging & Testing: Serilog, xUnit, Moq, FluentAssertions
SolarEnergyManagement/
βββ Backend/
β βββ Domain/ # Core business entities
β β βββ Entities/
β β β βββ Customer.cs
β β β βββ Installation.cs
β β β βββ EnergyProduction.cs
β β β βββ Technician.cs
β β βββ Enums/
β β β βββ CustomerStatus.cs
β β β βββ InstallationStatus.cs
β β β βββ SystemHealth.cs
β β βββ ValueObjects/
β βββ Application/ # Business logic and use cases
β β βββ Features/
β β β βββ Customers/
β β β β βββ Commands/
β β β β βββ Queries/
β β β βββ Installations/
β β β βββ EnergyMonitoring/
β β βββ Common/
β β βββ Interfaces/
β β βββ Behaviors/
β β βββ Models/
β βββ Infrastructure/ # Data access and external services
β β βββ Data/
β β β βββ ApplicationDbContext.cs
β β β βββ Configurations/
β β βββ Services/
β β β βββ EmailService.cs
β β β βββ FileStorageService.cs
β β βββ Identity/
β βββ WebAPI/ # API controllers and configuration
β βββ Controllers/
β β βββ CustomersController.cs
β β βββ InstallationsController.cs
β β βββ EnergyController.cs
β βββ Extensions/
βββ tests/
β βββ UnitTests/
β βββ IntegrationTests/
βββ frontend/ (Future)
βββ solar-dashboard-react/
- Stores customer details (name, email, phone, address).
- Tracks status (
Lead,Prospect,Active,Inactive). - Linked to installations, documents, and support tickets.
- Reusable entity for customer addresses and installation sites.
- Represents a solar project with workflow stages (
Survey β Design β Installation β Activation). - Tracks system specs (size, panel count, inverter type).
- Linked to customer, installation address, status history, equipment, technicians, and documents.
- Daily production metrics (
Actual vs Expected). - Linked to installations and optional weather data.
- Helps calculate performance and detect system health issues.
- Inventory entity for panels, inverters, batteries, etc.
- Tracks type, status (
InStock,Installed,NeedsRepair), warranty, and costs. - Assignable to installations.
- Many-to-many mapping of users (technicians) to installations.
- Tracks assignment date, role (Surveyor, Installer, Inspector), and completion status.
- Generic storage entity with polymorphic links to Customer, Installation, or SupportTicket.
- Supports various types: contracts, permits, photos, reports, etc.
- Ticketing system for customer issues.
- Tracks status (
Open β InProgress β Resolved β Closed) and priority (Low β Critical). - Linked to customer, installation, assigned user, and documents.
- Represents system users: Admin, Technician, or Customer.
- Stores authentication details and technician-specific info (specialization, license).
- Linked to assigned installations and support tickets.
- CustomerStatus: Lead, Prospect, Active, Inactive
- InstallationStatus: Survey, Design, Permits, Installation, Inspection, Active, Deactivated
- EquipmentType: SolarPanel, Inverter, Battery, etc.
- EquipmentStatus: InStock, Assigned, Installed, NeedsRepair, Retired
- SystemHealthStatus: Excellent β Offline
- TicketStatus / TicketPriority
- DocumentType: Customer, Installation, Ticket, Generic
- UserRole: Admin, Technician, Customer
Lead β Prospect β Survey β Design β Permits β Installation β Active
Installation β Energy Production β Performance Analysis β Billing β Reporting
- Survey - Site assessment and requirements gathering
- Design - System design and engineering
- Permits - Regulatory approvals and documentation
- Installation - Physical system installation
- Inspection - Safety and compliance verification
- Activation - System commissioning and monitoring setup
-
Clone the Repository
git clone <project> cd solar-crm
-
Set Up Configuration Create a
.envfile in the project root and add the following values:-
Database Connection
DEFAULTCONNECTION=Host=localhost;Database=SolarEnergyDb;Username=postgres;Password=yourpassword
-
JWT Settings
JWT_SECRET=your-jwt-secret-key-minimum-32-characters-long JWT_ISSUER=your-app-name JWT_AUDIENCE=your-app-users JWT_EXPIRY_MINUTES=jwt_lifetime JWT_REFRESH_TOKEN_LIFETIME_DAYS=refresh-token-lifetime
-
-
Run Database Migrations
dotnet ef database update --project src/Infrastructure --startup-project src/WebAPI
-
Build and Run the Application
dotnet restore dotnet build dotnet run --project src/WebAPI
-
Access the API
- API Documentation (Scalar): https://localhost:5228/scalar/v1
This is a learning project, but contributions and suggestions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with βοΈ for the clean energy future!