Giter Site home page Giter Site logo

referbruv / containerninja.cleanarchitecture Goto Github PK

View Code? Open in Web Editor NEW
212.0 8.0 56.0 1.78 MB

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.

Home Page: https://referbruv.com

License: MIT License

C# 67.44% Dockerfile 1.57% HTML 6.54% JavaScript 1.45% TypeScript 22.63% SCSS 0.36%
clean-architecture onion-architecture asp-net-core angular docker-compose docker dotnet6 entity-framework-core aspnet-core code-first

containerninja.cleanarchitecture's Introduction

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

containerninja.cleanarchitecture's People

Contributors

dependabot[bot] avatar referbruv avatar sriramkumarm1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

containerninja.cleanarchitecture's Issues

Refresh

When navigating to a different page than the root (ex: http://localhost/login) and press F5 I get a 404 Not Found. Is there a way to fix that in the proxy?

Test Project feature

Is your feature request related to a problem? Please describe.
I believe addition of test project for both frontend and backend would complete the solution

PostgresSQL support

I've tried adding dbconnection using postgres but it is not working. In the service.cs ive added the below

services.AddDbContext(options =>
options.UseNpgsql(
Configuration.GetConnectionString("DefaultConnection")));

Unhandled exception. System.ArgumentException: Connection string keyword 'server' is not supported. For a possible alternative, see https://go.microsoft.com/fwlink/?linkid=2142181.
at Microsoft.Data.Sqlite.SqliteConnectionStringBuilder.GetIndex(String keyword)
at Microsoft.Data.Sqlite.SqliteConnectionStringBuilder.set_Item(String keyword, Object value)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.