A REST API for managing a software development house: developers, the projects they work on, project types, and developer roles. Built with ASP.NET Core and secured with JWT authentication.
DevHouse models the core entities a development agency needs to track. The API exposes full CRUD operations across four resources:
| Resource | Endpoints |
|---|---|
| Developers | GET, POST, PUT, DELETE on /api/Developers |
| Projects | GET, POST, PUT, DELETE on /api/Projects |
| ProjectTypes | GET, POST, PUT, DELETE on /api/ProjectTypes |
| Roles | GET, POST, PUT, DELETE on /api/Roles |
Every endpoint is protected. Clients authenticate against /api/Auth/login to receive a JWT, then pass it as a Bearer token on subsequent requests.
The API is documented with Swagger, so the full endpoint surface is browsable and testable in the browser without any external tooling.
The project separates Controllers, Models, and the data context rather than putting logic in one place:
- Controllers handle HTTP concerns only — routing, status codes, request and response shapes
- Models define the domain entities and their relationships
- The DbContext in
Data/owns database access
This keeps each layer testable on its own and means a change to the database schema doesn't ripple into request handling.
Rather than writing SQL schema scripts by hand, the schema is defined in C# model classes and generated through EF Core migrations. The migration history lives in Migrations/, so the database can be rebuilt from scratch on any machine with a single command, and schema changes are versioned alongside the code.
Pomelo is used as the MySQL provider since EF Core has no first-party MySQL support.
Tokens are stateless, so the API doesn't hold session state and can be scaled horizontally without a shared session store. The token is signed and verified on each request, which suits an API consumed by clients that aren't browsers.
Swashbuckle generates the OpenAPI spec directly from the controllers and their attributes, so the documentation can't drift out of sync with the code. It also gives the API a working test client out of the box, including a flow for authorizing with a bearer token.
- .NET 9 / ASP.NET Core
- MySQL 8.0
- Entity Framework Core (Pomelo provider)
- JWT Bearer authentication
- Swagger / OpenAPI 3.0
-
Ensure you have .NET 9 SDK and MySQL Server 8.0 installed.
-
Clone the repository:
git clone https://github.com/Marcosen99/devhouse-api.git
cd devhouse-api/DevHouse- Copy
appsettingsExample.jsontoappsettings.jsonand fill in your MySQL credentials:
"ConnectionStrings": {
"DefaultConnection": "server=localhost;port=3306;database=devhouse;user=root;password=YOUR_PASSWORD;"
}appsettings.json is gitignored so credentials never reach the repository.
- Restore dependencies:
dotnet restoreRun the following commands to create and apply the database migrations:
dotnet ef migrations add InitialCreate
dotnet ef database updateThis will automatically create the devhouse database and all required tables.
dotnet runThe API will be available at: http://localhost:5010
Swagger UI will be available at: http://localhost:5010/swagger
To test authenticated endpoints in Swagger:
- Call
POST /api/Auth/loginwith the following body:
{
"username": "admin",
"password": "password"
}- Copy the token from the response
- Click Authorize at the top of the Swagger UI
- Enter
Bearer {your token}and click Authorize
server=localhost;port=3306;database=devhouse;user=root;password=YOUR_PASSWORD;
Update appsettings.json with your own MySQL username and password before running migrations.
| Package | Version | Purpose |
|---|---|---|
| Pomelo.EntityFrameworkCore.MySql | 9.0.0 | MySQL database provider for Entity Framework Core |
| Microsoft.EntityFrameworkCore.Design | 9.0.0 | Required for running EF Core migration commands |
| Microsoft.AspNetCore.Authentication.JwtBearer | 9.0.0 | JWT Bearer token authentication |
| Swashbuckle.AspNetCore | 6.9.0 | Swagger UI and API documentation |
The login credentials are seeded demo values for evaluating the API. A production deployment would require hashed credentials stored in the database and a signing key supplied through environment variables or a secrets store.