This guide walks you from a fresh clone to a running API with a valid JWT token and a successful call to the service catalog. The whole process takes about ten minutes assuming SQL Server is already installed.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CodexaCP/SERVICIOS-BACK/llms.txt
Use this file to discover all available pages before exploring further.
Swagger UI is only available when
ASPNETCORE_ENVIRONMENT is set to Development. It is intentionally disabled in Production to avoid exposing the API schema publicly.Prerequisites
Before you begin, make sure the following are in place:
- .NET 8 SDK installed — verify with
dotnet --version(must be8.x). - SQL Server (Express or Developer edition) accessible at
.\SQLEXPRESSwith theEncomiendasDBdatabase created. You can create the empty database in SSMS with: - Git to clone the repository.
Configure appsettings.json
Open Adjust
appsettings.json (or create appsettings.Development.json to override locally) and verify the connection string and JWT settings match your environment.The defaults assume a local SQL Server Express instance:Server= if your SQL Server instance name differs (e.g., Server=localhost for a default instance or Server=.\SQLSERVER2022 for a named one).Run database migrations
All schema objects and stored procedures live in the Order matters — later scripts depend on tables and procedures created by earlier ones. After all files have been applied without errors, the database is ready.
Database/Migrations/ folder. Apply the SQL files in date order using SSMS or sqlcmd.With sqlcmd (run from the repo root):Start the API
From the project root, run:The API starts on two endpoints simultaneously:
Once the console shows You will see all available controllers and endpoints. The Swagger definition includes the Bearer security scheme so you can authorize directly in the UI after obtaining a token in the next step.If you need the API reachable from another device on your LAN (for example, when testing the Android app against a local server), use the This binds to
| Protocol | URL |
|---|---|
| HTTPS | https://localhost:7177 |
| HTTP | http://localhost:5258 |
Application started, open Swagger UI in your browser:lan launch profile instead:0.0.0.0:7177 and 0.0.0.0:5258.Authenticate and make your first request
Obtain a JWT token
Send aPOST request to /api/auth/login with valid credentials:token value. Any internally created user has mustChangePassword: true on first login and must call POST /api/auth/change-password before other actions are permitted.Fetch available services
Use the token as a Bearer credential to call the service catalog:PermiteAdjunto).From here you can explore the full API surface:- Browse services by category —
GET /api/services/by-category - Create a service request — first upload a payment voucher to
POST /api/uploads/payment, thenPOST /api/servicerequestswith the returnedimageUrl - Track your requests —
GET /api/servicerequests/my - System health (admin only, when
Diagnostics:EnableDiagnosticsistrue) —GET /api/v1/system/*