# devrod11/peersync architecture

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

- Interactive diagram: https://gitdiagram.com/devrod11/peersync
- Repository: https://github.com/devrod11/peersync

## Overview

PeerSync is a collaborative capstone-management platform: students and professors use a Flutter client to manage project work through a FastAPI API backed by Firebase. The principal workflow covers projects, groups, milestones, tasks, and submissions, with review, announcements, and notifications supporting supervision. Optional integrations synchronize deadlines and submission files, while professor OTP and email digests provide additional capabilities. Backend relationships are supported by excerpts or the README; the mobile application source and several backend modules were not sampled, so its internal client flow is not detailed.

Main entry points: [`peersync_backend/app/main.py`](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/main.py) (FastAPI app), [`peersync_backend/app/dependencies/auth.py`](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/dependencies/auth.py) (Authentication and roles), [`peersync_backend/app/routers/tasks.py`](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/tasks.py) (Tasks), [`peersync_backend/app/routers/submissions.py`](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/submissions.py) (Submissions and review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_flutter["Flutter app"]
end

subgraph group_api["API and access"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_settings["Settings<br/>[config.py]"]
  node_auth["Authentication and roles<br/>[auth.py]"]
  node_firebase["Firebase access<br/>[firebase.py]"]
  node_auth_routes["Login and OTP<br/>[auth.py]"]
  node_otp["Professor OTP"]
  node_sessions["Professor sessions"]
end

subgraph group_work["Project workflow"]
  node_projects["Projects<br/>[projects.py]"]
  node_groups["Groups<br/>[groups.py]"]
  node_milestones["Milestones<br/>[milestones.py]"]
  node_tasks["Tasks<br/>[tasks.py]"]
  node_task_status["Task status"]
  node_submissions["Submissions and review<br/>[submissions.py]"]
end

subgraph group_communication["Communication"]
  node_announcements["Announcements<br/>[announcements.py]"]
  node_notifications["In-app notifications"]
  node_push["Push delivery<br/>[push_service.py]"]
  node_email_digest["Email digests"]
  node_email["Email delivery<br/>[email_service.py]"]
end

subgraph group_integrations["Integrations"]
  node_calendar_routes["Calendar connection<br/>[google_calendar.py]"]
  node_calendar_sync["Deadline sync"]
  node_calendar_api["Calendar API client<br/>[google_calendar.py]"]
  node_drive_routes["Drive connection<br/>[google_drive.py]"]
  node_drive_api["Drive API client<br/>[google_drive.py]"]
end

node_student(("Student"))
node_professor(("Professor"))
node_firestore[("Cloud Firestore")]
node_firebase_auth["Firebase Authentication"]
node_fcm["Firebase Cloud Messaging"]
node_google_calendar["Google Calendar"]
node_google_drive["Google Drive"]
node_sendgrid["SendGrid"]

node_student -->|"uses"| node_flutter
node_professor -->|"uses"| node_flutter
node_flutter -->|"HTTPS API"| node_api_app
node_api_app -->|"registers routes"| node_auth_routes
node_api_app -->|"registers routes"| node_projects
node_api_app -->|"registers routes"| node_groups
node_api_app -->|"registers routes"| node_milestones
node_api_app -->|"registers routes"| node_tasks
node_api_app -->|"registers routes"| node_submissions
node_api_app -->|"registers routes"| node_announcements
node_api_app -->|"registers routes"| node_calendar_routes
node_api_app -->|"registers routes"| node_drive_routes
node_api_app -->|"configures CORS"| node_settings
node_api_app -->|"initializes"| node_firebase
node_firebase -->|"reads settings"| node_settings
node_firebase -->|"creates client"| node_firestore
node_auth -->|"loads profile"| node_firebase
node_auth -->|"verifies token"| node_firebase_auth
node_auth -->|"validates session"| node_sessions
node_auth_routes -->|"uses OTP service"| node_otp
node_auth_routes -->|"creates session"| node_sessions
node_otp -->|"sends code"| node_email
node_sessions -->|"stores sessions"| node_firestore
node_projects -.->|"checks access"| node_auth
node_groups -->|"checks access"| node_auth
node_milestones -.->|"checks access"| node_auth
node_tasks -->|"checks access"| node_auth
node_submissions -->|"checks access"| node_auth
node_announcements -->|"checks access"| node_auth
node_projects -.->|"reads and writes"| node_firestore
node_groups -->|"reads and writes"| node_firestore
node_milestones -.->|"reads and writes"| node_firestore
node_tasks -->|"reads and writes"| node_firestore
node_submissions -->|"reads and writes"| node_firestore
node_tasks -->|"updates status"| node_task_status
node_submissions -->|"updates status"| node_task_status
node_submissions -->|"manages files"| node_drive_api
node_drive_routes -->|"calls"| node_drive_api
node_drive_api -.->|"manages files"| node_google_drive
node_tasks -->|"syncs deadlines"| node_calendar_sync
node_calendar_routes -->|"requests sync"| node_calendar_sync
node_calendar_sync -->|"calls"| node_calendar_api
node_calendar_routes -->|"reads and writes"| node_firestore
node_calendar_api -.->|"synchronizes events"| node_google_calendar
node_announcements -->|"creates notifications"| node_notifications
node_announcements -->|"sends push"| node_push
node_notifications -.->|"stores notifications"| node_firestore
node_push -->|"uses notification data"| node_notifications

click node_flutter "https://github.com/devrod11/peersync/tree/main/peersync_mobile"
click node_api_app "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/main.py"
click node_settings "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/core/config.py"
click node_auth "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/dependencies/auth.py"
click node_firebase "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/database/firebase.py"
click node_auth_routes "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/auth.py"
click node_otp "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/professor_otp_service.py"
click node_sessions "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/professor_session_service.py"
click node_projects "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/projects.py"
click node_groups "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/groups.py"
click node_milestones "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/milestones.py"
click node_tasks "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/tasks.py"
click node_task_status "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/task_status_service.py"
click node_submissions "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/submissions.py"
click node_announcements "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/announcements.py"
click node_notifications "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/notification_service.py"
click node_push "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/push_service.py"
click node_email_digest "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/email_digest_service.py"
click node_email "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/email_service.py"
click node_calendar_routes "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/google_calendar.py"
click node_calendar_sync "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/calendar_sync_service.py"
click node_calendar_api "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/integrations/google_calendar.py"
click node_drive_routes "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/google_drive.py"
click node_drive_api "https://github.com/devrod11/peersync/blob/main/peersync_backend/app/integrations/google_drive.py"

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_flutter toneBlue
class node_api_app,node_settings,node_auth,node_firebase,node_auth_routes,node_otp,node_sessions,node_firestore toneAmber
class node_projects,node_groups,node_milestones,node_tasks,node_task_status,node_submissions toneMint
class node_announcements,node_notifications,node_push,node_email_digest,node_email toneRose
class node_calendar_routes,node_calendar_sync,node_calendar_api,node_drive_routes,node_drive_api,node_student,node_professor,node_firebase_auth,node_fcm,node_google_calendar,node_google_drive,node_sendgrid toneIndigo
```

## Components

### Client

- [Flutter app](https://github.com/devrod11/peersync/tree/main/peersync_mobile): `peersync_mobile`

### API and access

- [FastAPI app](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/main.py): `peersync_backend/app/main.py`
- [Settings](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/core/config.py): `peersync_backend/app/core/config.py`
- [Authentication and roles](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/dependencies/auth.py): `peersync_backend/app/dependencies/auth.py`
- [Firebase access](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/database/firebase.py): `peersync_backend/app/database/firebase.py`
- [Login and OTP](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/auth.py): `peersync_backend/app/routers/auth.py`
- [Professor OTP](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/professor_otp_service.py): `peersync_backend/app/services/professor_otp_service.py`
- [Professor sessions](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/professor_session_service.py): `peersync_backend/app/services/professor_session_service.py`

### Project workflow

- [Projects](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/projects.py): `peersync_backend/app/routers/projects.py`
- [Groups](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/groups.py): `peersync_backend/app/routers/groups.py`
- [Milestones](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/milestones.py): `peersync_backend/app/routers/milestones.py`
- [Tasks](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/tasks.py): `peersync_backend/app/routers/tasks.py`
- [Task status](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/task_status_service.py): `peersync_backend/app/services/task_status_service.py`
- [Submissions and review](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/submissions.py): `peersync_backend/app/routers/submissions.py`

### Communication

- [Announcements](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/announcements.py): `peersync_backend/app/routers/announcements.py`
- [In-app notifications](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/notification_service.py): `peersync_backend/app/services/notification_service.py`
- [Push delivery](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/push_service.py): `peersync_backend/app/services/push_service.py`
- [Email digests](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/email_digest_service.py): `peersync_backend/app/services/email_digest_service.py`
- [Email delivery](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/email_service.py): `peersync_backend/app/services/email_service.py`

### Integrations

- [Calendar connection](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/google_calendar.py): `peersync_backend/app/routers/google_calendar.py`
- [Deadline sync](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/services/calendar_sync_service.py): `peersync_backend/app/services/calendar_sync_service.py`
- [Calendar API client](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/integrations/google_calendar.py): `peersync_backend/app/integrations/google_calendar.py`
- [Drive connection](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/routers/google_drive.py): `peersync_backend/app/routers/google_drive.py`
- [Drive API client](https://github.com/devrod11/peersync/blob/main/peersync_backend/app/integrations/google_drive.py): `peersync_backend/app/integrations/google_drive.py`

### Other components

- **Student**
- **Professor**
- **Cloud Firestore**
- **Firebase Authentication**
- **Firebase Cloud Messaging**
- **Google Calendar**
- **Google Drive**
- **SendGrid**

## Connections

- Student → Flutter app: uses
- Professor → Flutter app: uses
- Flutter app → FastAPI app: HTTPS API
- FastAPI app → Login and OTP: registers routes (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Projects: registers routes (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Groups: registers routes (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Milestones: registers routes (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Tasks: registers routes (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Submissions and review: registers routes (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Announcements: registers routes (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Calendar connection: registers routes (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Drive connection: registers routes (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Settings: configures CORS (evidence: `peersync_backend/app/main.py`)
- FastAPI app → Firebase access: initializes (evidence: `peersync_backend/app/main.py`)
- Firebase access → Settings: reads settings (evidence: `peersync_backend/app/database/firebase.py`)
- Firebase access → Cloud Firestore: creates client (evidence: `peersync_backend/app/database/firebase.py`)
- Authentication and roles → Firebase access: loads profile (evidence: `peersync_backend/app/dependencies/auth.py`)
- Authentication and roles → Firebase Authentication: verifies token
- Authentication and roles → Professor sessions: validates session (evidence: `peersync_backend/app/dependencies/auth.py`)
- Login and OTP → Professor OTP: uses OTP service (evidence: `peersync_backend/app/routers/auth.py`)
- Login and OTP → Professor sessions: creates session (evidence: `peersync_backend/app/routers/auth.py`)
- Professor OTP → Email delivery: sends code (evidence: `peersync_backend/app/services/professor_otp_service.py`)
- Professor sessions → Cloud Firestore: stores sessions (evidence: `peersync_backend/app/services/professor_session_service.py`)
- Projects → Authentication and roles: checks access
- Groups → Authentication and roles: checks access (evidence: `peersync_backend/app/routers/groups.py`)
- Milestones → Authentication and roles: checks access
- Tasks → Authentication and roles: checks access (evidence: `peersync_backend/app/routers/tasks.py`)
- Submissions and review → Authentication and roles: checks access (evidence: `peersync_backend/app/routers/submissions.py`)
- Announcements → Authentication and roles: checks access (evidence: `peersync_backend/app/routers/announcements.py`)
- Projects → Cloud Firestore: reads and writes
- Groups → Cloud Firestore: reads and writes (evidence: `peersync_backend/app/routers/groups.py`)
- Milestones → Cloud Firestore: reads and writes
- Tasks → Cloud Firestore: reads and writes (evidence: `peersync_backend/app/routers/tasks.py`)
- Submissions and review → Cloud Firestore: reads and writes (evidence: `peersync_backend/app/routers/submissions.py`)
- Tasks → Task status: updates status (evidence: `peersync_backend/app/routers/tasks.py`)
- Submissions and review → Task status: updates status (evidence: `peersync_backend/app/routers/submissions.py`)
- Submissions and review → Drive API client: manages files (evidence: `peersync_backend/app/routers/submissions.py`)
- Drive connection → Drive API client: calls (evidence: `peersync_backend/app/routers/google_drive.py`)
- Drive API client → Google Drive: manages files
- Tasks → Deadline sync: syncs deadlines (evidence: `peersync_backend/app/routers/tasks.py`)
- Calendar connection → Deadline sync: requests sync (evidence: `peersync_backend/app/routers/google_calendar.py`)
- Deadline sync → Calendar API client: calls (evidence: `peersync_backend/app/services/calendar_sync_service.py`)
- Calendar connection → Cloud Firestore: reads and writes (evidence: `peersync_backend/app/routers/google_calendar.py`)
- Calendar API client → Google Calendar: synchronizes events
- Announcements → In-app notifications: creates notifications (evidence: `peersync_backend/app/routers/announcements.py`)
- Announcements → Push delivery: sends push (evidence: `peersync_backend/app/routers/announcements.py`)
- In-app notifications → Cloud Firestore: stores notifications
- Push delivery → In-app notifications: uses notification data (evidence: `peersync_backend/app/services/push_service.py`)
