master
· 1 branch
· 51.1 KB
Branches
1
Commits
30
Size
51.1 KB
Clone URL
Branches
| Branch | Latest Commit | Status |
|---|---|---|
master
|
9e532687 |
default |
Recent Commits
onmaster
| SHA | Message | Author | Date |
|---|---|---|---|
9e532687 |
Thomas Helledi | 2026-07-06T19:23:19+02:00 | |
9aa0d23e |
Thomas Helledi | 2026-07-06T18:47:11+02:00 | |
aa7f89fb |
Thomas Helledi | 2026-07-06T17:33:33+02:00 | |
3de6978c |
Thomas Helledi | 2026-07-06T13:41:48+02:00 | |
d3cc958a |
Thomas Helledi | 2026-07-06T13:31:44+02:00 | |
b76e0cca |
Thomas Helledi | 2026-07-06T12:16:55+02:00 | |
54e05852 |
Thomas Helledi | 2026-07-03T16:41:45+02:00 | |
631cf7f6 |
Thomas Helledi | 2026-07-02T16:40:28+02:00 | |
dedd65bd |
Thomas Helledi | 2026-07-02T16:29:21+02:00 | |
f9da88d8 |
Thomas Helledi | 2026-07-02T16:17:18+02:00 | |
db4470f2 |
Thomas Helledi | 2026-07-02T10:46:44+02:00 | |
ac4b593f |
Thomas Helledi | 2026-07-02T10:20:51+02:00 | |
fda9694e |
Thomas Helledi | 2026-07-02T00:03:52+02:00 | |
bb12c32a |
Thomas Helledi | 2026-07-02T00:00:27+02:00 | |
0983ec48 |
Thomas Helledi | 2026-07-01T23:53:16+02:00 | |
f5217064 |
Thomas Helledi | 2026-07-01T23:44:35+02:00 | |
d8a61159 |
Thomas Helledi | 2026-07-01T23:37:10+02:00 | |
89ab8951 |
Thomas Helledi | 2026-07-01T23:27:22+02:00 | |
1bce3419 |
Thomas Helledi | 2026-07-01T23:07:19+02:00 | |
96fd745a |
Thomas Helledi | 2026-07-01T23:01:08+02:00 | |
1c1dc0ba |
Thomas Helledi | 2026-07-01T22:51:40+02:00 | |
242965ad |
Thomas Helledi | 2026-07-01T22:41:42+02:00 | |
2d0bfe22 |
Thomas Helledi | 2026-07-01T22:15:51+02:00 | |
c8451cb6 |
Thomas Helledi | 2026-07-01T16:21:03+02:00 | |
2f1700e7 |
Thomas Helledi | 2026-07-01T16:01:02+02:00 | |
300c0e9d |
Thomas Helledi | 2026-07-01T15:46:48+02:00 | |
7b3e0f56 |
Thomas Helledi | 2026-07-01T15:17:35+02:00 | |
bfc5247a |
Thomas Helledi | 2026-07-01T15:02:27+02:00 | |
30b8e75a |
Thomas Helledi | 2026-07-01T14:43:59+02:00 | |
066e2331 |
Thomas Helledi | 2026-07-01T14:16:59+02:00 |
README
# Casi 2.0
Utility consumption management system for departments, apartments, residents, and sensor data tracking.
## Thomas:
Fjern header-top-level fra administration, så vi ikke ser 2x impersonate boks :D
## 🎯 Project Overview
Casi is a full-stack application for managing utility consumption (water, heat, electricity) with automated billing calculations, real-time sensor data processing, and comprehensive reporting.
**Stack:**
- **Backend**: .NET 9, Entity Framework Core, PostgreSQL
- **Frontend**: Angular 20, PrimeNG
- **Infrastructure**: Redis, Hangfire, SignalR, Kubernetes
## 🚀 Quick Start
### Prerequisites
- .NET 9 SDK
- Node.js 22.x
- PostgreSQL
- Redis
### Backend
```bash
cd Casi
dotnet restore
dotnet build
dotnet run --project Casi.Api
```
Backend runs on: `https://localhost:5010`
### Frontend
```bash
cd Casi/Casi.WebApp
npm install
ng serve
```
Frontend runs on: `http://localhost:4200`
## 📚 Documentation
Comprehensive documentation is available in the [`/docs`](./docs) folder:
- **[📖 Documentation Index](./docs/README.md)** - Complete overview of all documentation
- **[🏗️ Architecture](./docs/architecture/)** - System design and patterns
- **[💻 Development](./docs/development/)** - Developer guides and tools
- **[🚀 Operations](./docs/operations/)** - Deployment and maintenance
- **[🎨 Frontend](./docs/frontend/)** - Angular application docs
### Essential Reading
- **[CLAUDE.md](./CLAUDE.md)** - Complete project guide for AI assistants (development commands, architecture, conventions)
- **[Database Schema](./docs/architecture/database-schema.md)** - Understand the data model
- **[Versioning Guide](./docs/development/versioning-guide.md)** - How versioning works (`yyyy.MM.counter`)
## 🏗️ Architecture
```
Casi/
├── Casi.Api/ # REST API & SignalR hubs
├── Casi.Manager/ # Business logic layer
├── Casi.Repository/ # Data access layer
├── Casi.Entity/ # EF Core models (SQL Server)
├── Casi.Entity.Postgres/ # EF Core models (PostgreSQL)
├── Casi.Model/ # DTOs & view models
├── Casi.Service.Core/ # Background services & jobs
├── Casi.Infrastructure.Core/ # Cross-cutting concerns
├── Casi.Common/ # Shared utilities
├── Casi.UsageCalculator/ # Consumption calculations
├── Casi.Localization/ # i18n resources
└── Casi.WebApp/ # Angular frontend
```
**Request Flow:** API Controller → Manager → Repository → EF Core → Database
## 🔧 Development
### Common Commands
```bash
# Build solution
cd Casi
dotnet build Casi.sln
# Run tests
cd Casi.Test
dotnet test
# Create migration (SQL Server)
cd Casi.Entity
dotnet ef migrations add MigrationName --startup-project ../Casi.Api
# Build Angular app
cd Casi.WebApp
npm run build-prod
# Generate API client from Swagger
npm run build # Requires backend running on localhost:5010
```
### Environment Setup
1. **Database**: Configure connection strings in `appsettings.json`
2. **Redis**: Set Redis connection string
3. **Secrets**: Use user secrets for sensitive data
4. **Node**: Ensure Node.js v22.x is installed
See [CLAUDE.md](./CLAUDE.md) for detailed development instructions.
## 🚢 Deployment
**Docker:**
```bash
docker build -t casi:latest -f Dockerfile .
```
**Kubernetes:** See [`/pipelines`](./pipelines) for deployment manifests
**Version Format:** `yyyy.MM.counter` (e.g., `2025.10.61`)
- Auto-generated by Azure DevOps pipeline
- Counter resets monthly
- See [Versioning Guide](./docs/development/versioning-guide.md)
## 🎨 Features
- ✅ Multi-tenant customer & department management
- ✅ Real-time sensor data processing (CDC)
- ✅ Automated utility consumption calculations
- ✅ Role-based access control with Redis caching
- ✅ Background job processing with Hangfire
- ✅ SignalR real-time updates
- ✅ Graceful shutdown for long-running tasks (up to 1 hour)
- ✅ Automatic version update notifications
- ✅ Comprehensive logging (Serilog → PostgreSQL)
- ✅ Health checks & monitoring
## 📊 Tech Stack Details
| Component | Technology |
|-----------|------------|
| Backend Framework | .NET 9 |
| API | ASP.NET Core Web API |
| ORM | Entity Framework Core 9 |
| Database | PostgreSQL (+ SQL Server legacy) |
| Caching | Redis |
| Background Jobs | Hangfire |
| Real-time | SignalR |
| Frontend Framework | Angular 20 |
| UI Components | PrimeNG |
| Container | Docker |
| Orchestration | Kubernetes |
| CI/CD | Azure DevOps |
| Logging | Serilog |
| Monitoring | OpenTelemetry, Prometheus |
## 🤝 Contributing
1. Create a feature branch from `master`
2. Follow code conventions (see [CLAUDE.md](./CLAUDE.md))
3. Write tests for new features
4. Update documentation as needed
5. Submit pull request
### Code Conventions
- **Backend**: Async/await for I/O, `ResultModel<T>` for responses
- **Frontend**: Standalone components, PrimeNG, RxJS patterns
- **Database**: Soft deletes, audit fields (Created, Updated, Deleted)
- **Versioning**: CalVer `yyyy.MM.counter`
## 🐛 Troubleshooting
Common issues and solutions:
- **Migrations fail**: Check connection strings and database access
- **Background jobs not running**: Check Hangfire dashboard at `/hangfire`
- **Frontend API errors**: Verify CORS config and backend is running
- **Version banner not showing**: See [Debug Version Checker](./docs/development/debug-version-checker.md)
Full troubleshooting guide in [CLAUDE.md](./CLAUDE.md#troubleshooting).
## 📝 License
Proprietary - All rights reserved
## 📞 Support
For questions or issues:
- Check documentation in [`/docs`](./docs)
- Review [CLAUDE.md](./CLAUDE.md) for detailed guides
- Contact development team
---
**Current Version:** See latest deployment in Azure DevOps pipeline
**Last Updated:** 2025-10-31