# thenewlong/geoattend architecture

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

- Interactive diagram: https://gitdiagram.com/thenewlong/geoattend
- Repository: https://github.com/thenewlong/geoattend

## Overview

GeoAttend is an employee attendance web app with an administrator dashboard and an Express API. Employees sign in, view attendance status/history, and submit a check-in; the server verifies identity, schedule and location, uploads a selfie, and stores the resulting record. Administrators manage employees, attendance policy and holidays, and review attendance summaries. The README is only a Vite template and documents no product capabilities. The face-verification service is present, but the sampled routes do not show it being invoked, so its connection is left unverified.

Main entry points: [`server/src/routes/attendance.routes.js`](https://github.com/thenewlong/geoattend/blob/main/server/src/routes/attendance.routes.js) (Attendance routes), [`src/App.jsx`](https://github.com/thenewlong/geoattend/blob/main/src/App.jsx) (App session routing), [`src/api/client.js`](https://github.com/thenewlong/geoattend/blob/main/src/api/client.js) (API client), [`server/src/app.js`](https://github.com/thenewlong/geoattend/blob/main/server/src/app.js) (HTTP API routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_app["App session routing<br/>[App.jsx]"]
  node_landing["Landing page<br/>[LandingPage.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_employee_app["Employee app"]
  node_attendance_view["Attendance view<br/>[Attendance.jsx]"]
  node_admin_dashboard["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_api_client["API client<br/>[client.js]"]
end

subgraph group_api["API services"]
  node_express_app["HTTP API routing<br/>[app.js]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.js]"]
  node_attendance_routes["Attendance routes"]
  node_admin_routes["Admin routes<br/>[admin.routes.js]"]
  node_auth_middleware["Token authorization<br/>[auth.js]"]
end

subgraph group_domain["Attendance domain"]
  node_geo_service["Geo and time checks<br/>[geo.service.js]"]
  node_face_verification["Face verification"]
  node_imgbb_service["Selfie upload<br/>[imgbb.service.js]"]
end

subgraph group_state["Persistent state"]
  node_postgres[("PostgreSQL<br/>[db.js]")]
end

node_employee(("Employee"))
node_administrator(("Administrator"))
node_imgbb["ImgBB"]

node_employee -->|"opens"| node_app
node_administrator -->|"opens"| node_app
node_app -->|"shows"| node_landing
node_app -->|"shows"| node_login
node_app -->|"shows"| node_employee_app
node_app -->|"shows"| node_admin_dashboard
node_login -->|"requests"| node_api_client
node_employee_app -->|"requests"| node_api_client
node_employee_app -->|"renders"| node_attendance_view
node_attendance_view -->|"requests"| node_api_client
node_admin_dashboard -->|"requests"| node_api_client
node_api_client -.->|"sends HTTP requests"| node_express_app
node_express_app -->|"mounts"| node_auth_routes
node_express_app -->|"mounts"| node_attendance_routes
node_express_app -->|"mounts"| node_admin_routes
node_auth_routes -->|"protects session check"| node_auth_middleware
node_attendance_routes -->|"protects routes"| node_auth_middleware
node_admin_routes -->|"requires admin"| node_auth_middleware
node_auth_routes -->|"queries employees"| node_postgres
node_attendance_routes -->|"reads and writes"| node_postgres
node_admin_routes -->|"manages records"| node_postgres
node_attendance_routes -->|"checks location and time"| node_geo_service
node_attendance_routes -->|"uploads selfie"| node_imgbb_service
node_imgbb_service -->|"uploads image"| node_imgbb
node_attendance_routes -.->|"verification use unknown"| node_face_verification

click node_app "https://github.com/thenewlong/geoattend/blob/main/src/App.jsx"
click node_landing "https://github.com/thenewlong/geoattend/blob/main/src/components/LandingPage.jsx"
click node_login "https://github.com/thenewlong/geoattend/blob/main/src/components/Login.jsx"
click node_employee_app "https://github.com/thenewlong/geoattend/blob/main/src/components/EmployeeMobileApp.jsx"
click node_attendance_view "https://github.com/thenewlong/geoattend/blob/main/src/components/Attendance.jsx"
click node_admin_dashboard "https://github.com/thenewlong/geoattend/blob/main/src/components/AdminDashboard.jsx"
click node_api_client "https://github.com/thenewlong/geoattend/blob/main/src/api/client.js"
click node_express_app "https://github.com/thenewlong/geoattend/blob/main/server/src/app.js"
click node_auth_routes "https://github.com/thenewlong/geoattend/blob/main/server/src/routes/auth.routes.js"
click node_attendance_routes "https://github.com/thenewlong/geoattend/blob/main/server/src/routes/attendance.routes.js"
click node_admin_routes "https://github.com/thenewlong/geoattend/blob/main/server/src/routes/admin.routes.js"
click node_auth_middleware "https://github.com/thenewlong/geoattend/blob/main/server/src/middleware/auth.js"
click node_geo_service "https://github.com/thenewlong/geoattend/blob/main/server/src/services/geo.service.js"
click node_face_verification "https://github.com/thenewlong/geoattend/blob/main/server/src/services/faceVerification.js"
click node_imgbb_service "https://github.com/thenewlong/geoattend/blob/main/server/src/services/imgbb.service.js"
click node_postgres "https://github.com/thenewlong/geoattend/blob/main/server/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_app,node_landing,node_login,node_employee_app,node_attendance_view,node_admin_dashboard,node_api_client toneBlue
class node_express_app,node_auth_routes,node_attendance_routes,node_admin_routes,node_auth_middleware toneAmber
class node_geo_service,node_face_verification,node_imgbb_service toneMint
class node_postgres toneRose
class node_employee,node_administrator,node_imgbb toneIndigo
```

## Components

### Web app

- [App session routing](https://github.com/thenewlong/geoattend/blob/main/src/App.jsx): `src/App.jsx`
- [Landing page](https://github.com/thenewlong/geoattend/blob/main/src/components/LandingPage.jsx): `src/components/LandingPage.jsx`
- [Login](https://github.com/thenewlong/geoattend/blob/main/src/components/Login.jsx): `src/components/Login.jsx`
- [Employee app](https://github.com/thenewlong/geoattend/blob/main/src/components/EmployeeMobileApp.jsx): `src/components/EmployeeMobileApp.jsx`
- [Attendance view](https://github.com/thenewlong/geoattend/blob/main/src/components/Attendance.jsx): `src/components/Attendance.jsx`
- [Admin dashboard](https://github.com/thenewlong/geoattend/blob/main/src/components/AdminDashboard.jsx): `src/components/AdminDashboard.jsx`
- [API client](https://github.com/thenewlong/geoattend/blob/main/src/api/client.js): `src/api/client.js`

### API services

- [HTTP API routing](https://github.com/thenewlong/geoattend/blob/main/server/src/app.js): `server/src/app.js`
- [Authentication routes](https://github.com/thenewlong/geoattend/blob/main/server/src/routes/auth.routes.js): `server/src/routes/auth.routes.js`
- [Attendance routes](https://github.com/thenewlong/geoattend/blob/main/server/src/routes/attendance.routes.js): `server/src/routes/attendance.routes.js`
- [Admin routes](https://github.com/thenewlong/geoattend/blob/main/server/src/routes/admin.routes.js): `server/src/routes/admin.routes.js`
- [Token authorization](https://github.com/thenewlong/geoattend/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`

### Attendance domain

- [Geo and time checks](https://github.com/thenewlong/geoattend/blob/main/server/src/services/geo.service.js): `server/src/services/geo.service.js`
- [Face verification](https://github.com/thenewlong/geoattend/blob/main/server/src/services/faceVerification.js): `server/src/services/faceVerification.js`
- [Selfie upload](https://github.com/thenewlong/geoattend/blob/main/server/src/services/imgbb.service.js): `server/src/services/imgbb.service.js`

### Persistent state

- [PostgreSQL](https://github.com/thenewlong/geoattend/blob/main/server/src/config/db.js): `server/src/config/db.js`

### Other components

- **Employee**
- **Administrator**
- **ImgBB**

## Connections

- Employee → App session routing: opens (evidence: `src/App.jsx`)
- Administrator → App session routing: opens (evidence: `src/App.jsx`)
- App session routing → Landing page: shows (evidence: `src/App.jsx`)
- App session routing → Login: shows (evidence: `src/App.jsx`)
- App session routing → Employee app: shows (evidence: `src/App.jsx`)
- App session routing → Admin dashboard: shows (evidence: `src/App.jsx`)
- Login → API client: requests (evidence: `src/components/Login.jsx`)
- Employee app → API client: requests (evidence: `src/components/EmployeeMobileApp.jsx`)
- Employee app → Attendance view: renders (evidence: `src/components/EmployeeMobileApp.jsx`)
- Attendance view → API client: requests (evidence: `src/components/Attendance.jsx`)
- Admin dashboard → API client: requests (evidence: `src/components/AdminDashboard.jsx`)
- API client → HTTP API routing: sends HTTP requests
- HTTP API routing → Authentication routes: mounts (evidence: `server/src/app.js`)
- HTTP API routing → Attendance routes: mounts (evidence: `server/src/app.js`)
- HTTP API routing → Admin routes: mounts (evidence: `server/src/app.js`)
- Authentication routes → Token authorization: protects session check (evidence: `server/src/routes/auth.routes.js`)
- Attendance routes → Token authorization: protects routes (evidence: `server/src/routes/attendance.routes.js`)
- Admin routes → Token authorization: requires admin (evidence: `server/src/routes/admin.routes.js`)
- Authentication routes → PostgreSQL: queries employees (evidence: `server/src/routes/auth.routes.js`)
- Attendance routes → PostgreSQL: reads and writes (evidence: `server/src/routes/attendance.routes.js`)
- Admin routes → PostgreSQL: manages records (evidence: `server/src/routes/admin.routes.js`)
- Attendance routes → Geo and time checks: checks location and time (evidence: `server/src/routes/attendance.routes.js`)
- Attendance routes → Selfie upload: uploads selfie (evidence: `server/src/routes/attendance.routes.js`)
- Selfie upload → ImgBB: uploads image (evidence: `server/src/services/imgbb.service.js`)
- Attendance routes → Face verification: verification use unknown
