# aticha-meet/edu-flow-app architecture

> Architecture diagram of the GitHub repository aticha-meet/edu-flow-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aticha-meet/edu-flow-app
- Repository: https://github.com/aticha-meet/edu-flow-app

## Overview

EduFlow is a web app for managing courses and student/teacher profiles, with an exam-taking and results experience. The principal flow is a user using the Next.js interface, which sends user, profile, or course requests to the Express API; API controllers delegate those requests to domain services. The README documents Prisma/PostgreSQL and OAuth, while the tree also shows exam pages and result components. Exam persistence and several service internals are not sampled, so their wiring is left unspecified.

Main entry points: [`apps/edu-flow-api/src/router.ts`](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/router.ts) (API router), [`apps/edu-flow-front/src/app/(main)/exam/page.tsx`](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/(main)/exam/page.tsx) (Exam experience), [`apps/edu-flow-front/src/app/api/auth/[...nextauth]/route.ts`](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/api/auth/%5B...nextauth%5D/route.ts) (Auth route), [`apps/edu-flow-front/src/app/(main)/layout.tsx`](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/(main)/layout.tsx) (Next.js app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_webapp["Next.js app<br/>[layout.tsx]"]
  node_courses["Course pages<br/>[page.tsx]"]
  node_exam["Exam experience<br/>[page.tsx]"]
  node_review["Exam review<br/>[ExamReview.tsx]"]
  node_examstate["Exam state<br/>[examStore.ts]"]
  node_pdf["PDF export<br/>[generateExamPDF.ts]"]
  node_login["Login page<br/>[page.tsx]"]
end

subgraph group_api["API services"]
  node_api["Express API<br/>[main.ts]"]
  node_router["API router<br/>[router.ts]"]
  node_userctl["User controller<br/>[user.controller.ts]"]
  node_usersvc["User service<br/>[user.service.ts]"]
  node_coursectl["Course controller"]
  node_coursesvc["Course service<br/>[course.service.ts]"]
  node_studentctl["Student profiles"]
  node_studentsvc["Student service"]
  node_teacherctl["Teacher profiles"]
  node_teachersvc["Teacher service"]
end

subgraph group_identity["Identity"]
  node_oauthroute["Auth route<br/>[route.ts]"]
  node_oauthconfig["OAuth config<br/>[OauthConfig.ts]"]
end

node_user(("User"))
node_postgres[("PostgreSQL")]
node_google["Google OAuth"]

node_user -->|"uses"| node_webapp
node_webapp -->|"navigates"| node_courses
node_user -->|"takes exam"| node_exam
node_exam -->|"updates"| node_examstate
node_exam -->|"shows results"| node_review
node_review -->|"requests export"| node_pdf
node_user -->|"signs in"| node_login
node_login -->|"authenticates"| node_oauthroute
node_oauthroute -->|"uses"| node_oauthconfig
node_oauthroute -.->|"OAuth"| node_google
node_api -->|"mounts"| node_router
node_router -->|"routes requests"| node_userctl
node_router -->|"routes requests"| node_coursectl
node_router -->|"routes requests"| node_studentctl
node_router -->|"routes requests"| node_teacherctl
node_userctl -->|"calls"| node_usersvc
node_coursectl -->|"calls"| node_coursesvc
node_studentctl -->|"calls"| node_studentsvc
node_teacherctl -->|"calls"| node_teachersvc
node_courses -->|"requests courses"| node_api

click node_webapp "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/(main)/layout.tsx"
click node_courses "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/(main)/course/page.tsx"
click node_exam "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/(main)/exam/page.tsx"
click node_review "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/components/exam/ExamReview.tsx"
click node_examstate "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/store/examStore.ts"
click node_pdf "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/utils/generateExamPDF.ts"
click node_login "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/login/page.tsx"
click node_oauthroute "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_oauthconfig "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/utils/OauthConfig.ts"
click node_api "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/main.ts"
click node_router "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/router.ts"
click node_userctl "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/user/user.controller.ts"
click node_usersvc "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/user/user.service.ts"
click node_coursectl "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/course/course.controller.ts"
click node_coursesvc "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/course/course.service.ts"
click node_studentctl "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/student-profile/student-profile.controller.ts"
click node_studentsvc "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/student-profile/student-profile.service.ts"
click node_teacherctl "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/teacher-profile/teacher-profile.controller.ts"
click node_teachersvc "https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/teacher-profile/teacher-profile.service.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_courses,node_exam,node_review,node_examstate,node_pdf,node_login,node_user toneBlue
class node_api,node_router,node_userctl,node_usersvc,node_coursectl,node_coursesvc,node_studentctl,node_studentsvc,node_teacherctl,node_teachersvc,node_postgres toneAmber
class node_oauthroute,node_oauthconfig toneMint
class node_google toneIndigo
```

## Components

### Web interface

- [Next.js app](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/(main)/layout.tsx): `apps/edu-flow-front/src/app/(main)/layout.tsx`
- [Course pages](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/(main)/course/page.tsx): `apps/edu-flow-front/src/app/(main)/course/page.tsx`
- [Exam experience](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/(main)/exam/page.tsx): `apps/edu-flow-front/src/app/(main)/exam/page.tsx`
- [Exam review](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/components/exam/ExamReview.tsx): `apps/edu-flow-front/src/components/exam/ExamReview.tsx`
- [Exam state](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/store/examStore.ts): `apps/edu-flow-front/src/store/examStore.ts`
- [PDF export](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/utils/generateExamPDF.ts): `apps/edu-flow-front/src/utils/generateExamPDF.ts`
- [Login page](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/login/page.tsx): `apps/edu-flow-front/src/app/login/page.tsx`

### API services

- [Express API](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/main.ts): `apps/edu-flow-api/src/main.ts`
- [API router](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/router.ts): `apps/edu-flow-api/src/router.ts`
- [User controller](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/user/user.controller.ts): `apps/edu-flow-api/src/pkg/user/user.controller.ts`
- [User service](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/user/user.service.ts): `apps/edu-flow-api/src/pkg/user/user.service.ts`
- [Course controller](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/course/course.controller.ts): `apps/edu-flow-api/src/pkg/course/course.controller.ts`
- [Course service](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/course/course.service.ts): `apps/edu-flow-api/src/pkg/course/course.service.ts`
- [Student profiles](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/student-profile/student-profile.controller.ts): `apps/edu-flow-api/src/pkg/student-profile/student-profile.controller.ts`
- [Student service](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/student-profile/student-profile.service.ts): `apps/edu-flow-api/src/pkg/student-profile/student-profile.service.ts`
- [Teacher profiles](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/teacher-profile/teacher-profile.controller.ts): `apps/edu-flow-api/src/pkg/teacher-profile/teacher-profile.controller.ts`
- [Teacher service](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-api/src/pkg/teacher-profile/teacher-profile.service.ts): `apps/edu-flow-api/src/pkg/teacher-profile/teacher-profile.service.ts`

### Identity

- [Auth route](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/app/api/auth/%5B...nextauth%5D/route.ts): `apps/edu-flow-front/src/app/api/auth/[...nextauth]/route.ts`
- [OAuth config](https://github.com/aticha-meet/edu-flow-app/blob/deverlop/apps/edu-flow-front/src/utils/OauthConfig.ts): `apps/edu-flow-front/src/utils/OauthConfig.ts`

### Other components

- **User**
- **PostgreSQL**
- **Google OAuth**

## Connections

- User → Next.js app: uses
- Next.js app → Course pages: navigates
- User → Exam experience: takes exam
- Exam experience → Exam state: updates
- Exam experience → Exam review: shows results
- Exam review → PDF export: requests export
- User → Login page: signs in
- Login page → Auth route: authenticates
- Auth route → OAuth config: uses
- Auth route → Google OAuth: OAuth
- Express API → API router: mounts
- API router → User controller: routes requests
- API router → Course controller: routes requests
- API router → Student profiles: routes requests
- API router → Teacher profiles: routes requests
- User controller → User service: calls
- Course controller → Course service: calls
- Student profiles → Student service: calls
- Teacher profiles → Teacher service: calls
- Course pages → Express API: requests courses
