A clean, minimal API example implemented in C# .NET, designed as a lightweight template and learning resource.
- About
- Features
- Getting Started
- API Overview
- Project Structure
- Configuration
- Testing & Requests
- Contributing
- Contact
IntegrApi is a minimalist example of a RESTful API built using the .NET minimal API style (available since .NET 6), focused on simplicity and best practices. The goal is to serve both as:
- A boilerplate for microservices or small backend services.
- A learning tool to understand how to set up and organize a minimal API in C#.
Minimal APIs reduce boilerplate compared to traditional controller-based ASP.NET projects, making them ideal for lightweight apps, microservices, or rapid prototyping. :contentReference[oaicite:0]{index=0}
- 🚀 Minimal setup with Program.cs as the entry point
- 📡 Simple CRUD endpoints
- 🔧 Configuration using
appsettings.json - 📁 Layered architecture: Models, Properties, etc.
- 💬 HTTP request examples using
.httpfile - 🧪 Ready for further integration with testing suites or middleware
- .NET 8 SDK (or later)
- A code editor such as Visual Studio, VS Code or Rider
- (Optional) Postman, curl, or HTTP client to test API endpoints
-
Clone the repository:
git clone https://github.com/dannylbr/IntegrApi.git cd IntegrApi -
Restore NuGet packages:
dotnet restore
-
Build the project:
dotnet build
To run the API locally, use the following command:
dotnet run --project IntegrApiBy default, the application will start listening on a configured port (as defined in appsettings.json, if any). You can explore the HTTP endpoints or run the .http file included in the repo to test it quickly.
Below is a conceptual overview of the possible endpoints:
| Method | Route | Description |
|---|---|---|
GET |
/ |
Return "Elegant." |
GET |
/user/{id} |
Return a boilerplate User |
IntegrApi/
│
├── Models/ # Domain models (e.g., DTOs, business objects)
│ └── User.cs
│
├── Properties/ # Auto-generated or project metadata files
│ └── launchSettings.json
│
├── Program.cs # Entry point: minimal API + routing + DI
│
├── appsettings.json # Default config
├── appsettings.Development.json # Dev overrides
│
├── IntegrApi.http # Pre-made HTTP requests (for VSCode, etc.)
│
├── IntegrApi.sln # Solution file
│
├── .gitignore # Git ignore rules
|
└── README.md # Project documentation-
appsettings.json: holds the configuration for the application (ports, logging, etc.). -
appsettings.Development.json: overrides for development environment.
You can easily extend this to support secret storage, connection strings, or feature flags.
While this project does not include automated tests yet, you can:
- Use the IntegrApi.http file to send HTTP requests directly from VS Code (using the REST Client extension).
- Use tools like Postman or curl for manual testing.
Here’s a sample curl request to get "Elegant." string (change localhost:5000 to your running port):
curl -X GET http://localhost:5000/Contributions are very welcome! Here are a few ways you could help:
- Add unit / integration tests
- Implement middleware (e.g., logging, validation, authentication)
- Provide error handling / validation
- Add OpenAPI / Swagger integration
- Improve documentation or expand the .http file with more example requests
Feel free to open issues or pull requests — I appreciate your help!
- GitHub: dannylbr
- Email: integraesol@gmail.com
- LinkedIn: Daniel Soares
Thank you for checking out IntegrApi!