This project is intended to provide a starting point for building full-stack web applicatioin. The stack is made of Dotnet(7) WebApi, Angular (18.1.0), 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.
Clone repo, navigate to root folder and run docker compose up
git clone https://github.com/nitin27may/angular-dotnet-core-docker.git angular-dotnet
cd angular-dotnet
docker compose 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)
The apps written in the following JavaScript frameworks/libraries:
folder | Description |
---|---|
frontend | frontend app using Angular |
WebApi | Rest Api using dotnet |
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:
- User Registration
- Login
- Profile
- 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
Rest APis of this project is devloped using dotnet
It contains sample for:
- Middleware implemetation for logs
- JWT implementation for Authorization
- API routing
- User registration & login APIs
- Complete CRUD example for Contact
Dockerfile for production Dockerfile for development
Install latest Docker Desktop
We have added a dockerfile for entity framework migration and updating database.
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.