This project demonstrates the power of Copilot in building a fully functional web application using .NET Core 8. It highlights simplicity, scalability, and modularity through a collection of features.
Fully created with Copilot including this Readme
-
CRUD Operations:
Fully implemented Create, Read, Update, and Delete functionalities for the User entity. These are built using minimal endpoints, without relying on controllers. -
Search Functionality:
Includes an endpoint to filter users by their Username. Supports partial matching for easy querying.
- Custom Validation:
Manual validation for the User model ensures clean and accurate data inputs. Since this is a web project and not a Web API, model validation attributes are avoided to keep things lightweight and simple.
- Fixed Rate Limiter:
Limits incoming requests globally to 1 request every 5 seconds per client. Utilizes the built-in .NET rate limiting system for seamless integration.
-
Path Visit Counter:
Middleware counts how many times each endpoint (path) has been accessed. -
RequestCounterService:
Tracks visit counts and provides an interface for retrieving request statistics. -
/visits Endpoint:
A dedicated endpoint to retrieve a summary of all path visits as a JSON object.
- HTTP Requests File:
requests.httpfile included to test all endpoints directly using tools like Visual Studio Code's REST Client or similar utilities.
- .NET SDK 8.0 or later.
- A tool to run
.httpfiles (e.g., REST Client for VS Code or Postman).
- Clone the repository.
- Run the project:
dotnet run- POST
/users: Create a new user. - GET
/users: Retrieve all users or filter them by username using the search query parameter. - GET
/users/{id}: Retrieve a single user by ID. - PUT
/users/{id}: Update an existing user's details. - DELETE
/users/{id}: Remove a user by ID.
- GET
/visits: Get a JSON summary of how many times each endpoint has been visited.
- .NET Core 8
- Copilot AI
- REST Client / Postman (for testing)