This repository is part of the Udemy course on building microservices with ASP.NET Core, Angular, MongoDB, and Docker.
It demonstrates a modern microservices architecture with:
- API Gateway
- Security Microservice (Authentication & Authorization, SQL Server)
- Library Microservice (Book management, MongoDB)
- Angular Client (Frontend SPA)
- Backend: ASP.NET Core 8, MediatR, AutoMapper, FluentValidation, JWT, Entity Framework Core
- Frontend: Angular 19, Angular Material, RxJS, Flex Layout
- Databases: SQL Server (Security), MongoDB (Library)
- API Gateway: Ocelot (or your implementation)
- Containerization: Docker, Docker Compose
Some backend microservices require a secret key for JWT authentication.
You must set the Jwt:Key secret before running these services locally.
For each microservice that requires it (e.g., Security, Gateway), run:
dotnet user-secrets set "Jwt:Key" "YourSuperSecretKey" --project <PathToProjectFile>Replace <PathToProjectFile> with the path to the .csproj file of the microservice.
Run the following command in your terminal:
cd clientEnsure you're in the client directory and run:
npm installCreate a .env file in the client directory based on the provided .env.example. Update values as necessary.
To start the Angular frontend, use:
ng serveVisit http://localhost:4200 in your browser.
- Security Microservice: Handles authentication, user management, JWT issuance.
- Library Microservice: Manages books and related data.
- API Gateway: Routes requests to the appropriate microservice.
For detailed API endpoints, refer to the Swagger UI at each service's
/swaggerendpoint.
Key dependencies from package.json:
@angular/core,@angular/material,@angular/flex-layout,rxjs,express, etc.
Pull requests are welcome! For major changes, please open an issue first.
This project is for educational purposes as part of the Udemy course.
Enjoy building microservices! 🚀
Replace
"YourSuperSecretKey"with a strong, unique value.
Repeat these steps for any other microservice (such as the API Gateway) that uses JWT authentication and expects a Jwt:Key in its configuration.
