# andrej-a/wedding_invitation_backend architecture

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

- Interactive diagram: https://gitdiagram.com/andrej-a/wedding_invitation_backend
- Repository: https://github.com/andrej-a/wedding_invitation_backend

## Overview

This is a small Express/Mongoose backend for managing wedding events and guests. Clients send HTTP requests to the server, which mounts separate event and guest routes; each route dispatches to its controller, which performs CRUD operations through a Mongoose model and returns JSON responses. The server connects to MongoDB before listening, and uses configuration for the database URL and port. Request and connection activity is logged. The README gives no further product detail; the source establishes the workflows shown here.

Main entry points: [`src/server.ts`](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/server.ts) (Express server), [`src/routes/Events.ts`](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/routes/Events.ts) (Event routes), [`src/routes/Guests.ts`](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/routes/Guests.ts) (Guest routes), [`src/controllers/Events.ts`](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/controllers/Events.ts) (Event controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_server["Express server<br/>[server.ts]"]
  node_event_routes["Event routes<br/>[Events.ts]"]
  node_guest_routes["Guest routes<br/>[Guests.ts]"]
end

subgraph group_domain["Wedding data"]
  node_event_controller["Event controller<br/>[Events.ts]"]
  node_guest_controller["Guest controller<br/>[Guests.ts]"]
  node_event_model["Event model<br/>[Events.ts]"]
  node_guest_model["Guest model<br/>[Guests.ts]"]
end

subgraph group_runtime["Runtime support"]
  node_config["Configuration<br/>[config.ts]"]
  node_logger["Logger<br/>[Logger.ts]"]
end

node_client(("API client"))
node_mongodb[("MongoDB")]

node_client -->|"sends HTTP"| node_server
node_server -->|"reads settings"| node_config
node_server -->|"connects to"| node_mongodb
node_server -->|"logs requests"| node_logger
node_server -->|"mounts /events"| node_event_routes
node_server -->|"mounts /guests"| node_guest_routes
node_event_routes -->|"dispatches"| node_event_controller
node_guest_routes -->|"dispatches"| node_guest_controller
node_event_controller -->|"CRUD operations"| node_event_model
node_guest_controller -->|"CRUD operations"| node_guest_model
node_event_model -->|"persists events"| node_mongodb
node_guest_model -->|"persists guests"| node_mongodb

click node_server "https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/server.ts"
click node_event_routes "https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/routes/Events.ts"
click node_guest_routes "https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/routes/Guests.ts"
click node_event_controller "https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/controllers/Events.ts"
click node_guest_controller "https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/controllers/Guests.ts"
click node_event_model "https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/models/Events.ts"
click node_guest_model "https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/models/Guests.ts"
click node_config "https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/config/config.ts"
click node_logger "https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/library/Logger.ts"

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_event_routes,node_guest_routes,node_client toneBlue
class node_event_controller,node_guest_controller,node_event_model,node_guest_model,node_mongodb toneAmber
class node_config,node_logger toneMint
```

## Components

### HTTP API

- [Express server](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/server.ts): `src/server.ts`
- [Event routes](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/routes/Events.ts): `src/routes/Events.ts`
- [Guest routes](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/routes/Guests.ts): `src/routes/Guests.ts`

### Wedding data

- [Event controller](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/controllers/Events.ts): `src/controllers/Events.ts`
- [Guest controller](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/controllers/Guests.ts): `src/controllers/Guests.ts`
- [Event model](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/models/Events.ts): `src/models/Events.ts`
- [Guest model](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/models/Guests.ts): `src/models/Guests.ts`

### Runtime support

- [Configuration](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/config/config.ts): `src/config/config.ts`
- [Logger](https://github.com/andrej-a/wedding_invitation_backend/blob/main/src/library/Logger.ts): `src/library/Logger.ts`

### Other components

- **API client**
- **MongoDB**

## Connections

- API client → Express server: sends HTTP
- Express server → Configuration: reads settings
- Express server → MongoDB: connects to
- Express server → Logger: logs requests
- Express server → Event routes: mounts /events
- Express server → Guest routes: mounts /guests
- Event routes → Event controller: dispatches
- Guest routes → Guest controller: dispatches
- Event controller → Event model: CRUD operations
- Guest controller → Guest model: CRUD operations
- Event model → MongoDB: persists events
- Guest model → MongoDB: persists guests
