Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

Initial Database Seed (temporary manual setup)

Run the following SQL to initialise and seed the database (as we use Dapper in this microservice, we do not have migrations or automatic seeding):

Running the app through docker

  • Build and run the docker-compose file
docker-compose -f docker-compose.yaml up --build
docker-compose -f docker-compose.yaml down
  • If you wish to run docker manually instead of through docker-compose, or wish to push the docker image to Docker Hub, follow the instructions in ManualDockerInstructions.md

Technical Info

Architecture

  • Uses the Clean Architecture (API / Core / Infrastructure) pattern, which keeps business rules independent of frameworks, databases, and external services.

    • API – Exposes endpoints, handles requests/responses, authentication, and application configuration.
    • Core – Contains domain models, business rules, use cases, and contracts/interfaces for external dependencies.
    • Infrastructure – Implements persistence, external integrations, and other technical concerns defined by the Core.
  • The Layered Architecture is an alternative approach that organizes the application into layers (Presentation, Business Logic, Data Access), this is done to separate concerns and promote maintainability, but it can lead to tight coupling between layers and less flexibility in adapting to changes.

    • I implemented the Product Service Micro-Service using this approach to demonstrate the differences between the two architectures and how Clean Architecture can provide better separation of concerns and flexibility in adapting to changes.

Technical Stack

  • Uses Dapper as the ORM (not EF)
    • While EF is better for change tracking (migrations), and has LINQ support
    • Dapper is better for high-performance latency-sensitive Microservices as can execute raw sql with minimal overhead and not relying on how LINQ is decomiled into sql
  • Dependency Injection
  • Uses AutoMapper
  • Clean Architecture Principles (split sub-projects: API | Core | Infrastructure )
  • Has injected Exception Handling Middleware
  • Has Fluent Validation for confirming correctness of DTO's, automatically validated incoming requests through FluentValidation's MVC Pipeline Middleware
  • Uses Swagger for interactive API documentation
  • Uses PostgresSQL as the database
  • Uses traditional Controller-based endpoints

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages