# accfd/myteam architecture

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

- Interactive diagram: https://gitdiagram.com/accfd/myteam
- Repository: https://github.com/accfd/myteam

## Overview

MyTeam is a student team-finding and team-formation product, with a Flutter mobile client and a Node.js/Express REST API backed by MySQL. The documented user journey is to sign in, discover or create teams, apply or invite candidates, and follow application status through notifications. The backend routes cover these distinct domain stages. Flutter client internals are not included in the supplied source excerpts, so client-to-API communication is shown as unverified; backend route registration and several database calls are directly evidenced.

Main entry points: [`backend/server.js`](https://github.com/accfd/myteam/blob/main/backend/server.js) (Express API), [`backend/src/config/db.js`](https://github.com/accfd/myteam/blob/main/backend/src/config/db.js) (MySQL connection pool), [`backend/src/routes/applications.js`](https://github.com/accfd/myteam/blob/main/backend/src/routes/applications.js) (Applications and invitations), [`backend/src/routes/auth.js`](https://github.com/accfd/myteam/blob/main/backend/src/routes/auth.js) (Account access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Mobile client"]
  node_flutter["Flutter app"]
end

subgraph group_api["API entry and identity"]
  node_server["Express API<br/>[server.js]"]
  node_authroute["Account access<br/>[auth.js]"]
  node_googleverify["Google token check"]
  node_authmw["JWT authentication<br/>[auth.js]"]
end

subgraph group_teams["Teams and applications"]
  node_profile["Profile history<br/>[profile.js]"]
  node_teamsroute["Team discovery and setup<br/>[teams.js]"]
  node_applications["Applications and invitations<br/>[applications.js]"]
  node_members["Team membership<br/>[members.js]"]
  node_capacity["Position capacity<br/>[kuota.js]"]
end

subgraph group_data["Persistence and updates"]
  node_notifications["Status notifications<br/>[notifications.js]"]
  node_dbpool["MySQL connection pool<br/>[db.js]"]
  node_mysql[("MySQL database")]
end

node_student(("Student"))

node_student -->|"uses"| node_flutter
node_flutter -.->|"API access &#40;unverified&#41;"| node_server
node_server -->|"mounts routes"| node_authroute
node_server -->|"mounts routes"| node_profile
node_server -->|"mounts routes"| node_teamsroute
node_server -->|"mounts routes"| node_applications
node_server -->|"mounts routes"| node_members
node_server -->|"mounts routes"| node_notifications
node_authroute -->|"verifies Google token"| node_googleverify
node_applications -->|"protects endpoints"| node_authmw
node_applications -->|"checks capacity"| node_capacity
node_authroute -->|"queries and writes"| node_dbpool
node_applications -->|"queries and writes"| node_dbpool
node_profile -->|"queries and writes"| node_dbpool
node_teamsroute -->|"queries and writes"| node_dbpool
node_members -->|"queries"| node_dbpool
node_notifications -->|"queries"| node_dbpool
node_dbpool -->|"connects to"| node_mysql

click node_flutter "https://github.com/accfd/myteam/tree/main/lib"
click node_server "https://github.com/accfd/myteam/blob/main/backend/server.js"
click node_authroute "https://github.com/accfd/myteam/blob/main/backend/src/routes/auth.js"
click node_googleverify "https://github.com/accfd/myteam/blob/main/backend/src/middleware/verify_google_token.js"
click node_authmw "https://github.com/accfd/myteam/blob/main/backend/src/middleware/auth.js"
click node_profile "https://github.com/accfd/myteam/blob/main/backend/src/routes/profile.js"
click node_teamsroute "https://github.com/accfd/myteam/blob/main/backend/src/routes/teams.js"
click node_applications "https://github.com/accfd/myteam/blob/main/backend/src/routes/applications.js"
click node_members "https://github.com/accfd/myteam/blob/main/backend/src/routes/members.js"
click node_capacity "https://github.com/accfd/myteam/blob/main/backend/src/utils/kuota.js"
click node_notifications "https://github.com/accfd/myteam/blob/main/backend/src/routes/notifications.js"
click node_dbpool "https://github.com/accfd/myteam/blob/main/backend/src/config/db.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_flutter toneBlue
class node_server,node_authroute,node_googleverify,node_authmw toneAmber
class node_profile,node_teamsroute,node_applications,node_members,node_capacity toneMint
class node_notifications,node_dbpool,node_mysql toneRose
class node_student toneIndigo
```

## Components

### Mobile client

- [Flutter app](https://github.com/accfd/myteam/tree/main/lib): `lib`

### API entry and identity

- [Express API](https://github.com/accfd/myteam/blob/main/backend/server.js): `backend/server.js`
- [Account access](https://github.com/accfd/myteam/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Google token check](https://github.com/accfd/myteam/blob/main/backend/src/middleware/verify_google_token.js): `backend/src/middleware/verify_google_token.js`
- [JWT authentication](https://github.com/accfd/myteam/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`

### Teams and applications

- [Profile history](https://github.com/accfd/myteam/blob/main/backend/src/routes/profile.js): `backend/src/routes/profile.js`
- [Team discovery and setup](https://github.com/accfd/myteam/blob/main/backend/src/routes/teams.js): `backend/src/routes/teams.js`
- [Applications and invitations](https://github.com/accfd/myteam/blob/main/backend/src/routes/applications.js): `backend/src/routes/applications.js`
- [Team membership](https://github.com/accfd/myteam/blob/main/backend/src/routes/members.js): `backend/src/routes/members.js`
- [Position capacity](https://github.com/accfd/myteam/blob/main/backend/src/utils/kuota.js): `backend/src/utils/kuota.js`

### Persistence and updates

- [Status notifications](https://github.com/accfd/myteam/blob/main/backend/src/routes/notifications.js): `backend/src/routes/notifications.js`
- [MySQL connection pool](https://github.com/accfd/myteam/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- **MySQL database**

### Other components

- **Student**

## Connections

- Student → Flutter app: uses
- Flutter app → Express API: API access (unverified)
- Express API → Account access: mounts routes (evidence: `backend/server.js`)
- Express API → Profile history: mounts routes (evidence: `backend/server.js`)
- Express API → Team discovery and setup: mounts routes (evidence: `backend/server.js`)
- Express API → Applications and invitations: mounts routes (evidence: `backend/server.js`)
- Express API → Team membership: mounts routes (evidence: `backend/server.js`)
- Express API → Status notifications: mounts routes (evidence: `backend/server.js`)
- Account access → Google token check: verifies Google token (evidence: `backend/src/routes/auth.js`)
- Applications and invitations → JWT authentication: protects endpoints (evidence: `backend/src/routes/applications.js`)
- Applications and invitations → Position capacity: checks capacity (evidence: `backend/src/routes/applications.js`)
- Account access → MySQL connection pool: queries and writes (evidence: `backend/src/routes/auth.js`)
- Applications and invitations → MySQL connection pool: queries and writes (evidence: `backend/src/routes/applications.js`)
- Profile history → MySQL connection pool: queries and writes (evidence: `backend/src/routes/profile.js`)
- Team discovery and setup → MySQL connection pool: queries and writes (evidence: `backend/src/routes/teams.js`)
- Team membership → MySQL connection pool: queries (evidence: `backend/src/routes/members.js`)
- Status notifications → MySQL connection pool: queries (evidence: `backend/src/routes/notifications.js`)
- MySQL connection pool → MySQL database: connects to (evidence: `backend/src/config/db.js`)
