|
| 1 | +# SPA Architecture Plan (Angular + .NET 8 API) |
| 2 | + |
| 3 | +## Current architecture status |
| 4 | +- Angular standalone-first architecture is active (no feature NgModules used in runtime). |
| 5 | +- Clear boundaries are in place: |
| 6 | + - `core`: auth, api clients/models, config, layout, realtime, preferences. |
| 7 | + - `shared`: shared module + reusable cross-feature UI. |
| 8 | + - `features`: page-level domain slices. |
| 9 | +- API contracts are typed and aligned under `core/api/models` and consumed through `core/api/clients`. |
| 10 | +- RxJS is used for async/server orchestration; Signals/computed are used for local/session/preferences state. |
| 11 | + |
| 12 | +## Implemented folder structure |
| 13 | +- `src/app/core/config`: app environment token + runtime config plumbing. |
| 14 | +- `src/app/core/auth`: OIDC PKCE auth service + guards (`auth`, `admin`, `managerOrAdmin`). |
| 15 | +- `src/app/core/http`: query param/url helpers and HTTP integration utilities. |
| 16 | +- `src/app/core/api`: typed DTOs + API clients (`projects`, `taskitems`, `activity`, `dashboard`, `users`). |
| 17 | +- `src/app/core/realtime`: SignalR hub integration for activity feed/log updates. |
| 18 | +- `src/app/core/preferences`: persisted app preferences service (density/date/notification/kanban defaults). |
| 19 | +- `src/app/features`: dashboard, projects, tasks, search, calendar, activity, profile, settings, docs, admin. |
| 20 | + |
| 21 | +## Routing and authorization (implemented) |
| 22 | +- Public routes: |
| 23 | + - `/` (landing) |
| 24 | + - `/login` |
| 25 | + - `/callback` |
| 26 | +- Protected routes: |
| 27 | + - dashboard/workspaces/delivery/activity/account/about. |
| 28 | +- Role-restricted routes: |
| 29 | + - `/admin` -> `Administrator`. |
| 30 | + - `/activity/log` -> `Administrator` or `ProjectManager`. |
| 31 | + |
| 32 | +## Sidebar information architecture (current) |
| 33 | +- Overview: Dashboard |
| 34 | +- Workspaces: All Projects, Project Details, Project Members, Create Project, Kanban |
| 35 | +- Delivery: All Tasks, My Tasks, Create Task |
| 36 | +- Activity: My Activity, Activity Log, Calendar, Search & Filters |
| 37 | +- Account: Profile & Security, Settings |
| 38 | +- Administration: Admin Dashboard |
| 39 | +- About: Project Docs |
| 40 | + |
| 41 | +## Core feature status |
| 42 | +- Auth foundation: |
| 43 | + - OIDC Authorization Code + PKCE, callback handling, guarded routes. |
| 44 | +- Dashboard: |
| 45 | + - Summary KPIs + activity history + SignalR live updates + preview fallback. |
| 46 | +- Kanban: |
| 47 | + - Project picker, grouped status columns, drag/drop, create/edit dialogs, optimistic patch flows. |
| 48 | +- Search & filters: |
| 49 | + - Cross-entity filtering flows aligned with current API clients. |
| 50 | +- Project tools: |
| 51 | + - All Projects, Project Details, Project Members. |
| 52 | +- Task tools: |
| 53 | + - All Tasks, My Tasks, Create Task. |
| 54 | +- Activity tools: |
| 55 | + - My Activity (personal timeline) + Activity Log (admin/pm audit). |
| 56 | +- Account: |
| 57 | + - Profile & Security, Settings (persisted app preferences). |
| 58 | + |
| 59 | +## Contract alignment rules (enforced) |
| 60 | +- Frontend uses backend enums/contracts from typed models (no ad-hoc enum invention). |
| 61 | +- Patch semantics preserve omitted vs `null` behavior. |
| 62 | +- Date values sent to API follow ISO conventions. |
| 63 | +- Problem Details responses are surfaced consistently at UI layer. |
| 64 | + |
| 65 | +## Quality and cleanup status |
| 66 | +- Legacy scaffold artifacts removed: |
| 67 | + - unused dummy services (`ProjectService`, `TaskItemService`, `LoginService`) and associated specs. |
| 68 | + - empty unused feature modules (`projects.module.ts`, `task-item.module.ts`). |
| 69 | +- UI consistency pass completed across major pages: |
| 70 | + - header card + kpi cards + main content card patterns. |
| 71 | + - PrimeNG built-in table filter strategy on table-centric pages. |
| 72 | + |
| 73 | +## Known backend/API gaps worth addressing |
| 74 | +- Activity endpoint filtering: |
| 75 | + - Current contract used by SPA does not expose server-side actor/type/date filters. |
| 76 | + - Activity Log currently applies these filters client-side after fetching feed data. |
| 77 | +- Authorization matrix check: |
| 78 | + - `GET /api/projects/{id}` policy should be verified against intended `User` read capabilities. |
0 commit comments