BurgerClash

I am excited to present BurgerClash, developed with great enthusiasm using ASP.NET 7.0 API, MVC, SignalR, and Javascript.

Project Features

  • Real-time Communication and Statistics:
  • Using SignalR in the project, instant communication is established with customers and staff. Order statuses and reservation updates are shared instantly, and business owners have immediate access to statistics.

  • Table Status and Order Notifications:
  • The restaurant's table status is virtually displayed in real-time, and when new orders arrive, immediate notifications are sent to business owners or service personnel, enabling quick and efficient service to customers.

  • Statistics Display:
  • Dynamic statistics displays added to the project provide business owners with visual access to important data such as sales trends, popular products, and income reports.

  • Notifications and Updates:
  • Both customers and staff receive instant notifications for reservation confirmations, order statuses, special offers, and promotions.

Technologies Used

  • Technological Platform:
    • ASP.NET Core API 7.0: Used to create and manage web APIs.
    • SignalR: Utilized for real-time communication and sending instant updates to customers and staff.
    • QR Code Library (QRCoder): Integrated to generate QR codes representing orders.
  • Docker and Database Management:
    • Docker and Docker Compose: Used to deploy and manage the project quickly and seamlessly in different environments.
    • Microsoft SQL Server (MSSQL): Chosen for reliable and scalable database management.
  • Project Architecture:
    • N-tier Architecture: Based on the principles of N-tier architecture, the project has a modular structure, separating the application into different layers (presentation, business logic, data access, etc.).
    • Repository Pattern: Used for database interactions, abstracting database operations and making the code more organized and easier to maintain.
  • Frontend and Security:
    • JavaScript and Ajax: Used on the frontend to create an interactive user interface.
    • Model-View-Controller (MVC) Architecture: Used as a fundamental architectural structure in both the frontend and backend.
    • JWT (JSON Web Token): Used for user authentication processes.

Best Practices Implemented

  1. Custom Response DTO
  2. A Custom Response DTO is used to standardize and organize data sent to clients. Benefits: Ensures a cleaner user experience by formatting and filtering unnecessary information.

  3. DTO Usage
  4. Data Transfer Objects (DTOs) are employed to efficiently structure data exchanged with clients. Benefits: Optimizes data transfer and enhances communication with clients.

  5. Mapping with Automapper
  6. Automapper is utilized for seamless mapping between DTOs, automating object mapping. Benefits: Reduces code redundancy, simplifies maintenance, and ensures consistent data mapping.

  7. Custom ControllerBase
  8. A specialized ControllerBase class is created for API controllers. Benefits: Encapsulates common functionalities (e.g., business logic, error handling) to reduce repetition across controllers.

  9. Validator and Validate Filters
  10. Custom validator classes ensure the accuracy of incoming data. Validate filters are used to verify requests pre or post-processing. Benefits: Standardizes error messages, minimizes code repetition, and enhances data validation.

CashLayer and Caching

In the project, CashLayer is utilized to enhance performance and avoid redundant database calls for products. CashLayer caches specific data points, providing quick access to the data and consequently improving the overall performance of the application.

How to Use?

CashLayer caches data obtained from specific service calls for a defined period. This enables sections of the application that frequently access the same data to benefit from improved performance.

Project Guide

This project brings together innovative features using modern technologies. Welcome to BurgerClash, where technology meets flavor!

Sure! Here’s the revised and complete section on testing for the BurgerClash project:


Testing

Overview

Testing is a crucial part of the BurgerClash project, ensuring the application is robust, reliable, and performs as expected. A variety of testing strategies and tools are used to validate different aspects of the application, from individual components to the entire system.

Testing Tools and Frameworks

  • xUnit is the primary framework used for unit testing in BurgerClash. It integrates seamlessly with .NET 7.0, providing a robust platform to ensure that individual components behave correctly.

  • Moq is utilized to create mock objects during unit testing. By simulating dependencies, Moq helps isolate components, ensuring that tests produce accurate and meaningful results.

  • An in-memory version of SQL Server is used for testing the data access layer. This approach allows for database operations to be tested without impacting the live database, offering quick and consistent test outcomes.

  • Postman is employed for testing RESTful APIs within the project. It allows developers to create, manage, and execute API requests, as well as automate API testing workflows, ensuring that the endpoints function as intended.

  • Swagger is integrated into the project to document and test APIs. It provides an interactive interface to explore and execute API operations, ensuring that all endpoints are correctly implemented and documented.

Testing Methodologies

  • Unit tests are developed to validate isolated components of the application, ensuring that each part functions as expected. These tests cover a wide range of scenarios, including edge cases, to ensure robustness.

  • Integration tests are performed to verify that different modules of the application work together seamlessly. These tests focus on interactions between the ASP.NET Core API, SignalR, and the database, ensuring that the integrated system functions correctly.

  • E2E testing validates the entire user journey through the application. Using automated tools, these tests simulate real user interactions to ensure that critical paths, such as ordering, table management, and notifications, work as expected.

  • Performance testing is conducted using tools like Apache JMeter. These tests simulate high traffic conditions to ensure that the system can handle real-world usage efficiently without performance degradation.

Continuous Integration (CI)

  • The BurgerClash project leverages GitHub Actions for continuous integration. This setup automatically runs tests on every commit, helping maintain high code quality and preventing regressions by catching issues early in the development process.