A clean-architecture REST API for booking plumbing & home-maintenance services.
FarroService Backend is the API powering a plumbing and home-services booking platform. It handles service catalog management, master (technician) scheduling, client bookings, and role-based administration — built with Clean Architecture principles on top of ASP.NET Core.
Clients book services through a simple public form (no account required), while admins and masters manage services, schedules, and bookings through authenticated endpoints.
| Layer | Technology |
|---|---|
| Framework | ASP.NET Core 10 |
| Language | C# |
| ORM | Entity Framework Core |
| Application logic | MediatR (CQRS pattern) |
| Authentication | ASP.NET Identity + JWT Bearer |
| Database | PostgreSQL hosted on Neon |
| Geocoding | Nominatim API |
| API docs | Scalar (OpenAPI UI) |
The solution follows a layered Clean Architecture approach:
backend/
├── FarroService.DAL/ # Entities, repositories, EF Core, migrations
├── FarroService.BLL/ # DTOs, MediatR commands/queries/handlers
└── FarroService.WebAPI/ # Controllers, DI configuration, Program.cs
- DAL — persistence layer: entity models,
DbContext, repositories, and database migrations. - BLL — business logic layer: request/response DTOs and CQRS handlers via MediatR.
- WebAPI — presentation layer: REST controllers, middleware, and application startup.
| Entity | Description |
|---|---|
ApplicationUser |
Identity-based user (Admin / Master), extended with full name and specializations |
Service |
A bookable service with price, duration, and an associated specialization |
Specialization |
A category of expertise linking masters to the services they can perform |
Booking |
A client reservation for a service with a specific master, date, and time slot |
Schedule |
A master's weekly working hours per day of the week |
| Role | Description |
|---|---|
MainAdmin |
Full system access |
Admin |
Manages services, masters, and bookings |
Master |
Manages own schedule and assigned bookings |
Clients do not have accounts — bookings are created via a public form using just a name and phone number.
- Bookings are only allowed within working hours: 10:00–19:00.
- A master can only be booked for a service that matches one of their specializations.
- Available time slots are calculated per master, per service, per day.
- .NET 10 SDK
- A PostgreSQL database (e.g. a free Neon instance)
# Restore dependencies
dotnet restore
# Configure your database connection string via User Secrets
dotnet user-secrets set "ConnectionStrings:DefaultConnection" "<your-connection-string>"
# Apply EF Core migrations
dotnet ef database update --project FarroService.DAL
# Run the API
dotnet run --project FarroService.WebAPINote: Use the direct Neon connection endpoint (without
-pooler) for migrations — the pooled endpoint can cache stale "database not found" errors afterdotnet ef database drop.
On first run, the database is seeded with:
- 4 specializations: Plumbing, Heating, Sewerage, Water Supply
- 7 services linked to those specializations
- A
MainAdminand anAdminaccount - 3 masters, each with 2 specializations and a Mon–Fri, 10:00–19:00 schedule
| Role | Password | |
|---|---|---|
| MainAdmin | admin@farro.ua |
Admin123! |
| Admin | manager@farro.ua |
Admin123! |
Full interactive API documentation is available via Scalar once the project is running:
https://localhost:<port>/scalar
It covers authentication, services, masters, specializations, schedules, bookings, and user administration endpoints, including required roles and request/response schemas, generated from the app's OpenAPI specification.
options.MapInboundClaims = trueis required for JWT — in .NET 10 this defaults tofalse, which silently breaks role-based authorization.AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true)is enabled to supportDateTime.Kind = Unspecifiedvalues in queries against PostgreSQL.
Part of the FarroService diploma project — see the frontend repository for the client application.