# baby666-bot/study-concierge architecture

> Architecture diagram of the GitHub repository baby666-bot/study-concierge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/baby666-bot/study-concierge
- Repository: https://github.com/baby666-bot/study-concierge

## Overview

AI Study Concierge is a web-and-mobile AI study assistant. In the visible web workflow, a student submits a chat message or uploads a PDF; the web app sends chat requests to an API route or passes extracted notes into study tools. API routes use Groq for chat, flashcard generation, and quiz generation/grading; PDF text extraction is handled by the upload route. Supabase provides web authentication and chat-history storage. The README also documents mobile, text-to-speech, and web-aware study capabilities; mobile implementation details and some web request wiring were not sampled.

Main entry points: [`nextjs-app/app/page.tsx`](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/page.tsx) (Study workspace), [`nextjs-app/app/lib/supabase.ts`](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/lib/supabase.ts) (Browser client), [`nextjs-app/app/components/PDFUploader.tsx`](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/components/PDFUploader.tsx) (PDF uploader), [`nextjs-app/app/components/UserMenu.tsx`](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/components/UserMenu.tsx) (User menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_app["Study workspace<br/>[page.tsx]"]
  node_pdf_uploader["PDF uploader<br/>[PDFUploader.tsx]"]
  node_user_menu["User menu<br/>[UserMenu.tsx]"]
end

subgraph group_learning["Study workflows"]
  node_upload_api["PDF extraction<br/>[route.ts]"]
  node_chat_api["Chat endpoint<br/>[route.ts]"]
  node_flashcards_api["Flashcard generator<br/>[route.ts]"]
  node_quiz_api["Quiz generator and grader<br/>[route.ts]"]
end

subgraph group_identity["Identity and history"]
  node_auth_page["Sign-in page<br/>[page.tsx]"]
  node_supabase_client["Browser client<br/>[supabase.ts]"]
  node_auth_callback["Auth callback<br/>[route.ts]"]
  node_chat_history[("Chat history<br/>[page.tsx]")]
end

subgraph group_mobile["Mobile app"]
  node_mobile_app["Flutter app<br/>[main.dart]"]
  node_mobile_api["Mobile API client<br/>[api_service.dart]"]
end

node_student(("Student"))
node_groq{{"Groq LLM service"}}
node_pdf_parser["PDF parser"]
node_supabase_service[("Supabase service")]

node_student -->|"uses"| node_web_app
node_web_app -->|"renders"| node_pdf_uploader
node_web_app -->|"renders"| node_user_menu
node_pdf_uploader -->|"uploads PDF"| node_upload_api
node_upload_api -->|"extracts text"| node_pdf_parser
node_web_app -->|"posts chat"| node_chat_api
node_chat_api -->|"requests completion"| node_groq
node_flashcards_api -->|"requests cards"| node_groq
node_quiz_api -->|"generates and grades"| node_groq
node_auth_page -->|"creates client"| node_supabase_client
node_user_menu -->|"creates client"| node_supabase_client
node_web_app -->|"creates client"| node_supabase_client
node_auth_callback -->|"exchanges session"| node_supabase_service
node_web_app -->|"inserts messages"| node_chat_history
node_chat_history -.->|"stores history"| node_supabase_service
node_student -->|"uses"| node_mobile_app
node_mobile_app -.->|"uses client"| node_mobile_api

click node_web_app "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/page.tsx"
click node_pdf_uploader "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/components/PDFUploader.tsx"
click node_user_menu "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/components/UserMenu.tsx"
click node_auth_page "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/auth/page.tsx"
click node_supabase_client "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/lib/supabase.ts"
click node_auth_callback "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/auth/callback/route.ts"
click node_chat_history "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/page.tsx"
click node_upload_api "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/upload/route.ts"
click node_chat_api "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/chat/route.ts"
click node_flashcards_api "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/flashcards/route.ts"
click node_quiz_api "https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/quiz/route.ts"
click node_mobile_app "https://github.com/baby666-bot/study-concierge/blob/main/flutter-app/lib/main.dart"
click node_mobile_api "https://github.com/baby666-bot/study-concierge/blob/main/flutter-app/lib/services/api_service.dart"

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_web_app,node_pdf_uploader,node_user_menu toneBlue
class node_upload_api,node_chat_api,node_flashcards_api,node_quiz_api,node_supabase_service toneAmber
class node_auth_page,node_supabase_client,node_auth_callback,node_chat_history toneMint
class node_mobile_app,node_mobile_api toneRose
class node_student,node_groq,node_pdf_parser toneIndigo
```

## Components

### Web experience

- [Study workspace](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/page.tsx): `nextjs-app/app/page.tsx`
- [PDF uploader](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/components/PDFUploader.tsx): `nextjs-app/app/components/PDFUploader.tsx`
- [User menu](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/components/UserMenu.tsx): `nextjs-app/app/components/UserMenu.tsx`

### Study workflows

- [PDF extraction](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/upload/route.ts): `nextjs-app/app/api/upload/route.ts`
- [Chat endpoint](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/chat/route.ts): `nextjs-app/app/api/chat/route.ts`
- [Flashcard generator](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/flashcards/route.ts): `nextjs-app/app/api/flashcards/route.ts`
- [Quiz generator and grader](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/quiz/route.ts): `nextjs-app/app/api/quiz/route.ts`

### Identity and history

- [Sign-in page](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/auth/page.tsx): `nextjs-app/app/auth/page.tsx`
- [Browser client](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/lib/supabase.ts): `nextjs-app/app/lib/supabase.ts`
- [Auth callback](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/api/auth/callback/route.ts): `nextjs-app/app/api/auth/callback/route.ts`
- [Chat history](https://github.com/baby666-bot/study-concierge/blob/main/nextjs-app/app/page.tsx): `nextjs-app/app/page.tsx`

### Mobile app

- [Flutter app](https://github.com/baby666-bot/study-concierge/blob/main/flutter-app/lib/main.dart): `flutter-app/lib/main.dart`
- [Mobile API client](https://github.com/baby666-bot/study-concierge/blob/main/flutter-app/lib/services/api_service.dart): `flutter-app/lib/services/api_service.dart`

### Other components

- **Student**
- **Groq LLM service**
- **PDF parser**
- **Supabase service**

## Connections

- Student → Study workspace: uses (evidence: `README.md`)
- Study workspace → PDF uploader: renders (evidence: `nextjs-app/app/page.tsx`)
- Study workspace → User menu: renders (evidence: `nextjs-app/app/page.tsx`)
- PDF uploader → PDF extraction: uploads PDF (evidence: `nextjs-app/app/components/PDFUploader.tsx`)
- PDF extraction → PDF parser: extracts text (evidence: `nextjs-app/app/api/upload/route.ts`)
- Study workspace → Chat endpoint: posts chat (evidence: `nextjs-app/app/page.tsx`)
- Chat endpoint → Groq LLM service: requests completion (evidence: `nextjs-app/app/api/chat/route.ts`)
- Flashcard generator → Groq LLM service: requests cards (evidence: `nextjs-app/app/api/flashcards/route.ts`)
- Quiz generator and grader → Groq LLM service: generates and grades (evidence: `nextjs-app/app/api/quiz/route.ts`)
- Sign-in page → Browser client: creates client (evidence: `nextjs-app/app/auth/page.tsx`)
- User menu → Browser client: creates client (evidence: `nextjs-app/app/components/UserMenu.tsx`)
- Study workspace → Browser client: creates client (evidence: `nextjs-app/app/page.tsx`)
- Auth callback → Supabase service: exchanges session (evidence: `nextjs-app/app/api/auth/callback/route.ts`)
- Study workspace → Chat history: inserts messages (evidence: `nextjs-app/app/page.tsx`)
- Chat history → Supabase service: stores history
- Student → Flutter app: uses (evidence: `README.md`)
- Flutter app → Mobile API client: uses client
