Commit graph

14 commits

Author SHA1 Message Date
Lasse Rune Hansen
33ed27abd8 fix(backend): resolve admin redirect, null reference, and Docker build issues
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Added Role to AuthResponse DTO and all auth endpoints
- Fixed null config handling in MistralConnector, TtsService, VoskService, MistralService
- Fixed BaseAddress setup in MistralConnector to work without API key
- Reverted seed data to use hardcoded bcrypt hashes (compatible with PasswordHasher)
- Added integration tests for StoryController
- Added unit tests for MistralConnector
- Updated frontend AuthResponse type to include role

Fixes admin redirect to /, story generation null reference, and Docker build failures.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-16 17:35:50 +02:00
Lasse Rune Hansen
0609a298f1 fix(frontend/admin): Fix admin routing - remove duplicate AdminLayout wrappers
PROBLEM:
- /admin redirects to / (home page)
- Admin pages were wrapping themselves in <AdminLayout>
- This caused double-nested layout (header, nav, footer twice)

ROOT CAUSE:
Admin pages (AdminDashboardPage, AdminUsersPage, etc.) were individually wrapping
their content in <AdminLayout> component. But the App.tsx routing already renders
<AdminLayout> as the parent element for all /admin routes, and AdminLayout uses
<Outlet /> to render child routes.

This created a nested structure:
AppLayout -> AdminLayout (from routing) -> AdminLayout (from page) -> Page Content

SOLUTION:
- Removed <AdminLayout> wrappers from all admin pages
- AdminLayout now always uses <Outlet /> instead of {children || <Outlet />}
- Removed unused 'children' parameter from AdminLayout
- Admin pages now render directly in the Outlet of AdminLayout

CHANGES:
- AdminDashboardPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminUsersPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminUserDetailPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminReportsPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminStoryGeneratorPage.tsx: Removed AdminLayout import and all <AdminLayout> tags
- AdminLayout.tsx: Removed unused children parameter, always use <Outlet />

Now /admin will correctly render the AdminLayout with nested admin pages.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-14 20:05:44 +02:00
Lasse Rune Hansen
70af326ca7 feat(frontend/admin): Complete Admin Module implementation
- Add AdminLayout component for consistent admin UI
- Create AdminDashboardPage with statistics overview
- Create AdminUsersPage with user management (CRUD, role changes)
- Create AdminReportsPage with user progress reports and CSV export
- Create AdminStoryGeneratorPage for AI-powered story generation
- Create AdminUserDetailPage for detailed user progress tracking
- Add comprehensive admin API client with all endpoints
- Add TypeScript types for admin DTOs (users, reports, stories)
- Add extensive CSS styles for all admin pages
- Update App.tsx with proper admin sub-routes
- Update admin-module.md feature documentation with completion status

Admin features:
- Dashboard with stats (users, lessons, quizzes, stories, activity)
- User management (list, view details, change roles, delete)
- Progress reports (view all, detailed user reports, CSV export)
- Story generator (AI story creation for levels with audio)
- Role-based authentication (AdminRoute protects all admin pages)
- Responsive design for all admin pages

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-14 15:29:20 +02:00
Lasse Rune Hansen
50f1b8a8dc feat(backend): Implement mandatory authentication and admin module
- Add Role property to User entity with migration
- Create BootstrapController for first admin user creation
- Remove [AllowAnonymous] from all learning content controllers
- Create AdminController with admin-only endpoints
- Create AdminService for user management
- Create UserReportService for progress reports
- Add UserRepository implementation
- Update AuthService with role support

feat(frontend): Implement authentication system
- Add AuthStore with React context for auth state management
- Create Login, Register, Landing, and Home pages
- Add ProtectedRoute and AdminRoute components
- Create Auth API types and client
- Configure Vite with @/ path alias
- Add comprehensive CSS styles for auth and landing pages

BREAKING CHANGE: All learning content now requires authentication.
Users must register and sign in before accessing lessons, quizzes, and stories.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-14 12:42:15 +02:00
Lasse Rune Hansen
ab811dc851 fix(frontend/nginx): Add /audio/ proxy and fix /api/ proxy to backend
- Fixed nginx proxy for /api/ to include /api/ prefix (backend expects it)
- Added /audio/ proxy to backend for audio file serving
- Backend serves audio from wwwroot/audio/story/

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-14 08:00:25 +02:00
Lasse Rune Hansen
de85cdec7c fix(backend/api): Remove [Authorize] from StoryController GET endpoints
- Removed class-level [Authorize] from StoryController
- Admin endpoints already have [Authorize(Roles = "Admin")]
- GET endpoints are now publicly accessible for development/testing
- Updated frontend API client to handle unauthenticated requests

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-14 07:41:50 +02:00
Lasse Rune Hansen
50f744c89d fix(frontend/api): Use relative paths for Docker proxy configuration
- Updated API client to use '/api' base URL in production (Docker)
- Updated StoryPlayer audio URL construction for Docker environment
- nginx proxies /api requests to backend:8080 in Docker Compose

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-14 07:29:12 +02:00
Lasse Rune Hansen
17ce0d1eb8 fix(frontend/story-integration): Fix TypeScript type imports and duplicate dictionary key
- Added 'import type' syntax for TypeScript type-only imports
- Removed duplicate 'ein' entry in GERMAN_WORD_DICTIONARY
- Removed unused import in StoryPlayer component
- Verified build passes successfully

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-13 16:25:17 +02:00
Lasse Rune Hansen
81a9eff5bc feat(frontend/story-integration): Phase 6 - Frontend components for Story feature
- Created TypeScript types for Story DTOs (types/api/story.ts)
- Created API client with authenticated fetch (lib/api/story.ts)
- Created StorySegment component with word click-to-translate
- Created StoryPlayer component with audio playback controls
- Created StoryTab component for segment navigation
- Created StoryPage component with routing
- Added comprehensive CSS styling (index.css)
- Updated App.tsx with react-router-dom routing
- Added react-router-dom dependency to package.json
- Updated feature documentation for Phase 6 completion

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-13 16:06:01 +02:00
Lasse Rune Hansen
be28650b6f fix(frontend): remove health check from Dockerfile
- nginx:alpine doesn't have wget installed
- Health check was causing container to stay in 'starting' state

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 13:05:31 +02:00
Lasse Rune Hansen
01e6bf3f28 feat(frontend): add minimal React source files for Docker build
- Add App.tsx with placeholder content
- Add main.tsx entry point
- Add index.css with basic styles

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 12:37:31 +02:00
Lasse Rune Hansen
db87e09333 fix(infra): correct Dockerfile paths relative to build context
- Fix backend Dockerfile: COPY paths relative to GermanApp/ context
- Fix frontend Dockerfile: paths relative to german-app-frontend/ context

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 12:35:33 +02:00
Lasse Rune Hansen
79a59bccc4 feat(backend/infra): add Docker configuration for Phase 3
- Create Dockerfile for backend (.NET 9.0 multi-stage build)
- Create Dockerfile for frontend (Node + Nginx multi-stage build)
- Create nginx.conf for frontend with API proxy
- Create docker-compose.yml with db, backend, frontend services
- Add .dockerignore files for backend, frontend, and root
- Configure health checks for all services
- Configure PostgreSQL volume for persistent data

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 11:46:27 +02:00
Lasse Rune Hansen
76e8af4987 Add complete solution: documentation, frontend, and project files
- Add comprehensive documentation in docs/ (architecture, features, roadmap)
- Add german-app-frontend with Vite, TypeScript, ESLint configuration
- Add AGENTS.md and .gitignore

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-31 18:20:53 +02:00