# arhrid-hamza/smartcollab architecture

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

- Interactive diagram: https://gitdiagram.com/arhrid-hamza/smartcollab
- Repository: https://github.com/arhrid-hamza/smartcollab

## Overview

EMSICollab is documented as an academic project and PFE platform: users sign in, maintain role-based profiles and skills, then use project publication, recommendation, applications, and teacher review; teams also receive skill-fit evaluation. The available tree contains the frontend and auth service, but not the documented project or matching service implementations, so those capabilities are represented only from the README. Edges for sampled flows use source references or excerpts; unsampled service relationships cite the README.

Main entry points: [`backend/auth-service/src/main/java/com/smartcollab/auth/service/AuthService.java`](https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/service/AuthService.java) (Account services), [`frontend/src/App.jsx`](https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/App.jsx) (SPA routes), [`frontend/src/api/client.js`](https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/api/client.js) (HTTP client), [`frontend/src/context/AuthContext.jsx`](https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/context/AuthContext.jsx) (Session context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["SPA routes<br/>[App.jsx]"]
  node_login["Login and registration<br/>[LoginPage.jsx]"]
  node_dashboard["Role dashboards<br/>[DashboardPage.jsx]"]
  node_authctx["Session context<br/>[AuthContext.jsx]"]
  node_client["HTTP client<br/>[client.js]"]
end

subgraph group_identity["Identity and skills"]
  node_authapi["Auth endpoints"]
  node_usersapi["User management"]
  node_authservice["Account services<br/>[AuthService.java]"]
  node_jwt["JWT issuance<br/>[JwtService.java]"]
  node_userrepo["User repository"]
  node_skillsapi["Skill catalog API"]
  node_skillrepo["Skill repository"]
  node_authdb[("Auth PostgreSQL")]
end

subgraph group_projects["Project lifecycle"]
  node_project["Project publishing and applications"]
  node_recommend["PFE recommendations"]
  node_review["Teacher review"]
end

subgraph group_matching["Team matching"]
  node_team["Team fit engine"]
  node_teammates["Teammate recommendations"]
  node_kafka["Kafka events"]
end

node_actor(("Student, teacher, admin"))

node_actor -->|"uses"| node_app
node_app -->|"provides session"| node_authctx
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_dashboard
node_login -->|"authenticates through"| node_authctx
node_authctx -->|"calls API"| node_client
node_client -->|"sends auth requests"| node_authapi
node_client -->|"verifies session"| node_usersapi
node_authapi -->|"delegates to"| node_authservice
node_usersapi -->|"manages accounts"| node_authservice
node_authservice -->|"reads and writes"| node_userrepo
node_authservice -->|"issues tokens"| node_jwt
node_skillsapi -->|"queries skills"| node_skillrepo
node_userrepo -->|"persists accounts"| node_authdb
node_skillrepo -->|"persists catalog"| node_authdb
node_actor -->|"publishes or applies"| node_project
node_project -->|"feeds matching"| node_recommend
node_project -->|"enters review"| node_review
node_project -.->|"emits project event"| node_kafka
node_kafka -.->|"dispatches event"| node_team
node_team -->|"suggests candidates"| node_teammates
node_team -.->|"retrieves profiles and skills"| node_authservice
node_team -.->|"retrieves requirements"| node_project

click node_app "https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/pages/LoginPage.jsx"
click node_dashboard "https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/pages/DashboardPage.jsx"
click node_authctx "https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/context/AuthContext.jsx"
click node_client "https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/api/client.js"
click node_authapi "https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/controller/AuthController.java"
click node_usersapi "https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/controller/UserController.java"
click node_authservice "https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/service/AuthService.java"
click node_jwt "https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/security/JwtService.java"
click node_userrepo "https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/repository/UserRepository.java"
click node_skillsapi "https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/controller/SkillController.java"
click node_skillrepo "https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/repository/SkillRepository.java"

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_app,node_login,node_dashboard,node_authctx,node_client toneBlue
class node_authapi,node_usersapi,node_authservice,node_jwt,node_userrepo,node_skillsapi,node_skillrepo,node_authdb toneAmber
class node_project,node_recommend,node_review toneMint
class node_team,node_teammates,node_kafka toneRose
class node_actor toneIndigo
```

## Components

### Web application

- [SPA routes](https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login and registration](https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/pages/LoginPage.jsx): `frontend/src/pages/LoginPage.jsx`
- [Role dashboards](https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/pages/DashboardPage.jsx): `frontend/src/pages/DashboardPage.jsx`
- [Session context](https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [HTTP client](https://github.com/arhrid-hamza/smartcollab/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`

### Identity and skills

- [Auth endpoints](https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/controller/AuthController.java): `backend/auth-service/src/main/java/com/smartcollab/auth/controller/AuthController.java`
- [User management](https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/controller/UserController.java): `backend/auth-service/src/main/java/com/smartcollab/auth/controller/UserController.java`
- [Account services](https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/service/AuthService.java): `backend/auth-service/src/main/java/com/smartcollab/auth/service/AuthService.java`
- [JWT issuance](https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/security/JwtService.java): `backend/auth-service/src/main/java/com/smartcollab/auth/security/JwtService.java`
- [User repository](https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/repository/UserRepository.java): `backend/auth-service/src/main/java/com/smartcollab/auth/repository/UserRepository.java`
- [Skill catalog API](https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/controller/SkillController.java): `backend/auth-service/src/main/java/com/smartcollab/auth/controller/SkillController.java`
- [Skill repository](https://github.com/arhrid-hamza/smartcollab/blob/main/backend/auth-service/src/main/java/com/smartcollab/auth/repository/SkillRepository.java): `backend/auth-service/src/main/java/com/smartcollab/auth/repository/SkillRepository.java`
- **Auth PostgreSQL**

### Project lifecycle

- **Project publishing and applications**
- **PFE recommendations**
- **Teacher review**

### Team matching

- **Team fit engine**
- **Teammate recommendations**
- **Kafka events**

### Other components

- **Student, teacher, admin**

## Connections

- Student, teacher, admin → SPA routes: uses
- SPA routes → Session context: provides session (evidence: `frontend/src/App.jsx`)
- SPA routes → Login and registration: routes to (evidence: `frontend/src/App.jsx`)
- SPA routes → Role dashboards: routes to (evidence: `frontend/src/App.jsx`)
- Login and registration → Session context: authenticates through (evidence: `frontend/src/pages/LoginPage.jsx`)
- Session context → HTTP client: calls API (evidence: `frontend/src/context/AuthContext.jsx`)
- HTTP client → Auth endpoints: sends auth requests
- HTTP client → User management: verifies session
- Auth endpoints → Account services: delegates to (evidence: `backend/auth-service/src/main/java/com/smartcollab/auth/controller/AuthController.java`)
- User management → Account services: manages accounts (evidence: `backend/auth-service/src/main/java/com/smartcollab/auth/controller/UserController.java`)
- Account services → User repository: reads and writes (evidence: `backend/auth-service/src/main/java/com/smartcollab/auth/service/AuthService.java`)
- Account services → JWT issuance: issues tokens (evidence: `backend/auth-service/src/main/java/com/smartcollab/auth/service/AuthService.java`)
- Skill catalog API → Skill repository: queries skills (evidence: `backend/auth-service/src/main/java/com/smartcollab/auth/controller/SkillController.java`)
- User repository → Auth PostgreSQL: persists accounts (evidence: `README.md`)
- Skill repository → Auth PostgreSQL: persists catalog (evidence: `README.md`)
- Student, teacher, admin → Project publishing and applications: publishes or applies (evidence: `README.md`)
- Project publishing and applications → PFE recommendations: feeds matching (evidence: `README.md`)
- Project publishing and applications → Teacher review: enters review (evidence: `README.md`)
- Project publishing and applications → Kafka events: emits project event (evidence: `README.md`)
- Kafka events → Team fit engine: dispatches event (evidence: `README.md`)
- Team fit engine → Teammate recommendations: suggests candidates (evidence: `README.md`)
- Team fit engine → Account services: retrieves profiles and skills (evidence: `README.md`)
- Team fit engine → Project publishing and applications: retrieves requirements (evidence: `README.md`)
