A production-ready RESTful API for a Personal Portfolio application, built with ASP.NET Core 8, MongoDB, and Clean Architecture.
Technologies
Framework: ASP.NET Core 8 Web API
Database: MongoDB (Official C# Driver)
Authentication: JWT (JSON Web Tokens) with Refresh Tokens
Validation: FluentValidation
Logging: Serilog
Documentation: Swagger / OpenAPI
Mapping: AutoMapper
Status Codes
200 OK: Request succeeded.
201 Created: Resource created successfully.
400 Bad Request: Validation failure (FluentValidation) or invalid input.
401 Unauthorized: Missing or invalid JWT token.
403 Forbidden: Valid token but insufficient permissions.
404 Not Found: Resource does not exist.
500 Internal Server Error: Server-side exception.
Validation
FluentValidation is used to validate incoming DTOs. If validation fails, a 400 response is returned with a list of error messages in the errors field.
Swagger Documentation
Swagger UI is available in Development mode at /swagger.
How to Authenticate in Swagger
Obtain a token via POST /api/auth/login.
Copy the accessToken from the response.
Click the Authorize button at the top right of the Swagger page.
Enter Bearer <YOUR_ACCESS_TOKEN> in the value box.
Click Authorize.
Now you can execute Admin endpoints directly from the UI.
AutoMapper
Deploy to Render / Railway