The web frontend is in src/learning-bank-web and is built with Next.js 15 App Router and TypeScript strict mode.
- Provide child and parent user experiences.
- Authenticate users through NextAuth with Google and Microsoft providers.
- Render account views and parent admin workflows.
- Use a Backend For Frontend pattern through route handlers under src/app/api.
- Keep client-side components free from direct backend calls where possible.
- Node engine: >=22.0.0
- Framework: next 15.5.18
- Auth: next-auth v5 beta
- Forms: react-hook-form with zod resolver
- Testing: vitest
Key files:
- src/learning-bank-web/package.json
- src/learning-bank-web/tsconfig.json
- src/learning-bank-web/next.config.ts
- src/learning-bank-web/vitest.config.ts
Location: src/learning-bank-web/src/app
Primary routes:
- / sign-in redirect gateway
- /sign-in public auth entry
- /dashboard child and parent account overview
- /tasks child and parent task experience
- /parent/children parent child management
- /parent/settings parent settings and category management
- /admin internal platform admin area
Shared layout:
- Root layout: src/app/layout.tsx
- Authenticated shell layout: src/app/(app)/layout.tsx
Location: src/learning-bank-web/src/components
Core components:
- DashboardClient, AccountCard, TransactionList
- DepositForm and TransferForm
- AppNav
Parent components:
- parent/ChildrenClient
- parent/CategoriesClient
- parent/PendingRequestsClient
Location: src/learning-bank-web/src/app/api
Implemented handlers:
- auth/[...nextauth]
- deposits
- withdrawals
- transactions/[transactionId]
- transfers/checking-to-savings
- transfers/savings-to-checking
- transfers/requests/[id]/review
- categories
- categories/[id]
- categories/[id]/archive
- categories/[id]/unarchive
- children
- parents/admins
- tasks
- tasks/[taskId]
- tasks/[taskId]/complete
- tasks/completions/[completionId]/review
- admin/settings
- admin/users/[userId]
These handlers proxy requests to backend API routes under /api/v1.
File: src/learning-bank-web/src/lib/auth.ts
Configured providers:
- Microsoft Entra ID using common issuer
Session strategy:
- JWT strategy
- Session callback injects user id and provider metadata
- Cookie options include HttpOnly and SameSite Lax
Files:
- src/learning-bank-web/src/lib/api-client.ts
- src/learning-bank-web/src/lib/server-api.ts
- src/learning-bank-web/src/types/api.ts
Pattern:
- Server components call server-api helpers.
- server-api retrieves token via auth.
- api-client sends requests to NEXT_PUBLIC_API_URL.
- DTOs are typed using interfaces in types/api.ts.
File: src/learning-bank-web/src/middleware.ts
Middleware redirects unauthenticated access for:
- /dashboard
- /parent
- /tasks
- /admin
Exclusions include:
- /api/auth
- Next static assets
- /sign-in
- Global styles and design tokens: src/learning-bank-web/src/app/globals.css
- Static images: src/learning-bank-web/public/images
Landing page screenshots for the task/reward feature live in src/learning-bank-web/public/images/screenshots:
- Parent task hero: ParentTaskView.png
- Child tasks list: ChildTaskView.png
- Parent recurring task setup: ParentTaskViewRecurring.png
- Reward shown as deposit in history: RewardDeposit.png
These are rendered on the home page in a second hero-and-gallery block to explain the end-to-end flow:
- Parent defines tasks and reward routing.
- Child submits completed tasks.
- Parent approves completion.
- Reward posts to the selected account as a categorized deposit.
Template file: src/learning-bank-web/.env.example
Detailed setup guide:
- docs/auth-setup.md
Required values:
- AUTH_SECRET
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
- AZURE_AD_CLIENT_ID
- AZURE_AD_CLIENT_SECRET
- NEXT_PUBLIC_API_URL
- NEXTAUTH_URL
From src/learning-bank-web:
- npm run dev
- npm run build
- npm run typecheck
- npm run test
- Vitest is configured with jsdom and setup file.
- No component test suites are committed yet.
- docker-compose expects a web Dockerfile but src/learning-bank-web/Dockerfile is not present.
- Additional end-to-end tests are not yet implemented.
- Platform admin user-management and runtime configuration flows should be expanded with dedicated end-to-end tests.
When adding frontend features:
- Add or extend backend endpoint and DTO first when behavior changes data contracts.
- Add or extend BFF route handler under src/app/api.
- Keep data fetching in server components or route handlers.
- Use client components only for interactive UI concerns.
- Add Vitest and Playwright coverage for critical paths.