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!