This repository demonstrates the Client, API Resource, and Token Service (CAT) pattern using Angular and .NET technologies.
Repository: https://github.com/workcontrolgit/AngularNetTutorial.git
- Complete Tutorial Series - Comprehensive guide covering architecture, features, benefits, and detailed component documentation
- Developer Guide - Technical reference for working with this codebase
- Setup Submodules Guide - Git submodules setup instructions
AngularNetTutorial/
├── Clients/
│ └── TalentManagement-Angular-Material/ # Angular Material client
├── ApiResources/
│ └── TalentManagement-API/ # ASP.NET Core Web API
└── TokenService/
└── Duende-IdentityServer/ # Duende IdentityServer
| Component | Technology | Version | Repository |
|---|---|---|---|
| Client | Angular + Material Design | 20.x | TalentManagement-Angular-Material |
| API | ASP.NET Core Web API | .NET 10 | TalentManagement-API |
| Identity | Duende IdentityServer | 7.0 | Duende-IdentityServer |
- .NET 10 SDK
- Node.js 20+ and npm
- Git
- Visual Studio Code or your preferred IDE
This repository uses Git submodules to manage the individual components. Clone everything with:
git clone --recurse-submodules https://github.com/workcontrolgit/AngularNetTutorial.git
cd AngularNetTutorialOr if you've already cloned without submodules:
git clone https://github.com/workcontrolgit/AngularNetTutorial.git
cd AngularNetTutorial
git submodule update --init --recursivecd TokenService/Duende-IdentityServer/src/Duende.STS.Identity
dotnet restore
dotnet runURL: https://localhost:44310
cd ApiResources/TalentManagement-API
dotnet restore
dotnet runURL: https://localhost:44378
cd Clients/TalentManagement-Angular-Material/talent-management
npm install
npm startURL: http://localhost:4200
Angular Application User:
- Username:
ashtyn1 - Password:
Pa$$word123
IdentityServer Admin UI:
- Username:
admin - Password:
Pa$$word123 - URL:
https://localhost:44303
| Component | URL | Description |
|---|---|---|
| Angular Client | http://localhost:4200 |
Main application UI |
| Web API | https://localhost:44378 |
RESTful API endpoints |
| IdentityServer | https://localhost:44310 |
Authentication & Authorization |
| IdentityServer Admin | https://localhost:44303 |
IdentityServer admin panel |
| IdentityServer Admin API | https://localhost:44302 |
IdentityServer admin API |
The CAT (Client, API Resource, Token Service) pattern separates concerns:
- Client: User interface (Angular with Material Design)
- API Resource: Business logic and data access (.NET Core Web API)
- Token Service: Authentication and authorization (Duende IdentityServer)
- User authenticates via the Angular client
- Client redirects to IdentityServer for login
- IdentityServer issues tokens (ID token, access token)
- Client uses access token to call API
- API validates token with IdentityServer
Contains different client implementations. Currently includes:
- TalentManagement-Angular-Material: Angular application with Material Design components
Future additions may include:
- React client
- Blazor WebAssembly client
Contains the backend API that serves data to clients. The API:
- Protects endpoints using JWT bearer authentication
- Validates tokens issued by IdentityServer
- Implements business logic and data access
Contains the identity and authentication server:
- Issues tokens (JWT)
- Manages user authentication
- Handles OAuth 2.0 and OpenID Connect flows
- Manages API scopes and client configurations
Each component has its own configuration:
- IdentityServer:
appsettings.json- Configure clients, API resources, and identity resources - API:
appsettings.json- Configure database connections and IdentityServer authority - Angular Client:
environment.ts- Configure API and IdentityServer URLs
- Make changes in the appropriate submodule
- Test locally
- Commit changes within the submodule
- Push submodule changes to its remote repository
- Update the parent repository to reference the new submodule commit
# In the submodule directory
cd ApiResources/TalentManagement-API
git add .
git commit -m "Your changes"
git push
# In the parent directory
cd ../..
git add ApiResources/TalentManagement-API
git commit -m "Update API submodule"
git pushIf submodules aren't initialized:
git submodule update --init --recursiveTo pull latest changes from all submodules:
git submodule update --remote --mergeIf default ports are in use, update the configuration:
- IdentityServer:
Properties/launchSettings.json - API:
Properties/launchSettings.json - Angular:
angular.jsonor useng serve --port <port>
- OAuth 2.0 and OpenID Connect
- Duende IdentityServer Documentation
- ASP.NET Core Documentation
- Angular Documentation
[Specify your license here]
Found an issue or want to improve the tutorials?
- Report issues: Open an issue in the repository
- Suggest improvements: Submit a pull request
- Share feedback: Let us know what's helpful or confusing
We welcome contributions to improve documentation, fix bugs, add features, or enhance existing components.