Skip to content
/ Caravel-Template Public template

🚤 Caravel Template - code less, ship more.

License

Notifications You must be signed in to change notification settings

Talento90/Caravel-Template

Repository files navigation

Caravel Template

This template uses Caravel package as an SDK and it bootstraps a full functional web api with the following structure:

  • CaravelTemplate (Application Domain)
  • CaravelTemplate.Core (Application business logic)
  • CaravelTemplate.Infrastructure (External dependencies such as database)
  • CaravelTemplate.WebApi (HTTP Web Api using ASP.NET 3.1)
  • CaravelTemplate.WebApi.Tests (Integration tests)

PS: CaravelTemplate will be replaced for your project name when generating the project.

Features

  • Caravel SDK (Errors, Middleware, Exceptions)
  • Business logic using CQRS pattern (MediatR)
  • Entity Framework Core (InMemory and PostgresSQL)
  • Health Check mechanism
  • Swagger using Swashbuckle
  • Docker and Docker Compose
  • Logging using Serilog
  • Testing using Bogus (Fake data generator) and Fluent Assertions

Installation

Download and Install Template

git clone git@github.com:Talento90/caravel-template.git
dotnet new --install ~/caravel-template

Generate Project

dotnet new caravel-webapi -n MyProject -o ./

Note: MyProject is going to replace the CaravelTemplate

Run Web Api

dotnet run --project src/MyProject.WebApi

open http://localhost:5000/swagger/index.html

Docker Compose

  • Setup PostgresSQL database
  • Setup WebApi
# Setup and run docker compose
docker-compose up

# Remove containers
docker-compose down

Entity Framework Migrations

# Install dotnet-ef tool
dotnet tool install --global dotnet-ef

# Update dotnet-ef tool
dotnet tool update --global dotnet-ef

# Run DbContext Migration
dotnet ef migrations add {Migratio Name} --output-dir Data/Migrations --project src/CaravelTemplate.Infrastructure

# Run Identity DbContext Migration
dotnet ef migrations add {Migratio Name} --output-dir Data/Migrations --project src/CaravelTemplate.Identity

About

🚤 Caravel Template - code less, ship more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published