• Stars
    star
    225
  • Rank 177,187 (Top 4 %)
  • Language
    C#
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ContainerNinja is a boilerplate template project to demonstrate building a multi-container Full Stack application with ASP.NET Core (.NET 6) Web API following Clean Architecture, and Angular.

ContainerNinja.CleanArchitecture

.NET Docker GitHub stars Twitter Follow

What is this project about?

ContainerNinja is a boilerplate template project to demonstrate building a multi-container Full Stack application with ASP.NET Core (.NET 6) Web API following Clean Architecture, and Angular. The solution uses Docker Compose to orchestrate deployment of this entire stack to Docker.

What does the Solution offer?

The Solution is built keeping in mind the most fundamental blocks an API must have in order to build a scalable and near-perfect API component. The solution offers a complete implementation of the following:

  • Clean Architecture with separated layers for API, Core, Contracts, Infra and Migrations
  • UnitOfWork with Generic Repository
  • Entity Framework Core migrations with SQLite
  • Complete CRUD for an Entity following CQRS, with segregated Commands and Queries
  • Fluent Validation of input inside the Command classes
  • Preconfigured Swagger UI
  • ETag generation and validation on the API side for Response Caching (GET) and Collision detection (PUT)
  • Ready to use Docker configuration with Dockerfiles
  • In-Memory Caching for single Entity via IMemoryCache
  • Distributed Caching implementation via IDistributedCache, with NCache
  • JWT Token API for Generation and Configured JWT Validation
  • Roles based Authorization with predefined Roles
  • Auditable Entities with User Tracking
  • Complete Client Implementation of Entity CRUD and Token management in Angular
  • API Versioning with separated Swagger Documentation
  • AutoMapper implementation for Entity-to-DTO conversion
  • One Command deployment in Docker with Docker Compose
  • ILogger logging implementation
  • Database Seeding with a Single User and Roles added as the application starts

Technologies Used

  • ASP.NET Core (.NET 6) Web API
  • Entity Framework Core (EFCore 6)
  • MediatR for .NET 6
  • Fluent Validation for .NET 6
  • SQLite
  • SwaggerUI
  • AutoMapper
  • Angular 13 (Client)
  • Bootstrap 4 (CSS Framework)
  • Nginx (Proxy)
  • Docker Compose

How do I get started with Docker Compose?

To get started, follow the below steps:

  1. Install .NET 6 SDK
  2. Install the latest NodeJS
  3. Install Docker Desktop (for Windows) / Docker (for Linux/Mac)
  4. Clone the Solution into your Local Directory
  5. On the Repository root you can find the docker-compose.yml file
  6. Run the below command to build and run the solution in Docker (requires a working Docker installation)
> docker-compose build --force-rm --no-cache && docker-compose up
  1. Once the containers start successfully navigate to http://localhost

I'm not into Docker. How do I get started?

You can also just run the solution without Docker by following the steps below:

  1. Install .NET 6 SDK
  2. Install the latest NodeJS
  3. Clone the Solution into your Local Directory
  4. Navigate to the API directory (./API) and run the below command to get the API running:
> dotnet run --project ./ContainerNinja.API
  1. Navigate to the Client directory (./Client) and run the below commands to get the Angular application running:
> npm install && npm start
  1. Open a browser, navigate to http://localhost:4200 and you're all set!

Default User:

The solution adds a default user to the database while starting up as a part of Seeding. You can use the below credentials to Login and start adding items.

EmailAddress: [email protected]; Password: admin

What is Docker Compose?

Docker-Compose is a configuration file which contains instructions for the Docker about how services should be built from respective Dockerfiles. While a Dockerfile aims at creating and customizing application containers by means of base images and instructions, the Docker-Compose file works on top of the Dockerfile and helps developers in running docker containers with complex runtime specifications such as ports, volumes and so on.

Read more: Dockerizing a Full Stack Application with Docker Compose

Issues or Ideas?

If you face any issues or would like to drop a suggestion, raise an issue

License

The solution is completely open source and is licensed with MIT License.

Show your Support

I really hope this solution helps developers get started on building awesome things with ASP.NET Core (.NET 6) Web API and get into the world of containerized development real quick.

Found this solution helpful and useful? You can do these to help this reach greater audience.

  1. Leave a star on this repository ⭐
  2. Recommend this solution to your colleagues and dev community
  3. Join my Twitter family. I regularly post awesome content on dev over there.
  4. Join my Facebook community. I regularly post interesting content over there as well.
  5. You can also buy me a cup of great coffee β˜•!

Buy Me A Coffee

For more detailed articles and how-to guides, visit https://referbruv.com

More Repositories

1

SwaggerHeroes

SwaggerHeroes is a boilerplate solution to demonstrate integrating Swagger UI with ASP.NET Core.
C#
44
star
2

CqrsNinja

