Infrastructure spend tracking for contractors and developers.
Know when you're over budget.
Sentri is a self-hosted REST API designed to help contractors and developers track infrastructure costs across multiple cloud providers (AWS, DigitalOcean, Vercel, etc.). Define monthly budgets per provider, log expenses as they happen, and get email alerts automatically when spend approaches a configurable warning threshold . so you never get hit by a surprise bill.
| Feature | Description |
|---|---|
| Provider Management | Create and manage infrastructure providers with monthly budgets and warning thresholds |
| Expense Tracking | Register individual expenses against any provider |
| Monthly Budget Cycles | Automatic monthly snapshots isolate spending periods cleanly |
| Threshold Alerts | Email notifications via Brevo when spending crosses your warning threshold |
| JWT Authentication | Secure, per-user data isolation out of the box |
| Vertical Slice Architecture | Features are fully self-contained . easy to navigate, easy to extend |
Sentri is built on Vertical Slice Architecture . each feature owns its own request, handler, response, and endpoint. There are no shared services leaking across feature boundaries.
Sentri.Api/
├── Domain/ # Core entities & domain events
│ ├── Provider.cs
│ ├── Expense.cs
│ ├── ProviderMonthlySnapshot.cs
│ └── User.cs
├── Features/ # One folder per use case
│ ├── Auth/ # Register & login
│ ├── Providers/ # CRUD + expense registration
│ ├── Expenses/ # Expense queries
│ └── Notifications/ # Brevo email integration
└── Infrastructure/ # EF Core DbContext & migrations
Key technology choices:
- ASP.NET Core 10 . Minimal APIs, no controllers
- Entity Framework Core 10 . PostgreSQL via Npgsql
- MediatR . Internal event dispatch (domain events)
- JWT Bearer . Stateless authentication
- xUnit + FluentAssertions + NSubstitute . Test stack
- coverlet . Code coverage collection
- .NET 10 SDK
- PostgreSQL instance (local or Docker)
- A Brevo API key (for email alerts)
git clone https://github.com/fernandesdiego/Sentri.git
cd Sentricd src/Sentri.Api
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "Host=localhost;Database=sentri;Username=postgres;Password=yourpassword"
dotnet user-secrets set "JwtSettings:Key" "your-super-secret-key-at-least-32-chars"
dotnet user-secrets set "JwtSettings:Issuer" "sentri"
dotnet user-secrets set "JwtSettings:Audience" "sentri-users"
dotnet user-secrets set "Brevo:ApiKey" "your-brevo-api-key"dotnet ef database updatedotnet runSwagger UI is available at https://localhost:{port}/swagger in development mode.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/auth/register |
Register a new user | ❌ |
POST |
/auth/login |
Get a JWT token | ❌ |
GET |
/providers |
List all your providers | ✅ |
GET |
/providers/{id} |
Get a single provider | ✅ |
POST |
/providers |
Create a provider | ✅ |
POST |
/providers/{id}/expenses |
Register an expense | ✅ |
GET |
/providers/{id}/expenses |
List provider expenses | ✅ |
All authenticated endpoints scope data strictly to the authenticated user.
dotnet testWith coverage:
dotnet test --collect:"XPlat Code Coverage"When an expense pushes a provider's monthly spend past its WarningThreshold (a value between 0–1 representing the fraction of MonthlyBudget), Sentri automatically fires a domain event that triggers an email notification via Brevo. No polling, no cron jobs.
Example: A provider with a $100 budget and a 0.8 threshold will trigger an alert the moment cumulative spend in the current month exceeds $80.
This is a personal project and is not currently accepting contributions. Feel free to fork and adapt it for your own use.