Skip to content

A small-scale project demonstrating Clean Architecture, adhering to SOLID principles, and drawing inspiration from Domain-Driven Design. It also incorporates the CQRS pattern to showcase a structured approach to software development.

Notifications You must be signed in to change notification settings

natasakasikovic/gym-manager-app-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Last Commit

GymManagerApp API

GymManagerApp is an API designed for managing gym training sessions, training types, and users!

Report Bug

Table of Contents
  1. About The Project
  2. Getting Started
  3. Architecture
  4. Features

🧠 About The Project

This is a small-scale project demonstrating Clean Architecture, adhering to SOLID principles, and drawing inspiration from Domain-Driven Design (DDD). It also incorporates the CQRS pattern with MediatR to showcase a structured, testable, and maintainable approach to modern software development.

🛠️ Built With

  • .NET
  • Entity Framework
  • MediatR
  • FluentValidation

🚀 Getting Started

🧰 Prerequisites

This project requires the following tools installed on your machine:

.NET 9 SDK

PostgreSQL

⚙️ Installation

  1. Clone the repository

    git clone https://github.com/natasakasikovic/gym-manager-app-backend.git
    cd gym-manager-app-backend
  2. Set up database credentials. Edit the appsettings.json file in the Presentation project:

    "ConnectionStrings": {
     "DefaultConnection": "Host=HOST;Database=DATABASE;Username=USERNAME;Password=PASSWORD"
    }
  3. Apply migrations and create the database

    dotnet ef database update --project Infrastructure --startup-project Presentation
  4. Run the application

      dotnet run --project Presentation

(back to top)

🧱 Architecture

Architecture Diagram

  • Domain

    This layer contains entities and enums. Business logic is encapsulated within the entities themselves. It is entirely independent of any frameworks, which ensures maximum flexibility, maintainability, and reusability.

  • Application

    Like the domain layer, this one is also independent of the UI and database. It communicates with the infrastructure through interfaces, making it easily testable and adaptable. It follows the CQRS pattern using MediatR, allowing separation of read and write logic, and simplifying the handling of cross-cutting concerns. Two important MediatR behaviors are implemented in this layer:

    • Logging behavior – used to track and log request execution for better monitoring and debugging.

    • Validation behavior – used to enforce validation rules before the handler logic is executed, based on FluentValidation.

    The IDateTime interface is introduced to avoid direct dependency on system DateTime, and also to allow easy mocking during unit testing, which significantly improves testability.

  • Infrastructure

    This layer handles external concerns such as persistence, identity, and other integrations. It provides the concrete implementations for the interfaces defined in the application layer. If there is a need to switch to a different database or identity provider, only this layer needs to change, while Domain and Application layers remain untouched.

  • Presentation

    This is the entry point of the application. It contains API controllers, endpoints, and handles centralized error management via BaseApiController. It interacts with the application layer to execute commands and queries, serving as the interface between the user and the core logic.

✨ Features

  • User Authentication

    • User registration and login functionality.
    • Secured with JWT tokens.
  • Training Management

    • Create, update, fetch training sessions
    • Sign up for trainings
  • Training Type Management

    • Create, update, fetch training types

(back to top)

About

A small-scale project demonstrating Clean Architecture, adhering to SOLID principles, and drawing inspiration from Domain-Driven Design. It also incorporates the CQRS pattern to showcase a structured approach to software development.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages