# ktkarthick006/spacesync architecture

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

- Interactive diagram: https://gitdiagram.com/ktkarthick006/spacesync
- Repository: https://github.com/ktkarthick006/spacesync

## Overview

SpaceSync is a full-stack venue booking system. Users authenticate, browse halls and a weekly availability grid, select a time slot, and submit a booking request; admins manage halls and approve, reject, or cancel requests. Booking status changes trigger email notifications. The graph reflects routes and component calls visible in excerpts plus README capabilities; AdminPanel and MyBookings behavior is represented from the SOURCE INDEX, so their links to API calls are documented at that level rather than inferred from unsampled code.

Main entry points: [`frontend/src/pages/GanttView.jsx`](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/pages/GanttView.jsx) (Venue schedule), [`frontend/src/api/axios.js`](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/api/axios.js) (HTTP client), [`backend/server.js`](https://github.com/ktkarthick006/spacesync/blob/main/backend/server.js) (Express API), [`backend/routes/bookings.js`](https://github.com/ktkarthick006/spacesync/blob/main/backend/routes/bookings.js) (Booking workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_ganttview["Venue schedule<br/>[GanttView.jsx]"]
  node_ganttchart["Gantt scheduler<br/>[GanttChart.jsx]"]
  node_bookingmodal["Booking form<br/>[BookingModal.jsx]"]
  node_authcontext["Session context<br/>[AuthContext.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_adminpanel["Admin panel<br/>[AdminPanel.jsx]"]
  node_mybookings["My bookings<br/>[MyBookings.jsx]"]
  node_api_client["HTTP client<br/>[axios.js]"]
end

subgraph group_api["API services"]
  node_server["Express API<br/>[server.js]"]
  node_authroutes["Authentication<br/>[auth.js]"]
  node_hallroutes["Hall catalog<br/>[halls.js]"]
  node_bookingroutes["Booking workflow<br/>[bookings.js]"]
  node_authmiddleware["Access control<br/>[auth.js]"]
end

subgraph group_domain["Booking domain"]
  node_users[("User accounts<br/>[User.js]")]
  node_halls[("Hall records<br/>[Hall.js]")]
  node_bookings[("Booking records<br/>[Booking.js]")]
end

subgraph group_infra["Persistence and notifications"]
  node_mailer["Email notifications<br/>[mailer.js]"]
end

node_visitor(("User or admin"))
node_mongodb[("MongoDB")]
node_google["Google OAuth"]
node_smtp["SMTP mail"]

node_visitor -->|"browses schedule"| node_ganttview
node_ganttview -->|"loads halls and week"| node_api_client
node_ganttview -->|"renders schedule"| node_ganttchart
node_ganttchart -->|"selects slot"| node_ganttview
node_ganttview -->|"opens form"| node_bookingmodal
node_ganttview -->|"submits booking"| node_api_client
node_visitor -->|"authenticates"| node_login
node_login -->|"uses session"| node_authcontext
node_authcontext -->|"checks session"| node_api_client
node_authcontext -->|"redirects for OAuth"| node_google
node_visitor -->|"administers bookings"| node_adminpanel
node_adminpanel -->|"calls API"| node_api_client
node_visitor -->|"tracks requests"| node_mybookings
node_mybookings -->|"calls API"| node_api_client
node_api_client -.->|"sends API requests"| node_server
node_server -->|"mounts auth routes"| node_authroutes
node_server -->|"mounts hall routes"| node_hallroutes
node_server -->|"mounts booking routes"| node_bookingroutes
node_authroutes -->|"reads and updates"| node_users
node_authroutes -->|"protects profile"| node_authmiddleware
node_hallroutes -->|"checks access"| node_authmiddleware
node_hallroutes -->|"reads and manages"| node_halls
node_bookingroutes -->|"checks permissions"| node_authmiddleware
node_authmiddleware -->|"loads account"| node_users
node_bookingroutes -->|"reads and changes"| node_bookings
node_bookingroutes -->|"sends status notices"| node_mailer
node_mailer -->|"sends email"| node_smtp
node_server -->|"connects before listening"| node_mongodb
node_google -->|"returns OAuth identity"| node_authroutes

click node_ganttview "https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/pages/GanttView.jsx"
click node_ganttchart "https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/components/GanttChart.jsx"
click node_bookingmodal "https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/components/BookingModal.jsx"
click node_authcontext "https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/context/AuthContext.jsx"
click node_login "https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/pages/Login.jsx"
click node_adminpanel "https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/pages/AdminPanel.jsx"
click node_mybookings "https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/pages/MyBookings.jsx"
click node_api_client "https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/api/axios.js"
click node_server "https://github.com/ktkarthick006/spacesync/blob/main/backend/server.js"
click node_authroutes "https://github.com/ktkarthick006/spacesync/blob/main/backend/routes/auth.js"
click node_hallroutes "https://github.com/ktkarthick006/spacesync/blob/main/backend/routes/halls.js"
click node_bookingroutes "https://github.com/ktkarthick006/spacesync/blob/main/backend/routes/bookings.js"
click node_authmiddleware "https://github.com/ktkarthick006/spacesync/blob/main/backend/middleware/auth.js"
click node_users "https://github.com/ktkarthick006/spacesync/blob/main/backend/models/User.js"
click node_halls "https://github.com/ktkarthick006/spacesync/blob/main/backend/models/Hall.js"
click node_bookings "https://github.com/ktkarthick006/spacesync/blob/main/backend/models/Booking.js"
click node_mailer "https://github.com/ktkarthick006/spacesync/blob/main/backend/utils/mailer.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_ganttview,node_ganttchart,node_bookingmodal,node_authcontext,node_login,node_adminpanel,node_mybookings,node_api_client,node_visitor toneBlue
class node_server,node_authroutes,node_hallroutes,node_bookingroutes,node_authmiddleware,node_mongodb toneAmber
class node_users,node_halls,node_bookings toneMint
class node_mailer toneRose
class node_google,node_smtp toneIndigo
```

## Components

### Web client

- [Venue schedule](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/pages/GanttView.jsx): `frontend/src/pages/GanttView.jsx`
- [Gantt scheduler](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/components/GanttChart.jsx): `frontend/src/components/GanttChart.jsx`
- [Booking form](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/components/BookingModal.jsx): `frontend/src/components/BookingModal.jsx`
- [Session context](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Login](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Admin panel](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/pages/AdminPanel.jsx): `frontend/src/pages/AdminPanel.jsx`
- [My bookings](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/pages/MyBookings.jsx): `frontend/src/pages/MyBookings.jsx`
- [HTTP client](https://github.com/ktkarthick006/spacesync/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`

### API services

- [Express API](https://github.com/ktkarthick006/spacesync/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/ktkarthick006/spacesync/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Hall catalog](https://github.com/ktkarthick006/spacesync/blob/main/backend/routes/halls.js): `backend/routes/halls.js`
- [Booking workflow](https://github.com/ktkarthick006/spacesync/blob/main/backend/routes/bookings.js): `backend/routes/bookings.js`
- [Access control](https://github.com/ktkarthick006/spacesync/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`

### Booking domain

- [User accounts](https://github.com/ktkarthick006/spacesync/blob/main/backend/models/User.js): `backend/models/User.js`
- [Hall records](https://github.com/ktkarthick006/spacesync/blob/main/backend/models/Hall.js): `backend/models/Hall.js`
- [Booking records](https://github.com/ktkarthick006/spacesync/blob/main/backend/models/Booking.js): `backend/models/Booking.js`

### Persistence and notifications

- [Email notifications](https://github.com/ktkarthick006/spacesync/blob/main/backend/utils/mailer.js): `backend/utils/mailer.js`

### Other components

- **User or admin**
- **MongoDB**
- **Google OAuth**
- **SMTP mail**

## Connections

- User or admin → Venue schedule: browses schedule (evidence: `README.md`)
- Venue schedule → HTTP client: loads halls and week (evidence: `frontend/src/pages/GanttView.jsx`)
- Venue schedule → Gantt scheduler: renders schedule (evidence: `frontend/src/pages/GanttView.jsx`)
- Gantt scheduler → Venue schedule: selects slot (evidence: `frontend/src/pages/GanttView.jsx`)
- Venue schedule → Booking form: opens form (evidence: `frontend/src/pages/GanttView.jsx`)
- Venue schedule → HTTP client: submits booking (evidence: `frontend/src/pages/GanttView.jsx`)
- User or admin → Login: authenticates (evidence: `README.md`)
- Login → Session context: uses session (evidence: `frontend/src/pages/Login.jsx`)
- Session context → HTTP client: checks session (evidence: `frontend/src/context/AuthContext.jsx`)
- Session context → Google OAuth: redirects for OAuth (evidence: `frontend/src/context/AuthContext.jsx`)
- User or admin → Admin panel: administers bookings (evidence: `README.md`)
- Admin panel → HTTP client: calls API (evidence: `frontend/src/pages/AdminPanel.jsx`)
- User or admin → My bookings: tracks requests (evidence: `README.md`)
- My bookings → HTTP client: calls API (evidence: `frontend/src/pages/MyBookings.jsx`)
- HTTP client → Express API: sends API requests
- Express API → Authentication: mounts auth routes (evidence: `backend/server.js`)
- Express API → Hall catalog: mounts hall routes (evidence: `backend/server.js`)
- Express API → Booking workflow: mounts booking routes (evidence: `backend/server.js`)
- Authentication → User accounts: reads and updates (evidence: `backend/routes/auth.js`)
- Authentication → Access control: protects profile (evidence: `backend/routes/auth.js`)
- Hall catalog → Access control: checks access (evidence: `backend/routes/halls.js`)
- Hall catalog → Hall records: reads and manages (evidence: `backend/routes/halls.js`)
- Booking workflow → Access control: checks permissions (evidence: `backend/routes/bookings.js`)
- Access control → User accounts: loads account (evidence: `backend/middleware/auth.js`)
- Booking workflow → Booking records: reads and changes (evidence: `backend/routes/bookings.js`)
- Booking workflow → Email notifications: sends status notices (evidence: `backend/routes/bookings.js`)
- Email notifications → SMTP mail: sends email (evidence: `backend/utils/mailer.js`)
- Express API → MongoDB: connects before listening (evidence: `backend/server.js`)
- Google OAuth → Authentication: returns OAuth identity (evidence: `backend/routes/auth.js`)
