# stelioydev/servlink architecture

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

- Interactive diagram: https://gitdiagram.com/stelioydev/servlink
- Repository: https://github.com/stelioydev/servlink

## Overview

ServLink IA is a marketplace connecting clients with service providers. The main workflow is: users register or sign in, providers publish service profiles, and clients search by text, category, or city to view matching profiles. The React app sends requests through a shared API client to FastAPI; the backend validates data, handles authentication, and queries PostgreSQL. The README describes a future semantic-search capability, but the current implementation uses textual matching and simple ordering. Edges reflect shown calls or documented relationships; unsampled UI behavior is not assumed.

Main entry points: [`backend/app/main.py`](https://github.com/stelioydev/servlink/blob/main/backend/app/main.py) (API routes), [`backend/app/database.py`](https://github.com/stelioydev/servlink/blob/main/backend/app/database.py) (DB sessions), [`backend/app/security.py`](https://github.com/stelioydev/servlink/blob/main/backend/app/security.py) (Password and JWT), [`frontend/src/App.jsx`](https://github.com/stelioydev/servlink/blob/main/frontend/src/App.jsx) (Marketplace UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_web_app["Marketplace UI<br/>[App.jsx]"]
  node_api_client["HTTP client<br/>[api.js]"]
  node_app_entry["React entry<br/>[main.jsx]"]
end

subgraph group_api["API workflows"]
  node_api_routes["API routes<br/>[main.py]"]
  node_search["Provider search<br/>[main.py]"]
  node_provider_profiles["Provider profiles<br/>[main.py]"]
end

subgraph group_identity["Identity and contracts"]
  node_auth_routes["Auth routes<br/>[main.py]"]
  node_token_security["Password and JWT<br/>[security.py]"]
  node_api_schemas["Request contracts<br/>[schemas.py]"]
end

subgraph group_persistence["Persistence"]
  node_orm_models["User and profiles<br/>[models.py]"]
  node_db_session["DB sessions<br/>[database.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
end

node_client(("Client"))
node_provider(("Service provider"))
node_postgres[("PostgreSQL")]

node_client -->|"browses and searches"| node_web_app
node_provider -->|"registers services"| node_web_app
node_app_entry -->|"renders"| node_web_app
node_web_app -->|"calls"| node_api_client
node_api_client -->|"sends HTTP requests"| node_api_routes
node_api_routes -->|"defines"| node_auth_routes
node_api_routes -->|"defines"| node_search
node_api_routes -->|"defines"| node_provider_profiles
node_api_routes -->|"uses contracts"| node_api_schemas
node_api_routes -->|"calls auth helpers"| node_token_security
node_auth_routes -->|"hashes and verifies"| node_token_security
node_token_security -->|"loads user"| node_orm_models
node_token_security -->|"depends on session"| node_db_session
node_db_session -->|"reads database URL"| node_settings
node_orm_models -->|"uses base"| node_db_session
node_api_routes -->|"uses sessions"| node_db_session
node_db_session -->|"connects to"| node_postgres

click node_web_app "https://github.com/stelioydev/servlink/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/stelioydev/servlink/blob/main/frontend/src/api.js"
click node_app_entry "https://github.com/stelioydev/servlink/blob/main/frontend/src/main.jsx"
click node_api_routes "https://github.com/stelioydev/servlink/blob/main/backend/app/main.py"
click node_search "https://github.com/stelioydev/servlink/blob/main/backend/app/main.py"
click node_provider_profiles "https://github.com/stelioydev/servlink/blob/main/backend/app/main.py"
click node_auth_routes "https://github.com/stelioydev/servlink/blob/main/backend/app/main.py"
click node_token_security "https://github.com/stelioydev/servlink/blob/main/backend/app/security.py"
click node_api_schemas "https://github.com/stelioydev/servlink/blob/main/backend/app/schemas.py"
click node_orm_models "https://github.com/stelioydev/servlink/blob/main/backend/app/models.py"
click node_db_session "https://github.com/stelioydev/servlink/blob/main/backend/app/database.py"
click node_settings "https://github.com/stelioydev/servlink/blob/main/backend/app/config.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_web_app,node_api_client,node_app_entry,node_client toneBlue
class node_api_routes,node_search,node_provider_profiles,node_postgres toneAmber
class node_auth_routes,node_token_security,node_api_schemas toneMint
class node_orm_models,node_db_session,node_settings toneRose
class node_provider toneIndigo
```

## Components

### Web experience

- [Marketplace UI](https://github.com/stelioydev/servlink/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [HTTP client](https://github.com/stelioydev/servlink/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [React entry](https://github.com/stelioydev/servlink/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`

### API workflows

- [API routes](https://github.com/stelioydev/servlink/blob/main/backend/app/main.py): `backend/app/main.py`
- [Provider search](https://github.com/stelioydev/servlink/blob/main/backend/app/main.py): `backend/app/main.py`
- [Provider profiles](https://github.com/stelioydev/servlink/blob/main/backend/app/main.py): `backend/app/main.py`

### Identity and contracts

- [Auth routes](https://github.com/stelioydev/servlink/blob/main/backend/app/main.py): `backend/app/main.py`
- [Password and JWT](https://github.com/stelioydev/servlink/blob/main/backend/app/security.py): `backend/app/security.py`
- [Request contracts](https://github.com/stelioydev/servlink/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Persistence

- [User and profiles](https://github.com/stelioydev/servlink/blob/main/backend/app/models.py): `backend/app/models.py`
- [DB sessions](https://github.com/stelioydev/servlink/blob/main/backend/app/database.py): `backend/app/database.py`
- [Runtime settings](https://github.com/stelioydev/servlink/blob/main/backend/app/config.py): `backend/app/config.py`

### Other components

- **Client**
- **Service provider**
- **PostgreSQL**

## Connections

- Client → Marketplace UI: browses and searches (evidence: `README.md`)
- Service provider → Marketplace UI: registers services (evidence: `README.md`)
- React entry → Marketplace UI: renders (evidence: `frontend/src/main.jsx`)
- Marketplace UI → HTTP client: calls (evidence: `frontend/src/App.jsx`)
- HTTP client → API routes: sends HTTP requests (evidence: `README.md`)
- API routes → Auth routes: defines (evidence: `backend/app/main.py`)
- API routes → Provider search: defines (evidence: `backend/app/main.py`)
- API routes → Provider profiles: defines (evidence: `backend/app/main.py`)
- API routes → Request contracts: uses contracts (evidence: `backend/app/main.py`)
- API routes → Password and JWT: calls auth helpers (evidence: `backend/app/main.py`)
- Auth routes → Password and JWT: hashes and verifies (evidence: `backend/app/main.py`)
- Password and JWT → User and profiles: loads user (evidence: `backend/app/security.py`)
- Password and JWT → DB sessions: depends on session (evidence: `backend/app/security.py`)
- DB sessions → Runtime settings: reads database URL (evidence: `backend/app/database.py`)
- User and profiles → DB sessions: uses base (evidence: `backend/app/models.py`)
- API routes → DB sessions: uses sessions (evidence: `backend/app/main.py`)
- DB sessions → PostgreSQL: connects to (evidence: `README.md`)
