Skip to content

taiphanvan2k3/LegalAssistant.AppService

 
 

Repository files navigation

Legal Assistant - Clean Architecture

📁 Project Structure

LegalAssistant.AppService/
├── src/
│   ├── Domain/           # 🏛️ Domain Layer - Business Rules
│   ├── Application/      # 🔧 Application Layer - Use Cases
│   ├── Infrastructure/   # 🗄️ Infrastructure Layer - External Services
│   └── Web.Api/         # 🌐 Presentation Layer - API Endpoints
└── README.md

🏗️ Clean Architecture Layers

🏛️ Domain Layer (Core)

  • No dependencies - The purest layer
  • Contains business rules and domain logic
  • Aggregates, Entities, Value Objects, Domain Events

🔧 Application Layer (Use Cases)

  • Depends on: Domain
  • Orchestrates use cases and business workflows
  • Commands, Queries, Handlers, Behaviors

🗄️ Infrastructure Layer (Data & External)

  • Depends on: Domain + Application
  • Implements repositories and external services
  • Database, Email, File Storage, APIs

🌐 Presentation Layer (Web.Api)

  • Depends on: Application + Infrastructure
  • Controllers, Middleware, Models
  • API endpoints and HTTP concerns

🚀 Dependency Flow

Presentation → Application → Domain
     ↓              ↓
Infrastructure -----→

🔧 Technologies

  • .NET 8 - Framework
  • MediatR - CQRS Pattern
  • Entity Framework Core - ORM
  • FluentValidation - Validation
  • Serilog - Logging
  • Swagger - API Documentation

📚 Patterns Implemented

  • Clean Architecture
  • CQRS (Command Query Responsibility Segregation)
  • Domain Events
  • Repository Pattern
  • Specification Pattern
  • Pipeline Behaviors

🚀 Getting Started

Prerequisites

  • .NET 8.0 SDK or later
  • Docker & Docker Compose
  • Your favorite IDE (Visual Studio, VS Code, JetBrains Rider)

Development Setup

  1. Clone the repository

    git clone <repository-url>
    cd LegalAssistant.AppService
  2. Restore dependencies

    dotnet restore
  3. Build the solution

    dotnet build

Running the Application

Option 1: Local Development (Recommended)

# Start only the database with Docker
docker-compose up -d postgres

# Run the API locally for development
dotnet run --project src/Web.Api

The API will be available at https://localhost:10001 and http://localhost:10000

Option 2: Full Docker Setup

# Run all services in Docker
docker-compose up -d --build

All services will run in containerized environment

Verify Installation

  • Open your browser and navigate to https://localhost:10001/swagger or http://localhost:10000/swagger
  • You should see the Swagger UI with API documentation

📖 Documentation

🏗️ Architecture & Design

🔧 Development Guidelines

🛠️ Operations & Commands

📂 Layer-Specific Documentation

Releases

No releases published

Packages

No packages published

Languages

  • C# 91.4%
  • HTML 7.8%
  • Other 0.8%