Skip to content

phucngo2/PRN231-DotNet-CleanArchitecture

Repository files navigation

📚 PRN231-DotNet-CleanArchitecture 🚀

Just a simple .Net API with CRUD features, following Domain-Driven Design (DDD) principles 🥲! Powered by .NET 8 and C hashtag version 12.

🛠️ Built With

.Net C# Postgres Redis Docker JWT

🚧 Development Setup

Prerequisites

Before starting, ensure you have the following tools and environments set up on your machine:

  • .NET 8.0 SDK
  • PostgreSQL
  • Redis
  • Docker (optional)

⭐ Local Development Setup

1. Clone the Repository

git clone <repository_url>
cd <project_directory>

2. Configure Application Settings

Update the configuration files located at PRN231.API/appsettings.json and PRN231.API/appsettings.Development.json with appropriate database connection strings, Redis configurations, and other settings.

3. Restore Dependencies

At the root directory, restore the required NuGet packages by running:

dotnet restore

4. Run the Application

Launch the application locally using the following command:

dotnet run --project PRN231.API

🚀 The application will listen on:

(You can change these ports in the launchSettings.json file located at PRN231.API/Properties/launchSettings.json)

🐳 Dockerized Development Setup (Optional)

1. Configure Application Settings

Update the same configuration files (PRN231.API/appsettings.json and PRN231.API/appsettings.Development.json) with appropriate database connection strings, Redis configurations, and other settings.

2. Build and Run Docker Containers

At the project root directory, use Docker Compose to build and run the containers:

docker compose up

🎯 To-Dos

  • Develop CRUD operations.
  • Develop "hand-made" authentication operations.
  • Integrate soft delete functionality.
  • Implement DTOs and AutoMapper for object mapping.
  • Implement DbFactory, Unit of Work, and Repository patterns.
  • Implement exception handling middleware / .NET 8 exception handler.
  • Implement Result Monad.
  • Implement Minimal APIs.
  • Enable authentication using JWT tokens.
  • Automatically log AuditLogs to the database.
  • Automatically track Entities' CreatedAt and ModifiedAt timestamps.
  • Integrate SignalR for real-time notifications.
  • Implement Redis Cache for efficient data caching.
  • Implement SMTP Email sender.
  • Refactor: Use email templates instead of hard-coding.
  • Set up Hangfire for background jobs.
  • Replace AutoMapper by Mapperly to improve performance.
  • Implement ASP.NET Core Identity.
  • Implement RabbitMQ for messaging services.
  • Apply CQRS Pattern (Command and Query Responsibility Segregation).
  • Dockerize the application for easy deployment 🐳.

About

Just a simple .Net API with CRUD features.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published