How 00adasod/liaprojekt works
1. Repository shape
- This is a two-tier application: a Spring Boot backend in Backend/ and a React + TypeScript frontend in Frontend/.
- The root also contains deployment/configuration files and documentation artifacts (.github/workflows/deploy.yml, staticwebapp.config.json, JIN24/, MOV24/).
2. Backend entry point and runtime
- The backend is a standalone Java application started from se.liaprojekt.LiaProjektApplication.
- The presence of pom.xml, Maven wrapper files, and application.properties indicates a conventional Spring Boot + Maven runtime.
3. API boundary
- HTTP endpoints are grouped into controllers: UserController, CourseController, AiController, and HealthCheckController.
- CorsConfig shows the backend is explicitly configured to accept browser requests from the frontend origin, so the frontend-backend split is a real network boundary.
4. Domain model boundary
- The backend domain is organized around a few feature areas:
- Course content: Course, Section, Material
- Assessment/testing: TestQuestion, TestAnswer, TestResult
- User and progress: User, UserProgress, AnsweredQuestion
- AI support: AiCharacter, AiSession
- Notifications: EmailNotification
- These are the core entities that likely map to persisted data and API payloads.
5. Persistence layer
- Repositories such as CourseRepository, UserRepository, SectionRepository, AiSessionRepository, AiCharacterRepository, UserProgressRepository, TestResultRepository, and EmailNotificationRepository indicate the backend uses a repository-based persistence layer.
- Because there is no visible service/ package, the architecture appears controller-centric, with controllers likely coordinating business logic directly with repositories and entities.
6. DTO and API contract layer
- CourseRequest, CourseResponse, UserRequest, and UserResponse define explicit request/response shapes.
- This separates external API contracts from internal entity models, which is important for keeping the frontend insulated from persistence details.
7. Error handling and robustness
- The backend includes a centralized exception subsystem: GlobalExceptionHandler, ErrorResponse, BadRequestException, ConflictException, and ResourceNotFoundException.
- This means errors are normalized at the API boundary rather than handled ad hoc in individual controllers.
8. AI feature subsystem
- AiController, AiCharacter, AiSession, and AnsweredQuestion suggest a dedicated AI-assisted learning flow.
- Architecturally, this is a distinct feature path alongside courses/users, likely maintaining conversational or session state separate from course content and progress tracking.
9. Frontend structure
- The frontend is a Vite-powered React app (vite.config.ts, main.tsx, App.tsx) written in TypeScript.
- src/services/api.ts acts as the single client-side integration point to the backend API.
- UI components are sparse and feature-oriented, including HealthCheck.tsx and Message.tsx, suggesting a small app surface with backend-driven data.
10. Frontend-backend data flow
- The browser renders the React app, which calls backend endpoints through src/services/api.ts.
- Backend controllers validate and process the request, interact with repositories/entities, and return DTO-based JSON responses.
- The frontend likely consumes these responses directly for course/user/AI interactions.
11. Health and connectivity
- HealthCheckController on the backend and HealthCheck.tsx on the frontend indicate a built-in connectivity or readiness check across the deployment boundary.
- This is useful both for user-facing status and for deployment/runtime verification.
12. Testing and quality boundary
- Backend tests exist for startup plus controller behavior: LiaProjektApplicationTests, CourseControllerTest, and UserControllerTest.
- This shows the main automated verification focuses on application boot and API endpoints rather than isolated service-layer tests, which fits the visible controller-heavy structure.
13. Deployment and hosting
- .github/workflows/deploy.yml indicates CI/CD automation.
- staticwebapp.config.json strongly suggests the frontend is deployed as a static web app with route handling/configuration at the edge, while the backend is deployed separately or as a paired backend service.
14. Documentation/analysis assets
- JIN24/ contains design artifacts such as architecture, requirements analysis, ER diagrams, and class diagrams.
- These are not runtime components, but they likely capture the intended domain model and are useful references when drawing an architecture diagram.
Main entry points: main.tsx React app · LiaProjektApplication.java Backend app · deploy.yml Deploy flow · CorsConfig.java CORS config
Components 16
Repository
Top-level project and deployment assets
- Lia Projekt · Monorepo for backend, frontend, and deployment
- Deploy flow · GitHub Actions deployment pipeline
.github/workflows/deploy.yml - Static config · Edge routing/config for static web deployment
staticwebapp.config.json
Backend
Spring Boot API and persistence
- Backend app · Java API runtime entry point
Backend/src/main/java/se/liaprojekt/LiaProjektApplication.java - CORS config · Browser origin access across frontend/backend boundary
Backend/src/main/java/se/liaprojekt/config/CorsConfig.java - Controllers · HTTP endpoints for courses, users, AI, and health
- DTOs · Request and response shapes exposed by the API
- Errors · Centralized API error normalization and handling
- Domain models · Core learning, AI, progress, and notification entities
- Repositories · Data access interfaces for persisted entities
- Backend tests · Startup and controller-level verification
Frontend
React client and browser integration
- React app · TypeScript SPA entry point
Frontend/src/main.tsx - API client · Single integration point to backend endpoints
Frontend/src/services/api.ts - UI views · Small feature-oriented presentation layer
- Health check · Frontend connectivity/status view
Frontend/src/components/HealthCheck.tsx
Docs
Design and analysis artifacts
- Architecture notes · Architecture, requirements, and diagrams
JIN24/Arkitekturdesign.md
Connections 20
- Lia Projekt → Backend app: contains · Backend runtime is part of the monorepo
- Lia Projekt → React app: contains · Frontend runtime is part of the monorepo
- Lia Projekt → Deploy flow: ships with · Repository includes CI/CD workflow
- Lia Projekt → Static config: ships with · Repository includes hosting configuration
- Lia Projekt → Architecture notes: documents · Design artifacts describe intended architecture
- Backend app → Controllers: boots · Spring Boot application hosts the API layer
- Backend app → CORS config: configures · Application enables browser access across origins
- Controllers → DTOs: uses · Endpoints exchange request/response DTOs
- Controllers → Domain models: orchestrates · Controllers coordinate domain entities directly
- Controllers → Repositories: persists via · Endpoints read and write through repositories
- Controllers → Errors: raises · API errors are normalized centrally
- Domain models → Repositories: stored by · Repositories manage the core entities
- Backend tests → Controllers: covers · Tests focus on controller behavior and startup
- React app → API client: imports · SPA uses a single backend integration module
- React app → UI views: renders · Application composes feature UI components
- UI views → Health check: includes · Health status is a visible frontend feature
- API client → Controllers: calls · Browser requests hit backend HTTP endpoints
- CORS config → React app: allows · Backend permits requests from the frontend origin
- Deploy flow → React app: deploys · Workflow builds and publishes the client app
- Deploy flow → Backend app: deploys · Workflow integrates backend delivery