This project is a reference API project designed with a clean architecture. It includes mappers, JWT token, PostgreSQL as the database, and SonarQube for code analysis. The Unit of Work design, repository pattern and FluentValidation are utilized.
First, open your terminal or command prompt and navigate to your project directory:
cd /path/to/your/ReferenceApiProject
Ensure that you are in the project folder and run the following command to start the project:
docker-compose up -d
Verify Project Start After running the command, verify that your project has started successfully. You can do this by accessing your project in a web browser. Navigate to http://localhost:8081/swagger/index to check if your project is running properly. Additionally, you can also check the logs of your containers for further verification.
- Seq -> http://localhost:5341/
- Kibana -> http://localhost:5601/app/home#/
- Consul -> http://localhost:8500/ui/dc1/services
- Swagger UI -> http://localhost:8081/swagger/index.html
To stop the project and remove the Docker containers, run the following command:
docker-compose down
This project was developed using technologies such as:
- FluentValidation
- JWT (Role-based access control)
- AutoMapper
- UnitOfWork
- Repository Pattern
- CodeFirst
- Serilog (SEQ) (With correlationId)
- PostgreSQL
- Redis (For cache)
- Consul (For service registration)
- Middleware
- Change Tracker(interceptor methods)
- ElasticSearch and Kibana (for logging)
├── Reference.Api
│ ├── Cache
│ │ ├── CacheService.cs
│ │ └── ICacheService.cs
│ ├── Controllers
│ │ ├── AuthController.cs
│ │ └── UserController.cs
│ ├── Data
│ │ └── DataContext.cs
│ ├── Dtos
│ │ ├── Requests
│ │ │ ├── CreateUserRequest.cs
│ │ │ ├── ICommonProperties.cs
│ │ │ ├── LoginUserRequest.cs
│ │ │ └── UpdateUserRequest.cs
│ │ └── Responses
│ │ └── GetUserResponse.cs
│ ├── Enums
│ │ ├── UserRole.cs
│ ├── Extensions
│ │ ├── ConfigureMappingProfileExtension.cs
│ │ ├── HealthCheckConfigureExtension.cs
│ │ ├── JwtBearerOptionsSetup.cs
│ │ └── JwtOptionsSetup.cs
│ ├── Mapper
│ │ └── AutoMapperMappingProfile.cs
│ ├── MiddleWare
│ │ └── CorrelationIdMiddleware.cs
│ ├── Migrations
│ ├── Models
│ │ ├── BaseEntity.cs
│ │ └── User.cs
│ ├── Program.cs
│ ├── Repositories
│ │ ├── Implementations
│ │ │ ├── GenericRepository.cs
│ │ │ ├── UnitOfWork.cs
│ │ │ └── UserRepository.cs
│ │ └── Interfaces
│ │ ├── IGenericRepository.cs
│ │ ├── IUnitOfWork.cs
│ │ └── IUserRepository.cs
│ ├── Security
│ │ ├── IJwtProvider.cs
│ │ ├── JwtProvider.cs
│ │ └── JwtOptions.cs
│ ├── Services
│ │ ├── Implementations
│ │ │ ├── AuthService.cs
│ │ │ └── UserService.cs
│ │ └── Interfaces
│ │ ├── IAuthService.cs
│ │ └── IUserService.cs
│ └── Utils
│ ├── CreateUserValidator.cs
│ ├── UpdateUserValidator.cs
│ └── UserBaseValidator.cs
└── Reference.Api.Test
├── AuthServiceFixture.cs
├── GlobalUsings.cs
├── JwtProviderFixture.cs
├── Reference.Api.Test.csproj
├── UpdateUserValidatorFixture.cs
├── UserBaseValidatorFixture.cs
└── UserServiceFixture.cs