# abhiraljain07/visitor-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/abhiraljain07/visitor-management-system
- Repository: https://github.com/abhiraljain07/visitor-management-system

## Overview

Atithi VMS is a multi-tenant visitor-management product. The principal workflow runs from reception face scanning and visitor registration through visit submission, host notification and approval, then checkout; the system also provides tenant administration, reports, and audit trails. The graph combines sampled frontend and backend modules with capabilities explicitly documented in the README. Some subsystem internals were not sampled, so their connections are shown only where source-index references or README statements support them.

Main entry points: [`backend/server.js`](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/server.js) (REST API server), [`backend/routes/visits.js`](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/visits.js) (Visit lifecycle and approvals), [`frontend/src/routes/AppRoutes.tsx`](https://github.com/abhiraljain07/visitor-management-system/blob/main/frontend/src/routes/AppRoutes.tsx) (Role-based portals), [`backend/routes/visitors.js`](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/visitors.js) (Visitor registration and matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_frontend["Role-based portals<br/>[AppRoutes.tsx]"]
  node_landing["Landing and dashboards<br/>[LandingPage.tsx]"]
  node_apiclient["HTTP API client<br/>[client.ts]"]
  node_offline[("Offline queue and sync<br/>[offlineService.ts]")]
end

subgraph group_identity["Identity and access"]
  node_authui["Authentication UI"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
  node_authmw["JWT and role authorization<br/>[auth.js]"]
end

subgraph group_visitor["Visitor operations"]
  node_visitorui["Visitor and check-in UI"]
  node_visitui["Visit approvals UI"]
  node_visitorroute["Visitor registration and matching<br/>[visitors.js]"]
  node_visitroutes["Visit lifecycle and approvals<br/>[visits.js]"]
  node_visitorrecords[("Visitor profiles<br/>[Visitor.js]")]
  node_visitrecords[("Visit records<br/>[Visit.js]")]
end

subgraph group_platform["Tenant platform"]
  node_adminui["Tenant administration UI"]
  node_superui["Platform administration UI"]
  node_employee[("Employee directory<br/>[Employee.js]")]
  node_tenant[("Tenant management<br/>[Tenant.js]")]
  node_platformroutes["Tenant and office administration<br/>[tenants.js]"]
  node_masterroutes["Master data configuration"]
  node_reports["Reports and analytics<br/>[reports.js]"]
  node_audit["Audit logging<br/>[auditLog.js]"]
end

subgraph group_integrations["Services and data"]
  node_server["REST API server<br/>[server.js]"]
  node_face["Face recognition service<br/>[app.py]"]
  node_telegram["Telegram notifications<br/>[telegram.js]"]
  node_cloudinary["Photo storage<br/>[cloudinary.js]"]
  node_mongo[("MongoDB")]
end

node_browser(("Reception, host and admin users"))

node_browser -->|"uses portals"| node_frontend
node_frontend -->|"routes to"| node_landing
node_frontend -->|"routes to"| node_authui
node_frontend -.->|"routes to"| node_visitorui
node_frontend -.->|"routes to"| node_visitui
node_frontend -.->|"routes to"| node_adminui
node_frontend -.->|"routes to"| node_superui
node_authui -.->|"sends requests"| node_apiclient
node_visitorui -.->|"sends requests"| node_apiclient
node_visitui -.->|"sends requests"| node_apiclient
node_adminui -.->|"sends requests"| node_apiclient
node_apiclient -->|"HTTP requests"| node_server
node_browser -.->|"queues work"| node_offline
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_visitorroute
node_server -->|"mounts routes"| node_visitroutes
node_server -->|"mounts routes"| node_platformroutes
node_server -->|"mounts routes"| node_masterroutes
node_server -->|"mounts routes"| node_reports
node_authroutes -->|"uses authorization"| node_authmw
node_authroutes -->|"records events"| node_audit
node_visitorroute -->|"reads and writes"| node_visitorrecords
node_visitroutes -->|"reads and writes"| node_visitrecords
node_visitroutes -->|"loads profiles"| node_visitorrecords
node_visitroutes -->|"loads hosts"| node_employee
node_visitorroute -->|"matches faces"| node_face
node_visitorroute -->|"stores photos"| node_cloudinary
node_visitroutes -->|"notifies host"| node_telegram
node_visitroutes -->|"records events"| node_audit
node_platformroutes -.->|"manages tenants"| node_tenant
node_masterroutes -.->|"persists settings"| node_mongo
node_reports -.->|"queries analytics"| node_mongo
node_server -->|"connects to"| node_mongo
node_visitorroute -.->|"persists profiles"| node_mongo
node_visitroutes -.->|"persists visits"| node_mongo
node_browser -.->|"starts face scan"| node_visitorui
node_visitorui -.->|"submits check-in"| node_visitroutes
node_browser -.->|"decides request"| node_visitui

click node_frontend "https://github.com/abhiraljain07/visitor-management-system/blob/main/frontend/src/routes/AppRoutes.tsx"
click node_landing "https://github.com/abhiraljain07/visitor-management-system/blob/main/frontend/src/pages/LandingPage.tsx"
click node_authui "https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/auth"
click node_visitorui "https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/visitors"
click node_visitui "https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/visits"
click node_adminui "https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/tenant-admin"
click node_superui "https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/super-admin"
click node_apiclient "https://github.com/abhiraljain07/visitor-management-system/blob/main/frontend/src/api/client.ts"
click node_offline "https://github.com/abhiraljain07/visitor-management-system/blob/main/frontend/src/offline/offlineService.ts"
click node_server "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/server.js"
click node_authroutes "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/auth.js"
click node_authmw "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/middleware/auth.js"
click node_visitorroute "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/visitors.js"
click node_visitroutes "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/visits.js"
click node_visitorrecords "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/models/Visitor.js"
click node_visitrecords "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/models/Visit.js"
click node_employee "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/models/Employee.js"
click node_tenant "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/models/Tenant.js"
click node_platformroutes "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/tenants.js"
click node_masterroutes "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/customMasterData.js"
click node_reports "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/reports.js"
click node_audit "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/middleware/auditLog.js"
click node_face "https://github.com/abhiraljain07/visitor-management-system/blob/main/face-service/app.py"
click node_telegram "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/telegram.js"
click node_cloudinary "https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/cloudinary.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_frontend,node_landing,node_apiclient,node_offline,node_browser toneBlue
class node_authui,node_authroutes,node_authmw toneAmber
class node_visitorui,node_visitui,node_visitorroute,node_visitroutes,node_visitorrecords,node_visitrecords toneMint
class node_adminui,node_superui,node_employee,node_tenant,node_platformroutes,node_masterroutes,node_reports,node_audit toneRose
class node_server,node_face,node_telegram,node_cloudinary,node_mongo toneIndigo
```

## Components

### Web application

- [Role-based portals](https://github.com/abhiraljain07/visitor-management-system/blob/main/frontend/src/routes/AppRoutes.tsx): `frontend/src/routes/AppRoutes.tsx`
- [Landing and dashboards](https://github.com/abhiraljain07/visitor-management-system/blob/main/frontend/src/pages/LandingPage.tsx): `frontend/src/pages/LandingPage.tsx`
- [HTTP API client](https://github.com/abhiraljain07/visitor-management-system/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Offline queue and sync](https://github.com/abhiraljain07/visitor-management-system/blob/main/frontend/src/offline/offlineService.ts): `frontend/src/offline/offlineService.ts`

### Identity and access

- [Authentication UI](https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/auth): `frontend/src/features/auth`
- [Authentication routes](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [JWT and role authorization](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`

### Visitor operations

- [Visitor and check-in UI](https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/visitors): `frontend/src/features/visitors`
- [Visit approvals UI](https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/visits): `frontend/src/features/visits`
- [Visitor registration and matching](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/visitors.js): `backend/routes/visitors.js`
- [Visit lifecycle and approvals](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/visits.js): `backend/routes/visits.js`
- [Visitor profiles](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/models/Visitor.js): `backend/models/Visitor.js`
- [Visit records](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/models/Visit.js): `backend/models/Visit.js`

### Tenant platform

- [Tenant administration UI](https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/tenant-admin): `frontend/src/features/tenant-admin`
- [Platform administration UI](https://github.com/abhiraljain07/visitor-management-system/tree/main/frontend/src/features/super-admin): `frontend/src/features/super-admin`
- [Employee directory](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/models/Employee.js): `backend/models/Employee.js`
- [Tenant management](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/models/Tenant.js): `backend/models/Tenant.js`
- [Tenant and office administration](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/tenants.js): `backend/routes/tenants.js`
- [Master data configuration](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/customMasterData.js): `backend/routes/customMasterData.js`
- [Reports and analytics](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/routes/reports.js): `backend/routes/reports.js`
- [Audit logging](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/middleware/auditLog.js): `backend/middleware/auditLog.js`

### Services and data

- [REST API server](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/server.js): `backend/server.js`
- [Face recognition service](https://github.com/abhiraljain07/visitor-management-system/blob/main/face-service/app.py): `face-service/app.py`
- [Telegram notifications](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/telegram.js): `backend/telegram.js`
- [Photo storage](https://github.com/abhiraljain07/visitor-management-system/blob/main/backend/cloudinary.js): `backend/cloudinary.js`
- **MongoDB**

### Other components

- **Reception, host and admin users**

## Connections

- Reception, host and admin users → Role-based portals: uses portals (evidence: `frontend/src/routes/AppRoutes.tsx`)
- Role-based portals → Landing and dashboards: routes to (evidence: `frontend/src/routes/AppRoutes.tsx`)
- Role-based portals → Authentication UI: routes to (evidence: `frontend/src/routes/AppRoutes.tsx`)
- Role-based portals → Visitor and check-in UI: routes to
- Role-based portals → Visit approvals UI: routes to
- Role-based portals → Tenant administration UI: routes to
- Role-based portals → Platform administration UI: routes to
- Authentication UI → HTTP API client: sends requests
- Visitor and check-in UI → HTTP API client: sends requests
- Visit approvals UI → HTTP API client: sends requests
- Tenant administration UI → HTTP API client: sends requests
- HTTP API client → REST API server: HTTP requests
- Reception, host and admin users → Offline queue and sync: queues work
- REST API server → Authentication routes: mounts routes (evidence: `backend/server.js`)
- REST API server → Visitor registration and matching: mounts routes (evidence: `backend/server.js`)
- REST API server → Visit lifecycle and approvals: mounts routes (evidence: `backend/server.js`)
- REST API server → Tenant and office administration: mounts routes (evidence: `backend/server.js`)
- REST API server → Master data configuration: mounts routes (evidence: `backend/server.js`)
- REST API server → Reports and analytics: mounts routes (evidence: `backend/server.js`)
- Authentication routes → JWT and role authorization: uses authorization (evidence: `backend/routes/auth.js`)
- Authentication routes → Audit logging: records events (evidence: `backend/routes/auth.js`)
- Visitor registration and matching → Visitor profiles: reads and writes (evidence: `backend/routes/visitors.js`)
- Visit lifecycle and approvals → Visit records: reads and writes (evidence: `backend/routes/visits.js`)
- Visit lifecycle and approvals → Visitor profiles: loads profiles (evidence: `backend/routes/visits.js`)
- Visit lifecycle and approvals → Employee directory: loads hosts (evidence: `backend/routes/visits.js`)
- Visitor registration and matching → Face recognition service: matches faces (evidence: `backend/routes/visitors.js`)
- Visitor registration and matching → Photo storage: stores photos (evidence: `backend/routes/visitors.js`)
- Visit lifecycle and approvals → Telegram notifications: notifies host (evidence: `backend/routes/visits.js`)
- Visit lifecycle and approvals → Audit logging: records events (evidence: `backend/routes/visits.js`)
- Tenant and office administration → Tenant management: manages tenants
- Master data configuration → MongoDB: persists settings
- Reports and analytics → MongoDB: queries analytics
- REST API server → MongoDB: connects to (evidence: `backend/server.js`)
- Visitor registration and matching → MongoDB: persists profiles
- Visit lifecycle and approvals → MongoDB: persists visits
- Reception, host and admin users → Visitor and check-in UI: starts face scan
- Visitor and check-in UI → Visit lifecycle and approvals: submits check-in
- Reception, host and admin users → Visit approvals UI: decides request
