# teomarcelo/session-qa architecture

> Architecture diagram of the GitHub repository teomarcelo/session-qa, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/teomarcelo/session-qa
- Repository: https://github.com/teomarcelo/session-qa

## Overview

Session Q&A is a browser-based live event product: instructors authenticate and configure a coded session, then students join, submit questions, and vote while instructors answer and manage the session. The Vite React apps use Firebase Auth, Firestore, and Storage; a separate Next.js surface provides Google OAuth/session routes and student/instructor pages. README documents product capabilities beyond the sampled source, so those branches are represented at their listed component paths; their internal calls are not inferred where source was not shown.

Main entry points: [`src/student/StudentApp.jsx`](https://github.com/teomarcelo/session-qa/blob/main/src/student/StudentApp.jsx) (Student app), [`src/instructor/components/Dashboard.jsx`](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/Dashboard.jsx) (Session dashboard), [`src/instructor/InstructorApp.jsx`](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/InstructorApp.jsx) (Instructor app), [`src/student/hooks/useStudentSession.js`](https://github.com/teomarcelo/session-qa/blob/main/src/student/hooks/useStudentSession.js) (Join session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student experience"]
  node_student_app["Student app<br/>[StudentApp.jsx]"]
  node_join["Join session"]
  node_ask["Ask and edit<br/>[AskBox.jsx]"]
  node_student_questions["Question feed<br/>[useQuestions.js]"]
  node_upvote["Upvote questions<br/>[useUpvote.js]"]
  node_session_info["Session details<br/>[SessionInfo.jsx]"]
  node_student_stats["Session stats<br/>[useSessionStats.js]"]
  node_feedback["Send feedback<br/>[FeedbackModal.jsx]"]
end

subgraph group_instructor["Instructor workspace"]
  node_instructor_app["Instructor app<br/>[InstructorApp.jsx]"]
  node_instructor_auth["Instructor identity"]
  node_dashboard["Session dashboard<br/>[Dashboard.jsx]"]
  node_sessions["Session setup"]
  node_session_controls["Session settings"]
  node_instructor_questions["Question management<br/>[useQuestions.js]"]
  node_answers["Answer questions<br/>[AnswerBox.jsx]"]
  node_roster["Instructor roster"]
  node_notes["Instructor notes"]
  node_store["Instructor state"]
end

subgraph group_firebase["Firebase and shared"]
  node_firebase_context["Firebase context"]
  node_auth_service["Firebase identity<br/>[auth.js]"]
  node_firestore[("Firestore")]
  node_storage[("Firebase Storage")]
end

subgraph group_gateway["Web auth gateway"]
  node_oauth_routes["OAuth routes<br/>[route.js]"]
  node_oauth_login["OAuth login<br/>[route.js]"]
  node_oauth_logout["OAuth logout<br/>[route.js]"]
  node_oauth_logic["Google OAuth<br/>[oauth.js]"]
  node_web_session["Web session<br/>[session.js]"]
end

node_student_actor(("Student"))
node_instructor_actor(("Instructor"))
node_google(("Google identity"))

node_student_actor -->|"uses"| node_student_app
node_student_app -->|"restores or joins"| node_join
node_join -->|"reads session"| node_firestore
node_join -->|"ensures identity"| node_auth_service
node_student_app -->|"loads feed"| node_student_questions
node_student_questions -->|"listens and pages"| node_firestore
node_student_app -->|"renders"| node_ask
node_ask -->|"submits and edits"| node_firestore
node_ask -->|"uploads images"| node_storage
node_student_app -->|"offers voting"| node_upvote
node_upvote -->|"updates votes"| node_firestore
node_student_app -->|"shows details"| node_session_info
node_student_app -->|"shows stats"| node_student_stats
node_student_app -->|"offers feedback"| node_feedback
node_feedback -->|"writes feedback"| node_firestore
node_instructor_actor -->|"uses"| node_instructor_app
node_instructor_app -->|"authenticates"| node_instructor_auth
node_instructor_auth -->|"signs in"| node_auth_service
node_auth_service -->|"gets Firebase"| node_firebase_context
node_instructor_app -->|"shows workspace"| node_dashboard
node_dashboard -->|"reads state"| node_store
node_dashboard -->|"creates sessions"| node_sessions
node_sessions -->|"writes session"| node_firestore
node_dashboard -->|"configures session"| node_session_controls
node_session_controls -->|"updates settings"| node_firestore
node_dashboard -->|"manages questions"| node_instructor_questions
node_instructor_questions -->|"pages and listens"| node_firestore
node_dashboard -->|"answers questions"| node_answers
node_answers -->|"saves answers"| node_firestore
node_answers -->|"uploads images"| node_storage
node_dashboard -->|"manages instructors"| node_roster
node_roster -->|"updates roster"| node_firestore
node_dashboard -->|"edits notes"| node_notes
node_notes -->|"saves notes"| node_firestore
node_firebase_context -->|"provides client"| node_firestore
node_firebase_context -->|"provides client"| node_storage
node_oauth_login -->|"builds redirect"| node_oauth_logic
node_oauth_routes -->|"exchanges and verifies"| node_oauth_logic
node_oauth_routes -->|"creates session"| node_web_session
node_oauth_logout -->|"destroys session"| node_web_session
node_oauth_login -->|"redirects to"| node_google
node_oauth_logic -->|"exchanges code"| node_google
node_instructor_app -.->|"web sign-in option"| node_oauth_routes

click node_student_app "https://github.com/teomarcelo/session-qa/blob/main/src/student/StudentApp.jsx"
click node_join "https://github.com/teomarcelo/session-qa/blob/main/src/student/hooks/useStudentSession.js"
click node_ask "https://github.com/teomarcelo/session-qa/blob/main/src/student/components/AskBox.jsx"
click node_student_questions "https://github.com/teomarcelo/session-qa/blob/main/src/student/hooks/useQuestions.js"
click node_upvote "https://github.com/teomarcelo/session-qa/blob/main/src/student/hooks/useUpvote.js"
click node_session_info "https://github.com/teomarcelo/session-qa/blob/main/src/student/components/SessionInfo.jsx"
click node_student_stats "https://github.com/teomarcelo/session-qa/blob/main/src/student/hooks/useSessionStats.js"
click node_feedback "https://github.com/teomarcelo/session-qa/blob/main/src/student/components/FeedbackModal.jsx"
click node_instructor_app "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/InstructorApp.jsx"
click node_instructor_auth "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/hooks/useInstructorAuth.js"
click node_dashboard "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/Dashboard.jsx"
click node_sessions "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/CreateSessionModal.jsx"
click node_session_controls "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/sidebar/SessionSettings.jsx"
click node_instructor_questions "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/hooks/useQuestions.js"
click node_answers "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/AnswerBox.jsx"
click node_roster "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/sidebar/InstructorManager.jsx"
click node_notes "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/sidebar/SessionNotesEditor.jsx"
click node_store "https://github.com/teomarcelo/session-qa/blob/main/src/instructor/store/useInstructorStore.js"
click node_firebase_context "https://github.com/teomarcelo/session-qa/blob/main/src/shared/FirebaseContext.jsx"
click node_auth_service "https://github.com/teomarcelo/session-qa/blob/main/src/lib/auth.js"
click node_oauth_routes "https://github.com/teomarcelo/session-qa/blob/main/next-app/app/api/auth/callback/route.js"
click node_oauth_login "https://github.com/teomarcelo/session-qa/blob/main/next-app/app/api/auth/login/route.js"
click node_oauth_logout "https://github.com/teomarcelo/session-qa/blob/main/next-app/app/api/auth/logout/route.js"
click node_oauth_logic "https://github.com/teomarcelo/session-qa/blob/main/next-app/lib/oauth.js"
click node_web_session "https://github.com/teomarcelo/session-qa/blob/main/next-app/lib/session.js"

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_student_app,node_join,node_ask,node_student_questions,node_upvote,node_session_info,node_student_stats,node_feedback toneBlue
class node_instructor_app,node_instructor_auth,node_dashboard,node_sessions,node_session_controls,node_instructor_questions,node_answers,node_roster,node_notes,node_store toneAmber
class node_firebase_context,node_auth_service,node_firestore,node_storage toneMint
class node_oauth_routes,node_oauth_login,node_oauth_logout,node_oauth_logic,node_web_session toneRose
class node_student_actor,node_instructor_actor,node_google toneIndigo
```

## Components

### Student experience

- [Student app](https://github.com/teomarcelo/session-qa/blob/main/src/student/StudentApp.jsx): `src/student/StudentApp.jsx`
- [Join session](https://github.com/teomarcelo/session-qa/blob/main/src/student/hooks/useStudentSession.js): `src/student/hooks/useStudentSession.js`
- [Ask and edit](https://github.com/teomarcelo/session-qa/blob/main/src/student/components/AskBox.jsx): `src/student/components/AskBox.jsx`
- [Question feed](https://github.com/teomarcelo/session-qa/blob/main/src/student/hooks/useQuestions.js): `src/student/hooks/useQuestions.js`
- [Upvote questions](https://github.com/teomarcelo/session-qa/blob/main/src/student/hooks/useUpvote.js): `src/student/hooks/useUpvote.js`
- [Session details](https://github.com/teomarcelo/session-qa/blob/main/src/student/components/SessionInfo.jsx): `src/student/components/SessionInfo.jsx`
- [Session stats](https://github.com/teomarcelo/session-qa/blob/main/src/student/hooks/useSessionStats.js): `src/student/hooks/useSessionStats.js`
- [Send feedback](https://github.com/teomarcelo/session-qa/blob/main/src/student/components/FeedbackModal.jsx): `src/student/components/FeedbackModal.jsx`

### Instructor workspace

- [Instructor app](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/InstructorApp.jsx): `src/instructor/InstructorApp.jsx`
- [Instructor identity](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/hooks/useInstructorAuth.js): `src/instructor/hooks/useInstructorAuth.js`
- [Session dashboard](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/Dashboard.jsx): `src/instructor/components/Dashboard.jsx`
- [Session setup](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/CreateSessionModal.jsx): `src/instructor/components/CreateSessionModal.jsx`
- [Session settings](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/sidebar/SessionSettings.jsx): `src/instructor/components/sidebar/SessionSettings.jsx`
- [Question management](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/hooks/useQuestions.js): `src/instructor/hooks/useQuestions.js`
- [Answer questions](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/AnswerBox.jsx): `src/instructor/components/AnswerBox.jsx`
- [Instructor roster](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/sidebar/InstructorManager.jsx): `src/instructor/components/sidebar/InstructorManager.jsx`
- [Instructor notes](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/components/sidebar/SessionNotesEditor.jsx): `src/instructor/components/sidebar/SessionNotesEditor.jsx`
- [Instructor state](https://github.com/teomarcelo/session-qa/blob/main/src/instructor/store/useInstructorStore.js): `src/instructor/store/useInstructorStore.js`

### Firebase and shared

- [Firebase context](https://github.com/teomarcelo/session-qa/blob/main/src/shared/FirebaseContext.jsx): `src/shared/FirebaseContext.jsx`
- [Firebase identity](https://github.com/teomarcelo/session-qa/blob/main/src/lib/auth.js): `src/lib/auth.js`
- **Firestore**
- **Firebase Storage**

### Web auth gateway

- [OAuth routes](https://github.com/teomarcelo/session-qa/blob/main/next-app/app/api/auth/callback/route.js): `next-app/app/api/auth/callback/route.js`
- [OAuth login](https://github.com/teomarcelo/session-qa/blob/main/next-app/app/api/auth/login/route.js): `next-app/app/api/auth/login/route.js`
- [OAuth logout](https://github.com/teomarcelo/session-qa/blob/main/next-app/app/api/auth/logout/route.js): `next-app/app/api/auth/logout/route.js`
- [Google OAuth](https://github.com/teomarcelo/session-qa/blob/main/next-app/lib/oauth.js): `next-app/lib/oauth.js`
- [Web session](https://github.com/teomarcelo/session-qa/blob/main/next-app/lib/session.js): `next-app/lib/session.js`

### Other components

- **Student**
- **Instructor**
- **Google identity**

## Connections

- Student → Student app: uses (evidence: `README.md`)
- Student app → Join session: restores or joins (evidence: `src/student/StudentApp.jsx`)
- Join session → Firestore: reads session (evidence: `src/student/hooks/useStudentSession.js`)
- Join session → Firebase identity: ensures identity (evidence: `src/student/hooks/useStudentSession.js`)
- Student app → Question feed: loads feed (evidence: `src/student/StudentApp.jsx`)
- Question feed → Firestore: listens and pages (evidence: `README.md`)
- Student app → Ask and edit: renders (evidence: `README.md`)
- Ask and edit → Firestore: submits and edits (evidence: `README.md`)
- Ask and edit → Firebase Storage: uploads images (evidence: `README.md`)
- Student app → Upvote questions: offers voting (evidence: `README.md`)
- Upvote questions → Firestore: updates votes (evidence: `README.md`)
- Student app → Session details: shows details
- Student app → Session stats: shows stats (evidence: `README.md`)
- Student app → Send feedback: offers feedback (evidence: `README.md`)
- Send feedback → Firestore: writes feedback (evidence: `README.md`)
- Instructor → Instructor app: uses (evidence: `README.md`)
- Instructor app → Instructor identity: authenticates (evidence: `src/instructor/InstructorApp.jsx`)
- Instructor identity → Firebase identity: signs in (evidence: `src/instructor/hooks/useInstructorAuth.js`)
- Firebase identity → Firebase context: gets Firebase (evidence: `src/lib/auth.js`)
- Instructor app → Session dashboard: shows workspace (evidence: `src/instructor/InstructorApp.jsx`)
- Session dashboard → Instructor state: reads state
- Session dashboard → Session setup: creates sessions (evidence: `README.md`)
- Session setup → Firestore: writes session (evidence: `src/instructor/components/CreateSessionModal.jsx`)
- Session dashboard → Session settings: configures session (evidence: `README.md`)
- Session settings → Firestore: updates settings (evidence: `README.md`)
- Session dashboard → Question management: manages questions (evidence: `README.md`)
- Question management → Firestore: pages and listens (evidence: `README.md`)
- Session dashboard → Answer questions: answers questions (evidence: `README.md`)
- Answer questions → Firestore: saves answers (evidence: `README.md`)
- Answer questions → Firebase Storage: uploads images (evidence: `README.md`)
- Session dashboard → Instructor roster: manages instructors (evidence: `src/instructor/components/sidebar/InstructorManager.jsx`)
- Instructor roster → Firestore: updates roster (evidence: `src/instructor/components/sidebar/InstructorManager.jsx`)
- Session dashboard → Instructor notes: edits notes (evidence: `README.md`)
- Instructor notes → Firestore: saves notes (evidence: `README.md`)
- Firebase context → Firestore: provides client (evidence: `src/shared/FirebaseContext.jsx`)
- Firebase context → Firebase Storage: provides client (evidence: `src/shared/FirebaseContext.jsx`)
- OAuth login → Google OAuth: builds redirect (evidence: `next-app/app/api/auth/login/route.js`)
- OAuth routes → Google OAuth: exchanges and verifies (evidence: `next-app/app/api/auth/callback/route.js`)
- OAuth routes → Web session: creates session (evidence: `next-app/app/api/auth/callback/route.js`)
- OAuth logout → Web session: destroys session (evidence: `next-app/app/api/auth/logout/route.js`)
- OAuth login → Google identity: redirects to
- Google OAuth → Google identity: exchanges code (evidence: `next-app/lib/oauth.js`)
- Instructor app → OAuth routes: web sign-in option
