# ebk1996/graphql_react_event_booking_2 architecture

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

- Interactive diagram: https://gitdiagram.com/ebk1996/graphql_react_event_booking_2
- Repository: https://github.com/ebk1996/graphql_react_event_booking_2

## Overview

This is a Node.js Express server exposing a GraphQL event-booking API backed by MongoDB. Clients send GraphQL requests to `/graphql`; the server applies the schema and dispatches operations to resolvers, which query or mutate event, user, and booking records. The API includes event and booking queries, event creation, user creation, booking, and cancellation. The resolver also hashes passwords and resolves linked records. The README documents GraphiQL; source excerpts show it enabled in the HTTP middleware. Edges reflect shown calls or documented behavior; underlying Mongoose-to-database operations are not separately mapped.

Main entry points: [`app.js`](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/app.js) (Express Server), [`graphql/resolvers/index.js`](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/graphql/resolvers/index.js) (Operation Resolvers), [`graphql/schema/index.js`](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/graphql/schema/index.js) (GraphQL Schema), [`models/event.js`](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/models/event.js) (Event Records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["GraphQL API"]
  node_server["Express Server<br/>[app.js]"]
  node_schema["GraphQL Schema<br/>[index.js]"]
end

subgraph group_operations["Booking Operations"]
  node_resolvers["Operation Resolvers<br/>[index.js]"]
end

subgraph group_persistence["Persistence"]
  node_events[("Event Records<br/>[event.js]")]
  node_users[("User Records<br/>[user.js]")]
  node_bookings[("Booking Records<br/>[booking.js]")]
end

node_client(("API Client"))
node_mongo[("MongoDB Atlas")]

node_client -->|"sends GraphQL"| node_server
node_server -->|"configures schema"| node_schema
node_server -->|"dispatches operations"| node_resolvers
node_server -->|"connects to"| node_mongo
node_resolvers -->|"queries and saves"| node_events
node_resolvers -->|"queries and saves"| node_users
node_resolvers -->|"queries and saves"| node_bookings

click node_server "https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/app.js"
click node_schema "https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/graphql/schema/index.js"
click node_resolvers "https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/graphql/resolvers/index.js"
click node_events "https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/models/event.js"
click node_users "https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/models/user.js"
click node_bookings "https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/models/booking.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_server,node_schema,node_client toneBlue
class node_resolvers,node_mongo toneAmber
class node_events,node_users,node_bookings toneMint
```

## Components

### GraphQL API

- [Express Server](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/app.js): `app.js`
- [GraphQL Schema](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/graphql/schema/index.js): `graphql/schema/index.js`

### Booking Operations

- [Operation Resolvers](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/graphql/resolvers/index.js): `graphql/resolvers/index.js`

### Persistence

- [Event Records](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/models/event.js): `models/event.js`
- [User Records](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/models/user.js): `models/user.js`
- [Booking Records](https://github.com/ebk1996/graphql_react_event_booking_2/blob/main/models/booking.js): `models/booking.js`

### Other components

- **API Client**
- **MongoDB Atlas**

## Connections

- API Client → Express Server: sends GraphQL (evidence: `README.md`)
- Express Server → GraphQL Schema: configures schema (evidence: `app.js`)
- Express Server → Operation Resolvers: dispatches operations (evidence: `app.js`)
- Express Server → MongoDB Atlas: connects to (evidence: `app.js`)
- Operation Resolvers → Event Records: queries and saves (evidence: `graphql/resolvers/index.js`)
- Operation Resolvers → User Records: queries and saves (evidence: `graphql/resolvers/index.js`)
- Operation Resolvers → Booking Records: queries and saves (evidence: `graphql/resolvers/index.js`)
