# adidev1512006/skillswap architecture

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

- Interactive diagram: https://gitdiagram.com/adidev1512006/skillswap
- Repository: https://github.com/adidev1512006/skillswap

## Overview

SkillSwap is a browser-based skill-exchange platform. Users browse skills and teachers, request or offer skills, book sessions, and use related community features. The frontend calls an Express API, whose routes implement domain operations using a MySQL connection. The README lists additional capabilities beyond the sampled code; those are represented at the route subsystem level where their implementation details were not shown. The graph keeps browser-to-API flow distinct from backend database access; unsampled route details are not expanded into unsupported call chains.

Main entry points: [`backend/db.js`](https://github.com/adidev1512006/skillswap/blob/main/backend/db.js) (MySQL connection), [`frontend/script.js`](https://github.com/adidev1512006/skillswap/blob/main/frontend/script.js) (SkillSwap UI), [`backend/server.js`](https://github.com/adidev1512006/skillswap/blob/main/backend/server.js) (HTTP server), [`backend/routes/routes.js`](https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js) (Accounts and profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_frontend["SkillSwap UI<br/>[script.js]"]
end

subgraph group_api["API and domain"]
  node_server["HTTP server<br/>[server.js]"]
  node_auth_profile["Accounts and profiles<br/>[routes.js]"]
  node_skills["Skills and requests<br/>[routes.js]"]
  node_teacher_search["Teacher matching<br/>[routes.js]"]
  node_sessions["Session booking<br/>[routes.js]"]
  node_messaging["Messaging<br/>[routes.js]"]
  node_reviews["Reviews and ratings<br/>[routes.js]"]
  node_community["Favorites and alerts<br/>[routes.js]"]
  node_dashboard["Dashboard stats<br/>[routes.js]"]
end

subgraph group_storage["Persistence"]
  node_db_connection["MySQL connection<br/>[db.js]"]
  node_mysql[("MySQL database")]
end

node_user(("Platform user"))

node_user -->|"uses"| node_frontend
node_frontend -->|"calls API"| node_server
node_server -->|"mounts routes"| node_auth_profile
node_frontend -->|"manages skills"| node_skills
node_frontend -->|"finds teachers"| node_teacher_search
node_frontend -->|"books sessions"| node_sessions
node_frontend -->|"sends messages"| node_messaging
node_frontend -->|"submits reviews"| node_reviews
node_server -->|"tests connection"| node_db_connection
node_auth_profile -->|"queries"| node_db_connection
node_skills -->|"queries"| node_db_connection
node_teacher_search -->|"queries"| node_db_connection
node_sessions -->|"queries"| node_db_connection
node_messaging -->|"queries"| node_db_connection
node_reviews -->|"queries"| node_db_connection
node_community -->|"queries"| node_db_connection
node_dashboard -.->|"queries"| node_db_connection
node_db_connection -->|"connects"| node_mysql

click node_frontend "https://github.com/adidev1512006/skillswap/blob/main/frontend/script.js"
click node_server "https://github.com/adidev1512006/skillswap/blob/main/backend/server.js"
click node_auth_profile "https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js"
click node_skills "https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js"
click node_teacher_search "https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js"
click node_sessions "https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js"
click node_messaging "https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js"
click node_reviews "https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js"
click node_community "https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js"
click node_dashboard "https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js"
click node_db_connection "https://github.com/adidev1512006/skillswap/blob/main/backend/db.js"
click node_mysql "https://github.com/adidev1512006/skillswap/blob/main/backend/sql/skill_exchange_complete.sql"

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_frontend,node_user toneBlue
class node_server,node_auth_profile,node_skills,node_teacher_search,node_sessions,node_messaging,node_reviews,node_community,node_dashboard toneAmber
class node_db_connection,node_mysql toneMint
```

## Components

### Browser client

- [SkillSwap UI](https://github.com/adidev1512006/skillswap/blob/main/frontend/script.js): `frontend/script.js`

### API and domain

- [HTTP server](https://github.com/adidev1512006/skillswap/blob/main/backend/server.js): `backend/server.js`
- [Accounts and profiles](https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js): `backend/routes/routes.js`
- [Skills and requests](https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js): `backend/routes/routes.js`
- [Teacher matching](https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js): `backend/routes/routes.js`
- [Session booking](https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js): `backend/routes/routes.js`
- [Messaging](https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js): `backend/routes/routes.js`
- [Reviews and ratings](https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js): `backend/routes/routes.js`
- [Favorites and alerts](https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js): `backend/routes/routes.js`
- [Dashboard stats](https://github.com/adidev1512006/skillswap/blob/main/backend/routes/routes.js): `backend/routes/routes.js`

### Persistence

- [MySQL connection](https://github.com/adidev1512006/skillswap/blob/main/backend/db.js): `backend/db.js`
- [MySQL database](https://github.com/adidev1512006/skillswap/blob/main/backend/sql/skill_exchange_complete.sql): `backend/sql/skill_exchange_complete.sql`

### Other components

- **Platform user**

## Connections

- Platform user → SkillSwap UI: uses (evidence: `frontend/script.js`)
- SkillSwap UI → HTTP server: calls API (evidence: `frontend/script.js`)
- HTTP server → Accounts and profiles: mounts routes (evidence: `backend/server.js`)
- SkillSwap UI → Skills and requests: manages skills (evidence: `frontend/script.js`)
- SkillSwap UI → Teacher matching: finds teachers (evidence: `frontend/script.js`)
- SkillSwap UI → Session booking: books sessions (evidence: `frontend/script.js`)
- SkillSwap UI → Messaging: sends messages (evidence: `frontend/script.js`)
- SkillSwap UI → Reviews and ratings: submits reviews (evidence: `frontend/script.js`)
- HTTP server → MySQL connection: tests connection (evidence: `backend/server.js`)
- Accounts and profiles → MySQL connection: queries (evidence: `backend/routes/routes.js`)
- Skills and requests → MySQL connection: queries (evidence: `backend/routes/routes.js`)
- Teacher matching → MySQL connection: queries (evidence: `backend/routes/routes.js`)
- Session booking → MySQL connection: queries (evidence: `backend/routes/routes.js`)
- Messaging → MySQL connection: queries (evidence: `backend/routes/routes.js`)
- Reviews and ratings → MySQL connection: queries (evidence: `backend/routes/routes.js`)
- Favorites and alerts → MySQL connection: queries (evidence: `backend/routes/routes.js`)
- Dashboard stats → MySQL connection: queries (evidence: `backend/routes/routes.js`)
- MySQL connection → MySQL database: connects (evidence: `backend/db.js`)
