# jetychodipilli/v2_brainserve_connect_gstack architecture

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

- Interactive diagram: https://gitdiagram.com/jetychodipilli/v2_brainserve_connect_gstack
- Repository: https://github.com/jetychodipilli/v2_brainserve_connect_gstack

## Overview

BrainServe Connect manages visitor appointments and physical access, alongside employee administration and operational records. The main journey runs from public booking and tracking through host decisions, reception check-in with badge allocation, security visibility, and reception checkout. The React frontend reaches the Spring controllers through its API client; backend application services coordinate domain work, persistence, audit, and transactional outbox events. The README documents additional dashboards, availability, compensation, identity and organization capabilities. Sampled service excerpts support several cross-domain calls; other documented subsystem wiring is not inferred.

Main entry points: [`backend/src/main/java/com/brainserve/appointment/appointment/application/AppointmentService.java`](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/appointment/application/AppointmentService.java) (Appointment workflow), [`backend/src/main/java/com/brainserve/appointment/reception/application/ReceptionService.java`](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/reception/application/ReceptionService.java) (Reception access), [`backend/src/main/java/com/brainserve/appointment/employee/application/EmployeeService.java`](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/employee/application/EmployeeService.java) (Employee service), [`frontend/src/api/client.ts`](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/api/client.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_app["Frontend routing<br/>[App.tsx]"]
  node_booking["Booking page<br/>[BookingPage.tsx]"]
  node_tracking["Tracking page<br/>[TrackPage.tsx]"]
  node_dashboard["Role dashboards<br/>[DashboardPage.tsx]"]
  node_api["API client<br/>[client.ts]"]
  node_authstate["Auth state<br/>[auth.tsx]"]
end

subgraph group_operations["Visits and operations"]
  node_appointment_api["Appointment API"]
  node_appointment_service["Appointment workflow"]
  node_appointment_store[("Appointment records")]
  node_visitor_service["Visitor records"]
  node_reception["Reception access"]
  node_access_store[("Access and badges")]
  node_availability["Availability"]
end

subgraph group_admin["Workforce administration"]
  node_employee["Employee service"]
  node_employee_api["Employee endpoints"]
  node_organization["Organization setup"]
  node_compensation["Compensation"]
end

subgraph group_platform["Identity and shared services"]
  node_iam["Authentication and roles"]
  node_auth_api["Auth endpoints"]
  node_audit["Audit logging<br/>[AuditService.java]"]
  node_audit_store[("Audit records")]
  node_outbox["Event outbox<br/>[OutboxService.java]"]
  node_outbox_store[("Outbox records")]
  node_reporting["Dashboards and emergency list"]
end

node_visitor(("Visitor"))
node_staff(("Host and staff"))
node_security(("Security"))

node_visitor -->|"uses"| node_app
node_app -->|"routes"| node_booking
node_app -->|"routes"| node_tracking
node_staff -->|"uses"| node_app
node_security -->|"views"| node_dashboard
node_booking -->|"submits booking"| node_api
node_tracking -->|"requests status"| node_api
node_dashboard -->|"requests operations"| node_api
node_api -->|"calls"| node_appointment_api
node_appointment_api -->|"dispatches"| node_appointment_service
node_appointment_service -->|"reads and writes"| node_appointment_store
node_appointment_service -->|"registers visitor"| node_visitor_service
node_appointment_service -->|"checks host"| node_employee
node_appointment_service -->|"records decisions"| node_audit
node_appointment_service -->|"publishes events"| node_outbox
node_appointment_service -->|"checks slot"| node_availability
node_availability -->|"checks bookings"| node_appointment_store
node_staff -->|"checks in and out"| node_reception
node_reception -->|"validates access"| node_appointment_service
node_reception -->|"verifies visitor"| node_visitor_service
node_reception -->|"looks up host"| node_employee
node_reception -->|"allocates badge and records visit"| node_access_store
node_reception -->|"records transitions"| node_audit
node_reception -->|"publishes events"| node_outbox
node_employee_api -->|"dispatches"| node_employee
node_employee -->|"validates assignment"| node_organization
node_employee -->|"records changes"| node_audit
node_employee -->|"publishes events"| node_outbox
node_staff -->|"manages slots"| node_availability
node_staff -->|"manages structure"| node_organization
node_staff -->|"manages compensation"| node_compensation
node_api -->|"calls"| node_auth_api
node_auth_api -->|"dispatches"| node_iam
node_authstate -->|"uses session API"| node_api
node_iam -->|"records security actions"| node_audit
node_compensation -->|"validates employee"| node_employee
node_compensation -->|"records access and decisions"| node_audit
node_compensation -->|"publishes events"| node_outbox
node_audit -->|"persists"| node_audit_store
node_outbox -->|"persists events"| node_outbox_store
node_dashboard -->|"requests dashboards"| node_reporting
node_reporting -.->|"reads access records"| node_access_store

click node_app "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/App.tsx"
click node_booking "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/pages/BookingPage.tsx"
click node_tracking "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/pages/TrackPage.tsx"
click node_dashboard "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_api "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/api/client.ts"
click node_authstate "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/state/auth.tsx"
click node_appointment_api "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/appointment/api/AppointmentController.java"
click node_appointment_service "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/appointment/application/AppointmentService.java"
click node_appointment_store "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/appointment/infrastructure/AppointmentRepository.java"
click node_visitor_service "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/visitor/application/VisitorService.java"
click node_reception "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/reception/application/ReceptionService.java"
click node_access_store "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/tree/main/backend/src/main/java/com/brainserve/appointment/reception/infrastructure"
click node_availability "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/availability/application/AvailabilityService.java"
click node_employee "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/employee/application/EmployeeService.java"
click node_employee_api "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/tree/main/backend/src/main/java/com/brainserve/appointment/employee/api"
click node_organization "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/organization/application/OrganizationService.java"
click node_compensation "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/compensation/application/CompensationService.java"
click node_iam "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/tree/main/backend/src/main/java/com/brainserve/appointment/iam/application"
click node_auth_api "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/iam/api/AuthController.java"
click node_audit "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/shared/audit/AuditService.java"
click node_audit_store "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/shared/audit/AuditRepository.java"
click node_outbox "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/notification/application/OutboxService.java"
click node_outbox_store "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/notification/infrastructure/OutboxRepository.java"
click node_reporting "https://github.com/jetychodipilli/v2_brainserve_connect_gstack/tree/main/backend/src/main/java/com/brainserve/appointment/reporting/api"

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_booking,node_tracking,node_dashboard,node_api,node_authstate toneBlue
class node_appointment_api,node_appointment_service,node_appointment_store,node_visitor_service,node_reception,node_access_store,node_availability toneAmber
class node_employee,node_employee_api,node_organization,node_compensation toneMint
class node_iam,node_auth_api,node_audit,node_audit_store,node_outbox,node_outbox_store,node_reporting toneRose
class node_visitor,node_staff,node_security toneIndigo
```

## Components

### Public experience

- [Frontend routing](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Booking page](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/pages/BookingPage.tsx): `frontend/src/pages/BookingPage.tsx`
- [Tracking page](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/pages/TrackPage.tsx): `frontend/src/pages/TrackPage.tsx`
- [Role dashboards](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [API client](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Auth state](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/frontend/src/state/auth.tsx): `frontend/src/state/auth.tsx`

### Visits and operations

- [Appointment API](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/appointment/api/AppointmentController.java): `backend/src/main/java/com/brainserve/appointment/appointment/api/AppointmentController.java`
- [Appointment workflow](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/appointment/application/AppointmentService.java): `backend/src/main/java/com/brainserve/appointment/appointment/application/AppointmentService.java`
- [Appointment records](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/appointment/infrastructure/AppointmentRepository.java): `backend/src/main/java/com/brainserve/appointment/appointment/infrastructure/AppointmentRepository.java`
- [Visitor records](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/visitor/application/VisitorService.java): `backend/src/main/java/com/brainserve/appointment/visitor/application/VisitorService.java`
- [Reception access](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/reception/application/ReceptionService.java): `backend/src/main/java/com/brainserve/appointment/reception/application/ReceptionService.java`
- [Access and badges](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/tree/main/backend/src/main/java/com/brainserve/appointment/reception/infrastructure): `backend/src/main/java/com/brainserve/appointment/reception/infrastructure`
- [Availability](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/availability/application/AvailabilityService.java): `backend/src/main/java/com/brainserve/appointment/availability/application/AvailabilityService.java`

### Workforce administration

- [Employee service](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/employee/application/EmployeeService.java): `backend/src/main/java/com/brainserve/appointment/employee/application/EmployeeService.java`
- [Employee endpoints](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/tree/main/backend/src/main/java/com/brainserve/appointment/employee/api): `backend/src/main/java/com/brainserve/appointment/employee/api`
- [Organization setup](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/organization/application/OrganizationService.java): `backend/src/main/java/com/brainserve/appointment/organization/application/OrganizationService.java`
- [Compensation](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/compensation/application/CompensationService.java): `backend/src/main/java/com/brainserve/appointment/compensation/application/CompensationService.java`

### Identity and shared services

- [Authentication and roles](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/tree/main/backend/src/main/java/com/brainserve/appointment/iam/application): `backend/src/main/java/com/brainserve/appointment/iam/application`
- [Auth endpoints](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/iam/api/AuthController.java): `backend/src/main/java/com/brainserve/appointment/iam/api/AuthController.java`
- [Audit logging](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/shared/audit/AuditService.java): `backend/src/main/java/com/brainserve/appointment/shared/audit/AuditService.java`
- [Audit records](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/shared/audit/AuditRepository.java): `backend/src/main/java/com/brainserve/appointment/shared/audit/AuditRepository.java`
- [Event outbox](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/notification/application/OutboxService.java): `backend/src/main/java/com/brainserve/appointment/notification/application/OutboxService.java`
- [Outbox records](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/blob/main/backend/src/main/java/com/brainserve/appointment/notification/infrastructure/OutboxRepository.java): `backend/src/main/java/com/brainserve/appointment/notification/infrastructure/OutboxRepository.java`
- [Dashboards and emergency list](https://github.com/jetychodipilli/v2_brainserve_connect_gstack/tree/main/backend/src/main/java/com/brainserve/appointment/reporting/api): `backend/src/main/java/com/brainserve/appointment/reporting/api`

### Other components

- **Visitor**
- **Host and staff**
- **Security**

## Connections

- Visitor → Frontend routing: uses
- Frontend routing → Booking page: routes
- Frontend routing → Tracking page: routes
- Host and staff → Frontend routing: uses
- Security → Role dashboards: views
- Booking page → API client: submits booking
- Tracking page → API client: requests status
- Role dashboards → API client: requests operations
- API client → Appointment API: calls
- Appointment API → Appointment workflow: dispatches
- Appointment workflow → Appointment records: reads and writes
- Appointment workflow → Visitor records: registers visitor
- Appointment workflow → Employee service: checks host
- Appointment workflow → Audit logging: records decisions
- Appointment workflow → Event outbox: publishes events
- Appointment workflow → Availability: checks slot
- Availability → Appointment records: checks bookings
- Host and staff → Reception access: checks in and out
- Reception access → Appointment workflow: validates access
- Reception access → Visitor records: verifies visitor
- Reception access → Employee service: looks up host
- Reception access → Access and badges: allocates badge and records visit
- Reception access → Audit logging: records transitions
- Reception access → Event outbox: publishes events
- Employee endpoints → Employee service: dispatches
- Employee service → Organization setup: validates assignment
- Employee service → Audit logging: records changes
- Employee service → Event outbox: publishes events
- Host and staff → Availability: manages slots
- Host and staff → Organization setup: manages structure
- Host and staff → Compensation: manages compensation
- API client → Auth endpoints: calls
- Auth endpoints → Authentication and roles: dispatches
- Auth state → API client: uses session API
- Authentication and roles → Audit logging: records security actions
- Compensation → Employee service: validates employee
- Compensation → Audit logging: records access and decisions
- Compensation → Event outbox: publishes events
- Audit logging → Audit records: persists
- Event outbox → Outbox records: persists events
- Role dashboards → Dashboards and emergency list: requests dashboards
- Dashboards and emergency list → Access and badges: reads access records
