A sample full-stack CRUD application with a .NET 6 Web API backend and an Angular frontend UI; it is a demo project, not production-hardened. Evidence: Backend/UserBackend/API/Program.cs, Frontend/src/app/app.component.ts, Backend/UserBackend/API/API.csproj, Frontend/package.json.
To demonstrate a layered backend (API/Domain/Infrastructure) and a simple Angular Material UI that consumes the API, intended as a CRUD reference implementation. Evidence: Backend/UserBackend/UserBackend.sln, Backend/UserBackend/Domain, Backend/UserBackend/Infrastructure, Frontend/src/app.
Prerequisites:
- .NET SDK 6.0 (from
Backend/UserBackend/API/API.csproj). - Node.js 16 (from
Frontend/Dockerfile). - Docker (optional, from
docker-compose.yml,Backend/Dockerfile,Frontend/Dockerfile).
Run locally:
- Backend:
cd Backend/UserBackend/API && dotnet run. - Frontend:
cd Frontend && npm install && npm start.
Run tests:
- Frontend:
cd Frontend && npm test(Karma). Evidence:Frontend/package.json. - Backend: Unknown; no test project found.
Troubleshooting:
docker-compose.ymlusesFrontEnd/but the folder isFrontend/; update the path if Docker builds fail. Evidence:docker-compose.yml,Frontend/.- Frontend API URLs are hard-coded to
http://localhost:7066, which will not resolve inside Docker without network configuration. Evidence:Frontend/src/app/app.component.ts.
flowchart TD
Frontend[Angular Frontend] --> API[.NET 6 Web API]
API --> Domain[Domain Validation]
API --> Infra[Infrastructure]
Infra --> InMemoryDB[EF Core InMemory DB]
The frontend calls API endpoints, which delegate validation to Domain and persistence to Infrastructure using an in-memory EF Core database. Evidence: Frontend/src/app/app.component.ts, Backend/UserBackend/API/Controllers/UserController.cs, Backend/UserBackend/Domain/Validator/UserValidator.cs, Backend/UserBackend/Infrastructure/ApiContext.cs.
Backend/UserBackend/API: Web API entrypoint and controllers.Backend/UserBackend/Domain: DTOs, validation, and utilities.Backend/UserBackend/Infrastructure: EF Core models, repository, and context.Frontend/src/app: Angular components and dialogs.docker-compose.yml,Backend/Dockerfile,Frontend/Dockerfile: container orchestration and runtime.
API endpoints (ASP.NET Core):
GET /User/AllGET /User/PostsGET /User/Posts/{id}POST /User/CreatePOST /User/UpdateDELETE /User/DeleteEvidence:Backend/UserBackend/API/Controllers/UserController.cs.
Swagger UI (dev):
- Launch URL
swaggerwith application URLshttp://0.0.0.0:7066andhttp://0.0.0.0:5233(fromBackend/UserBackend/API/Properties/launchSettings.json).
Sample request bodies: Unknown; would be confirmed by API examples or documentation (none found).
- Backend app settings:
Backend/UserBackend/API/appsettings.json,Backend/UserBackend/API/appsettings.Development.json. - Backend launch profiles:
Backend/UserBackend/API/Properties/launchSettings.json. - Frontend API base URLs:
Frontend/src/app/app.component.ts. - Docker composition:
docker-compose.yml. - CORS policy:
WithOrigins("*")inBackend/UserBackend/API/Program.cs. - No
.envfiles are present.
Secrets and injection:
- No secret injection configured; no credential values present in
appsettings*.json.
Backend packages:
- Swashbuckle (Swagger) in
Backend/UserBackend/API/API.csproj. - FluentValidation in
Backend/UserBackend/Domain/Domain.csproj. - EF Core + EF Core InMemory in
Backend/UserBackend/Infrastructure/Infrastructure.csproj.
Frontend packages:
- Angular 15, Angular Material, RxJS, fluentvalidation-ts in
Frontend/package.json.
Database:
- EF Core InMemory provider (no external DB). Evidence:
Backend/UserBackend/Infrastructure/ApiContext.cs.
External services:
- None configured.
Tests:
- Angular tests via Karma (
npm test). Evidence:Frontend/package.json,Frontend/src/app/*.spec.ts. - Backend tests: None found.
CI:
- None found.
Linting/formatting:
- None configured (no eslint, prettier, or dotnet format configs found).
Static analysis/security:
- None found.
Verification:
test -f WebApiAngularTask/docker-compose.yml
Status: Clean
Reviewed areas:
Backend/UserBackend/API/Program.csBackend/UserBackend/API/Controllers/UserController.csBackend/UserBackend/API/appsettings.jsonBackend/UserBackend/API/appsettings.Development.jsonBackend/UserBackend/API/Properties/launchSettings.jsonBackend/UserBackend/Domain/Model/APIUser.csBackend/UserBackend/Domain/Validator/UserValidator.csBackend/UserBackend/Domain/Util/APIResponse.csBackend/UserBackend/Domain/Util/Enums.csBackend/UserBackend/Domain/Util/Util.csBackend/UserBackend/Infrastructure/ApiContext.csBackend/UserBackend/Infrastructure/IUserRepository.csBackend/UserBackend/Infrastructure/UserRepository.csBackend/UserBackend/Infrastructure/Model/User.csBackend/UserBackend/Infrastructure/Model/Post.csBackend/UserBackend/Infrastructure/Util/Util.csFrontend/src/app/app.component.tsFrontend/src/app/grid-component/grid-component.component.tsFrontend/src/app/table-component/table-component.component.tsFrontend/src/app/view-dialog/view-dialog.component.tsdocker-compose.ymlBackend/DockerfileFrontend/DockerfileFrontend/angular.jsonFrontend/tsconfig.jsonFrontend/tsconfig.app.jsonFrontend/tsconfig.spec.jsonFrontend/package.jsonREADME.md
Findings:
- None.
Actions taken:
- None.
Notes:
- Binary images in
img/were not inspected.
Documentation:
- P1/S: Docker networking and API base URL guidance. Next action: document how to configure frontend API URLs for Docker.
Tests:
- P1/M: Backend unit/integration tests. Next action: add a test project and
dotnet testinstructions.
Security:
- P1/S: CORS policy is permissive. Next action: restrict origins in
Backend/UserBackend/API/Program.csfor non-demo use.
Reliability:
- P2/M: Persistence beyond in-memory DB. Next action: add a real database provider and configuration.
Operations:
- P2/M: CI pipeline for build/test. Next action: add a GitHub Actions workflow for backend and frontend builds.
Developer experience:
- P2/S: No linting/formatting scripts. Next action: add eslint/prettier and dotnet format guidance.
It provides a working reference for a .NET 6 Web API with layered architecture and an Angular Material frontend consuming CRUD endpoints. Evidence: Backend/UserBackend/UserBackend.sln, Frontend/src/app/view-dialog/view-dialog.component.ts.
Project type: Full-stack demo (ASP.NET Core + Angular)
Primary domain: User and post CRUD
Core entities: Users, Posts (Backend/UserBackend/Infrastructure/Model/User.cs, Backend/UserBackend/Infrastructure/Model/Post.cs)
Extension points: Validation rules (Backend/UserBackend/Domain/Validator/UserValidator.cs), API endpoints (Backend/UserBackend/API/Controllers/UserController.cs), UI dialogs and tables (Frontend/src/app/view-dialog, Frontend/src/app/table-component).
Areas safe to modify: Domain validation and UI components.
Areas requiring caution and why: Backend/UserBackend/Infrastructure/ApiContext.cs (database provider selection), Frontend/src/app/app.component.ts (hard-coded API URLs).
Canonical commands:
- build:
cd Frontend && npm run build;cd Backend/UserBackend/API && dotnet build - run:
cd Frontend && npm start;cd Backend/UserBackend/API && dotnet run;docker compose up - test:
cd Frontend && npm test; backend tests not defined