Gravy is a robust, scalable, and cleanly architected backend solution for a food delivery application, built using ASP.NET Core Web API. Gravy leverages modern software engineering principles, including Clean Architecture, Domain-Driven Design (DDD), and advanced techniques like the Outbox Pattern, Redis Cache, and Comprehensive Logging.
This project is designed for high performance, maintainability, and developer productivity.
-
🍔 Efficient Order Processing
Scalable and reliable order lifecycle management. -
🗂️ Clean Architecture
Clear separation of concerns for maintainability and testability. -
🌐 Domain-Driven Design (DDD)
Focused on aligning the codebase with real business requirements. -
🔁 Outbox Pattern
Ensures reliable message delivery and event processing. -
⚡ Redis Cache
Enhances application performance with fast caching. -
📜 Comprehensive Logging
Detailed monitoring and logging using Serilog for improved debugging and observability.
The project is built using the following libraries, tools, and frameworks:
Technology | Purpose |
---|---|
ASP.NET Core | Web API development |
Entity Framework Core | ORM for database access |
Dapper | Lightweight ORM for high-performance queries |
Redis | Caching for fast data access |
Serilog | Logging and monitoring |
AutoMapper | Object mapping for cleaner code |
FluentValidation | Input and model validation |
Gravy employs modern and proven architectural and design patterns:
-
Clean Architecture
- Enforces separation of concerns to ensure long-term maintainability.
- Divides the project into Domain, Application, Infrastructure, and Presentation layers.
-
Domain-Driven Design (DDD)
- Focused on the core domain logic and encapsulating business rules.
-
Outbox Pattern
- Ensures reliable event publishing to external systems using transactional outboxes.
-
Repository Pattern
- Abstracts database access logic for cleaner and more testable code.
-
Result Pattern
- Provides a standardized way to handle operation results, making it easier to deal with success and failure cases.
-
Idempotency
- Ensures that operations can be performed multiple times without different outcomes, which is crucial for reliability in distributed systems.
-
CQRS (Command Query Responsibility Segregation)
- Separates read and write operations to optimize performance and scalability.
-
Logging
- Implements comprehensive logging to capture important events and errors, aiding in monitoring and debugging the application.
Follow these steps to set up the project locally:
Ensure you have the following installed:
- .NET 9 SDK
- PostgreSQL for database support
- Redis server (optional but recommended)
-
Clone the repository
git clone https://github.com/MrEshboboyev/Gravy.git cd Gravy
-
Restore dependencies
dotnet restore
-
Apply database migrations
dotnet ef database update
-
Run the project
dotnet run
The application will start at http://localhost:7082
.
Here’s a simple example of how to create a new order:
using Gravy.Application.Services;
using Gravy.Domain.Entities;
// Use the factory method to create a new order
var order = OrderCreate(
Guid.NewGuid(),
Guid.NewGuid(),
Guid.NewGuid(),
DeliveryAddress.Create(
"street",
"city",
"state",
Location.Create(
10.0,
12.0
)
);
To run the tests for Gravy:
dotnet test
The project uses xUnit for testing and ensures thorough coverage across application and domain layers.
We welcome contributions to Gravy! Follow these steps to get started:
- Fork the repository.
- Clone your fork locally:
git clone https://github.com/YourUsername/Gravy.git
- Create a new branch for your feature:
git checkout -b feature/your-feature
- Make your changes and commit them:
git commit -m "Add your feature"
- Push to your branch:
git push origin feature/your-feature
- Open a Pull Request.
Please make sure to adhere to the project's coding standards and best practices.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions, feedback, or collaboration opportunities:
- GitHub: @MrEshboboyev
- Email: mreshboboyev@gmail.com
Special thanks to:
- The ASP.NET Core Team for the incredible framework.
- All contributors to this project!
If you find this project helpful or interesting, please consider giving it a ⭐ on GitHub!
Thank you for checking out Gravy! We hope it simplifies your food delivery backend development and provides a foundation for robust applications. 🚀