CQRS Ninja is a boilerplate solution, built to demonstrate implementing CQRS in ASP.NET Core (.NET 6) via MediatR.
C#
39
star
3

MailingNinja

MailingNinja is a simple boilerplate solution that demonstrates sending mails with attachments from an ASP.NET Core (.NET 6) application using MailKit and MimeKit.
C#
34
star
4

CustomSchemeNinja

A Sample API project to demonstrate creating and using a custom authentication scheme in ASP.NET Core (.NET 6)
C#
31
star
5

simple-sts

A Minimalistic TokenServer based on the IdentityServer4 framework.
C#
27
star
6

CognitoUserManager

Cognito User Manager is a user management solution that demonstrates building User flows in AWS Cognito using ASP.NET Core.
C#
25
star
7

SocialNinja

Sample project to demonstrate Google and Facebook Authentication using ASP.NET Core
C#
19
star
8

dotnetcore-mongo-bookstore

A Sample Application to demonstrate working with MongoDB using ASP.NET Core
C#
16
star
9

role-policy-authorization-sample

A sample application to demonstrate the implementation of Role based and Policy based Authorization in ASP.NET Core
C#
16
star
10

aspnetcore-dynamodb-boilerplate

A sample application with boilerplate code to Demonstrate the Create, Retrieve, Update, Delete operations on a DynamoDB Table from ASP.NET Core application.
C#
12
star
11

odataheroes

ODataHeroes is a boilerplate solution, built to demonstrate OData API implementation in an ASP.NET Core (.NET 5) API
C#
12
star
12

cookie-authentication-example-aspnetcore

A Sample Application to explain how to setup Cookie Authentication with ASP.NET Core without using Identity.
C#
11
star
13

aspnetcore-rabbitmq-heroes-example

A sample project to explain the integration of RabbitMQ with an ASP.NET Core API.
C#
10
star
14

options-pattern-example

A sample project to demonstrate various prospectives of using Options pattern in ASP.NET Core
C#
9
star
15

aspnetcore-microservices-cloudformation

A sample application to demonstrate creating Microservices with ASP.NET Core in AWS using Serverless Application Model (SAM) and CloudFormation.
C#
6
star
16

log4net-sample

A Sample application to demonstrate configuring and implementing Log4Net.
C#
6
star
17

redis-heroes-dotnetcore-example

A Sample API project to demonstrate the configuration and usage of Redis cache in an ASP.NET Core (.NET 5) application space.
C#
6
star
18

flutter-webview-example

A sample application to demonstrate working with WebViews in Flutter
Dart
5
star
19

NCachedBookStore

A sample project to demonstrate query caching with Entity Framework Core via NCache.
C#
5
star
20

memcached-aspnetcore-sample

A Sample application to demonstrate usage of Memcached in ASP.NET Core
C#
4
star
21

PagedNinja

PagedNinja is a simple boilerplate project which explains the implementation of Pagination in ASP.NET Core Web API together with Entity Framework Core.
C#
4
star
22

aspnetcore-dapper-heroes-example

A sample API project to demonstrate integrating Dapper micro-ORM with ASP.NET Core. The API also contains implemented EF Core Repository in order to effectively compare and understand how they differ from one another in general usage.
C#
3
star
23

dynamodb-nodejs-sample

A sample NodeJS application to demonstrate working with DynamoDB
JavaScript
3
star
24

aspnetcore-lambda-layers-example

A Sample application to demonstrate working with AWS Lambda Layers with ASP.NET Core
C#
3
star
25

flutter-upload-download-image

C#
2
star
26

mysql-efcore-sample

A Sample example to demonstrate working with MySQL from an AspNetCore application using EF Core
C#
2
star
27

builder-pattern-example

A Sample Project to demonstrate the implementation of Builder Pattern
C#
2
star
28

covid-vaccine-tracker

A Portal to Check the Availability of COVID19 Vaccination Centers and Slot information across India. Built using the Cowin public APIs provided by the Government of India along with technical best practices.
C#
2
star
29

aws-parameterstore-aspnetcore-sample-app

A Sample application to demonstrate working with AWS Parameter Store in an ASP.NET Core Application / API
C#
2
star
30

aspnetcore-dependencyinjection-sample

A Sample application to demonstrate the use of Dependency Injection in ASP.NET Core
C#
1
star
31

referbruv

1
star
32

flutter-create-color-app

A sample application to demonstrate the use of RepaintBoundary and how to write files to storage via Flutter
Dart
1
star
33

flutter-login-form-example

A sample project to demonstrate creating and working with a Login form in Flutter using Forms widget.
Dart
1
star
34

servicelifetime-sample

A Sample application to demonstrate Service Lifetimes in AspNetCore.
C#
1
star
35

Fluent-AspNetCore-Example

HTML
1
star
36

node-express-mysql-simple-api

A Sample API to demonstrate creating APIs using NodeJs and Express.Js and integrating with MySql
JavaScript
1
star