Full Stack (dotnet, angular and postgres) boilerplate with Docker

About (Dotnet - Angular - PostgresSQL)

This project is intended to provide a starting point for building full-stack web applicatioin. The stack is made of Dotnet(7) WebApi, Angular (15.0.3), PostgresSQL. The focus of this project to show case the possible way to run a real application (Dotnet, Angular and PostgresSQL) using docker for development enviornment and produciton mode.

This is a simple web application. It has working user registration, login page and there is a complete example of CRUD which contains example for Angular Routing and dotnet rest api samples. Also, rest services are secure using JWT.

Below is the architecture of the application while it is running.

To Quick Run

Clone repo, navigate to root folder and run docker-compose -f 'docker-compose.yml' up

  git clone https://github.com/nitin27may/angular-dotnet-core-docker.git angular-dotnet
  cd angular-dotnet 
  docker-compose -f 'docker-compose.yml' up

Please note, I have used Sendgrid, so it will require a sendgrid key to run, as it is sending an email confirmation on register, if you do not need, you can remove that code while registeing (in AccountService Class)

Project Folders

The apps written in the following JavaScript frameworks/libraries:

folder Description
frontend frontend app using Angular
WebApi Rest Api using dotnet

Built With

Angular (15.0.3)

The fronend of this project is developed in Angular. As we are using Server Side Rendering (SSR) we have used Nodejs alpine image in place of other lightweight docker image like nginx to run Angular app.

It contains sample for below:

  1. User Registration
  2. Login
  3. Profile
  4. A complete CRUD example for Contact

Also, it has sample code for Auth guard, services, http interceptors, resolver and JWT implementation

Dockerfile for Production Dockerfile for Development

Dotnet (7.0.0)

Rest APis of this project is devloped using dotnet

It contains sample for:

  1. Middleware implemetation for logs
  2. JWT implementation for Authorization
  3. API routing
  4. User registration & login APIs
  5. Complete CRUD example for Contact

Dockerfile for production Dockerfile for development

Getting started

Using Docker

Prerequisite

Install latest Docker Desktop

Entity Framework Migration

We have added a dockerfile for entity framework migration and updating database.

Dockerfile for Migration

Development mode:

You can start the application in debug mode (database, api and frontend) using docker-compose:

 git clone https://github.com/nitin27may/angular-dotnet-core-docker.git angular-dotnet
cd angular-dotnet 

docker-compose -f 'docker-compose.debug.yml' up

It will run fronend http://localhost:4200 and api on http://localhost:8080. you can also access PGAdmin on port 5050 with username pssword provided in docker-compose, username: nitin27may@gmail.com, password: root.

Also, it will automatically refresh (hot reload) your UI for code and api code changes.