A simple, functional REST API for tracking personal expenses and incomes. This project was built as a pet project to explore modern .NET development patterns and is not intended for production use.
This application uses EF Core In-Memory Database.
- Data is not persistent and will be cleared every time the application restarts.
- It is designed for easy local testing without the need to set up a real SQL Server.
- This project is for educational/demonstration purposes only.
- User Authentication: Register and login using ASP.NET Core Identity API.
- Category Management: Create, update, and delete personal transaction categories.
- Transaction Tracking: Log incomes and expenses with dates, amounts, and comments.
- Statistics: Get monthly summaries including total balance, income/expense totals, and percentage breakdowns by category.
- Validation: Automatic input validation using FluentValidation and MediatR behaviors.
- Global Exception Handling: Consistent API responses for errors and business logic exceptions.
- Framework: .NET 10
- Architecture: Vertical Slice Architecture
- Patterns: MediatR (CQRS), Pipeline Behaviors
- Database: Entity Framework Core (In-Memory provider)
- Validation: FluentValidation
- Documentation: Swagger/OpenAPI
- Testing: xUnit, FluentAssertions (Unit Tests)
- Clone the repository:
git clone https://github.com/larkliy/ExpenseTracker.git
- Navigate to the project folder:
cd ExpenseTracker/ExpenseTracker - Run the application:
dotnet run
- Open your browser and navigate to
http://localhost:5000(or the port specified in the console) to view the Swagger UI.
The project includes a suite of unit tests for handlers and validators. To run them:
dotnet testThis project is open-source and available under the MIT License.