# setemad-tech/outly-backend architecture

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

- Interactive diagram: https://gitdiagram.com/setemad-tech/outly-backend
- Repository: https://github.com/setemad-tech/outly-backend

## Overview

OUTLY is a Django event-ticketing platform. Attendees discover events, create bookings, and pay through Stripe; organizers publish events, while staff manage the marketplace and review analytics. The domain also includes account verification, ticket pricing and promotions, loyalty rewards, QR check-in, and event chat. The graph reflects relationships visible in sampled excerpts or the SOURCE INDEX; the README is empty, and several product areas are represented from the file tree without asserted call relationships.

Main entry points: [`bookings/services.py`](https://github.com/setemad-tech/outly-backend/blob/main/bookings/services.py) (Booking service), [`payments/services.py`](https://github.com/setemad-tech/outly-backend/blob/main/payments/services.py) (Stripe payments), [`bookings/models.py`](https://github.com/setemad-tech/outly-backend/blob/main/bookings/models.py) (Booking records), [`bookings/quote.py`](https://github.com/setemad-tech/outly-backend/blob/main/bookings/quote.py) (Quote builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and accounts"]
  node_account_api["Account API<br/>[views.py]"]
  node_account_model[("Identity records<br/>[models.py]")]
  node_otp["Email verification<br/>[otp.py]"]
end

subgraph group_events["Events and pricing"]
  node_event_api["Event API<br/>[views.py]"]
  node_event_model[("Event catalog<br/>[models.py]")]
  node_pricing["Ticket pricing<br/>[pricing.py]"]
end

subgraph group_commerce["Booking and payments"]
  node_booking_api["Booking API<br/>[views.py]"]
  node_quote["Quote builder<br/>[quote.py]"]
  node_booking_service["Booking service<br/>[services.py]"]
  node_booking_records[("Booking records<br/>[models.py]")]
  node_ticket_email["Ticket email<br/>[emails.py]"]
  node_qr_ticket["QR tickets<br/>[qr.py]"]
  node_payment_api["Payment API<br/>[views.py]"]
  node_payment_service["Stripe payments<br/>[services.py]"]
end

subgraph group_engagement["Rewards and chat"]
  node_promo_service["Promo validation<br/>[services.py]"]
  node_promo_records[("Promo codes<br/>[models.py]")]
  node_loyalty_levels["Loyalty levels<br/>[levels.py]"]
  node_loyalty_service["Loyalty ledger<br/>[services.py]"]
  node_loyalty_records[("Loyalty entries<br/>[models.py]")]
  node_chat_api["Chat API<br/>[views.py]"]
  node_chat_routing["Chat routing<br/>[routing.py]"]
  node_chat_consumer["Chat consumer<br/>[consumers.py]"]
  node_chat_records[("Chat records<br/>[models.py]")]
  node_chat_signals["Chat signals<br/>[signals.py]"]
  node_chat_app["Chat app registration<br/>[apps.py]"]
end

subgraph group_operations["Staff operations"]
  node_admin_api["Staff API<br/>[views.py]"]
  node_analytics["Analytics<br/>[analytics.py]"]
  node_admin_serializers["Staff serializers<br/>[serializers.py]"]
  node_admin_records[("Staff action records<br/>[models.py]")]
end

node_attendee(("Attendee"))
node_organizer(("Organizer"))
node_staff(("Staff"))
node_stripe["Stripe"]

node_attendee -.->|"manages account"| node_account_api
node_account_api -->|"reads and writes"| node_account_model
node_account_api -->|"uses verification"| node_otp
node_organizer -.->|"manages events"| node_event_api
node_event_api -.->|"serves events"| node_event_model
node_attendee -.->|"books tickets"| node_booking_api
node_booking_api -.->|"creates bookings"| node_booking_service
node_booking_service -->|"locks event"| node_event_model
node_booking_service -->|"builds quote"| node_quote
node_booking_service -->|"creates booking"| node_booking_records
node_quote -->|"uses calculations"| node_pricing
node_quote -->|"checks promo"| node_promo_service
node_quote -->|"checks level"| node_loyalty_levels
node_promo_service -->|"validates code"| node_promo_records
node_promo_service -->|"checks event"| node_event_model
node_promo_service -->|"checks eligibility"| node_loyalty_levels
node_payment_api -->|"handles payment"| node_payment_service
node_payment_api -->|"starts checkout"| node_booking_service
node_payment_service -->|"creates sessions"| node_stripe
node_payment_service -->|"confirms booking"| node_booking_records
node_payment_service -->|"sends ticket"| node_ticket_email
node_payment_service -.->|"awards points"| node_loyalty_service
node_booking_service -->|"redeems points"| node_loyalty_service
node_loyalty_service -->|"writes entries"| node_loyalty_records
node_loyalty_levels -->|"counts attendance"| node_booking_records
node_loyalty_levels -->|"uses point rate"| node_pricing
node_booking_records -.->|"ticket identity"| node_qr_ticket
node_attendee -.->|"uses chat"| node_chat_api
node_chat_routing -->|"routes sockets"| node_chat_consumer
node_chat_consumer -->|"uses messages"| node_chat_records
node_chat_app -->|"registers signals"| node_chat_signals
node_staff -.->|"manages platform"| node_admin_api
node_admin_api -->|"requests overview"| node_analytics
node_admin_api -->|"formats responses"| node_admin_serializers
node_analytics -->|"aggregates sales"| node_booking_records
node_analytics -->|"aggregates events"| node_event_model
node_analytics -->|"aggregates users"| node_account_model
node_admin_api -.->|"records actions"| node_admin_records

click node_account_api "https://github.com/setemad-tech/outly-backend/blob/main/accounts/views.py"
click node_account_model "https://github.com/setemad-tech/outly-backend/blob/main/accounts/models.py"
click node_otp "https://github.com/setemad-tech/outly-backend/blob/main/accounts/otp.py"
click node_event_api "https://github.com/setemad-tech/outly-backend/blob/main/events/views.py"
click node_event_model "https://github.com/setemad-tech/outly-backend/blob/main/events/models.py"
click node_pricing "https://github.com/setemad-tech/outly-backend/blob/main/events/pricing.py"
click node_booking_api "https://github.com/setemad-tech/outly-backend/blob/main/bookings/views.py"
click node_quote "https://github.com/setemad-tech/outly-backend/blob/main/bookings/quote.py"
click node_booking_service "https://github.com/setemad-tech/outly-backend/blob/main/bookings/services.py"
click node_booking_records "https://github.com/setemad-tech/outly-backend/blob/main/bookings/models.py"
click node_ticket_email "https://github.com/setemad-tech/outly-backend/blob/main/bookings/emails.py"
click node_qr_ticket "https://github.com/setemad-tech/outly-backend/blob/main/bookings/qr.py"
click node_payment_api "https://github.com/setemad-tech/outly-backend/blob/main/payments/views.py"
click node_payment_service "https://github.com/setemad-tech/outly-backend/blob/main/payments/services.py"
click node_promo_service "https://github.com/setemad-tech/outly-backend/blob/main/promos/services.py"
click node_promo_records "https://github.com/setemad-tech/outly-backend/blob/main/promos/models.py"
click node_loyalty_levels "https://github.com/setemad-tech/outly-backend/blob/main/loyalty/levels.py"
click node_loyalty_service "https://github.com/setemad-tech/outly-backend/blob/main/loyalty/services.py"
click node_loyalty_records "https://github.com/setemad-tech/outly-backend/blob/main/loyalty/models.py"
click node_chat_api "https://github.com/setemad-tech/outly-backend/blob/main/chat/views.py"
click node_chat_routing "https://github.com/setemad-tech/outly-backend/blob/main/chat/routing.py"
click node_chat_consumer "https://github.com/setemad-tech/outly-backend/blob/main/chat/consumers.py"
click node_chat_records "https://github.com/setemad-tech/outly-backend/blob/main/chat/models.py"
click node_chat_signals "https://github.com/setemad-tech/outly-backend/blob/main/chat/signals.py"
click node_chat_app "https://github.com/setemad-tech/outly-backend/blob/main/chat/apps.py"
click node_admin_api "https://github.com/setemad-tech/outly-backend/blob/main/backoffice/views.py"
click node_analytics "https://github.com/setemad-tech/outly-backend/blob/main/backoffice/analytics.py"
click node_admin_serializers "https://github.com/setemad-tech/outly-backend/blob/main/backoffice/serializers.py"
click node_admin_records "https://github.com/setemad-tech/outly-backend/blob/main/backoffice/models.py"

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_account_api,node_account_model,node_otp toneBlue
class node_event_api,node_event_model,node_pricing toneAmber
class node_booking_api,node_quote,node_booking_service,node_booking_records,node_ticket_email,node_qr_ticket,node_payment_api,node_payment_service toneMint
class node_promo_service,node_promo_records,node_loyalty_levels,node_loyalty_service,node_loyalty_records,node_chat_api,node_chat_routing,node_chat_consumer,node_chat_records,node_chat_signals,node_chat_app toneRose
class node_admin_api,node_analytics,node_admin_serializers,node_admin_records,node_attendee,node_organizer,node_staff,node_stripe toneIndigo
```

## Components

### Identity and accounts

- [Account API](https://github.com/setemad-tech/outly-backend/blob/main/accounts/views.py): `accounts/views.py`
- [Identity records](https://github.com/setemad-tech/outly-backend/blob/main/accounts/models.py): `accounts/models.py`
- [Email verification](https://github.com/setemad-tech/outly-backend/blob/main/accounts/otp.py): `accounts/otp.py`

### Events and pricing

- [Event API](https://github.com/setemad-tech/outly-backend/blob/main/events/views.py): `events/views.py`
- [Event catalog](https://github.com/setemad-tech/outly-backend/blob/main/events/models.py): `events/models.py`
- [Ticket pricing](https://github.com/setemad-tech/outly-backend/blob/main/events/pricing.py): `events/pricing.py`

### Booking and payments

- [Booking API](https://github.com/setemad-tech/outly-backend/blob/main/bookings/views.py): `bookings/views.py`
- [Quote builder](https://github.com/setemad-tech/outly-backend/blob/main/bookings/quote.py): `bookings/quote.py`
- [Booking service](https://github.com/setemad-tech/outly-backend/blob/main/bookings/services.py): `bookings/services.py`
- [Booking records](https://github.com/setemad-tech/outly-backend/blob/main/bookings/models.py): `bookings/models.py`
- [Ticket email](https://github.com/setemad-tech/outly-backend/blob/main/bookings/emails.py): `bookings/emails.py`
- [QR tickets](https://github.com/setemad-tech/outly-backend/blob/main/bookings/qr.py): `bookings/qr.py`
- [Payment API](https://github.com/setemad-tech/outly-backend/blob/main/payments/views.py): `payments/views.py`
- [Stripe payments](https://github.com/setemad-tech/outly-backend/blob/main/payments/services.py): `payments/services.py`

### Rewards and chat

- [Promo validation](https://github.com/setemad-tech/outly-backend/blob/main/promos/services.py): `promos/services.py`
- [Promo codes](https://github.com/setemad-tech/outly-backend/blob/main/promos/models.py): `promos/models.py`
- [Loyalty levels](https://github.com/setemad-tech/outly-backend/blob/main/loyalty/levels.py): `loyalty/levels.py`
- [Loyalty ledger](https://github.com/setemad-tech/outly-backend/blob/main/loyalty/services.py): `loyalty/services.py`
- [Loyalty entries](https://github.com/setemad-tech/outly-backend/blob/main/loyalty/models.py): `loyalty/models.py`
- [Chat API](https://github.com/setemad-tech/outly-backend/blob/main/chat/views.py): `chat/views.py`
- [Chat routing](https://github.com/setemad-tech/outly-backend/blob/main/chat/routing.py): `chat/routing.py`
- [Chat consumer](https://github.com/setemad-tech/outly-backend/blob/main/chat/consumers.py): `chat/consumers.py`
- [Chat records](https://github.com/setemad-tech/outly-backend/blob/main/chat/models.py): `chat/models.py`
- [Chat signals](https://github.com/setemad-tech/outly-backend/blob/main/chat/signals.py): `chat/signals.py`
- [Chat app registration](https://github.com/setemad-tech/outly-backend/blob/main/chat/apps.py): `chat/apps.py`

### Staff operations

- [Staff API](https://github.com/setemad-tech/outly-backend/blob/main/backoffice/views.py): `backoffice/views.py`
- [Analytics](https://github.com/setemad-tech/outly-backend/blob/main/backoffice/analytics.py): `backoffice/analytics.py`
- [Staff serializers](https://github.com/setemad-tech/outly-backend/blob/main/backoffice/serializers.py): `backoffice/serializers.py`
- [Staff action records](https://github.com/setemad-tech/outly-backend/blob/main/backoffice/models.py): `backoffice/models.py`

### Other components

- **Attendee**
- **Organizer**
- **Staff**
- **Stripe**

## Connections

- Attendee → Account API: manages account
- Account API → Identity records: reads and writes (evidence: `accounts/views.py`)
- Account API → Email verification: uses verification (evidence: `accounts/views.py`)
- Organizer → Event API: manages events
- Event API → Event catalog: serves events
- Attendee → Booking API: books tickets
- Booking API → Booking service: creates bookings
- Booking service → Event catalog: locks event (evidence: `bookings/services.py`)
- Booking service → Quote builder: builds quote (evidence: `bookings/services.py`)
- Booking service → Booking records: creates booking (evidence: `bookings/services.py`)
- Quote builder → Ticket pricing: uses calculations (evidence: `bookings/quote.py`)
- Quote builder → Promo validation: checks promo (evidence: `bookings/quote.py`)
- Quote builder → Loyalty levels: checks level (evidence: `bookings/quote.py`)
- Promo validation → Promo codes: validates code (evidence: `promos/services.py`)
- Promo validation → Event catalog: checks event (evidence: `promos/services.py`)
- Promo validation → Loyalty levels: checks eligibility (evidence: `promos/services.py`)
- Payment API → Stripe payments: handles payment (evidence: `payments/views.py`)
- Payment API → Booking service: starts checkout (evidence: `payments/views.py`)
- Stripe payments → Stripe: creates sessions (evidence: `payments/services.py`)
- Stripe payments → Booking records: confirms booking (evidence: `payments/services.py`)
- Stripe payments → Ticket email: sends ticket (evidence: `payments/services.py`)
- Stripe payments → Loyalty ledger: awards points (evidence: `payments/services.py`)
- Booking service → Loyalty ledger: redeems points (evidence: `bookings/services.py`)
- Loyalty ledger → Loyalty entries: writes entries (evidence: `loyalty/services.py`)
- Loyalty levels → Booking records: counts attendance (evidence: `loyalty/levels.py`)
- Loyalty levels → Ticket pricing: uses point rate (evidence: `loyalty/levels.py`)
- Booking records → QR tickets: ticket identity
- Attendee → Chat API: uses chat
- Chat routing → Chat consumer: routes sockets (evidence: `chat/routing.py`)
- Chat consumer → Chat records: uses messages (evidence: `chat/consumers.py`)
- Chat app registration → Chat signals: registers signals (evidence: `chat/apps.py`)
- Staff → Staff API: manages platform
- Staff API → Analytics: requests overview (evidence: `backoffice/views.py`)
- Staff API → Staff serializers: formats responses (evidence: `backoffice/views.py`)
- Analytics → Booking records: aggregates sales (evidence: `backoffice/analytics.py`)
- Analytics → Event catalog: aggregates events (evidence: `backoffice/analytics.py`)
- Analytics → Identity records: aggregates users (evidence: `backoffice/analytics.py`)
- Staff API → Staff action records: records actions (evidence: `backoffice/views.py`)
