# jsepulvedai1/clanship_backend architecture

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

- Interactive diagram: https://gitdiagram.com/jsepulvedai1/clanship_backend
- Repository: https://github.com/jsepulvedai1/clanship_backend

## Overview

This repository is the Django backend for a services marketplace connecting customers with professionals. Its main workflow covers account and professional-profile management, service requests and job lifecycle, customer–professional chat, and paid subscriptions. GraphQL schemas expose the domain APIs; supporting capabilities include real-time messaging, push notifications, welcome email, and Mercado Pago checkout. Evidence is limited to the provided excerpts, source index, and tree; the README is empty, so unsampled capability links are omitted where their callers are not shown.

Main entry points: [`core/schema.py`](https://github.com/jsepulvedai1/clanship_backend/blob/main/core/schema.py) (GraphQL API), [`payments/schema.py`](https://github.com/jsepulvedai1/clanship_backend/blob/main/payments/schema.py) (Payment operations), [`chat/consumers.py`](https://github.com/jsepulvedai1/clanship_backend/blob/main/chat/consumers.py) (Real-time chat), [`core/tasks.py`](https://github.com/jsepulvedai1/clanship_backend/blob/main/core/tasks.py) (Async notifications)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and application"]
  node_graphql["GraphQL API<br/>[schema.py]"]
  node_http["HTTP endpoints<br/>[views.py]"]
end

subgraph group_marketplace["Marketplace domain"]
  node_users[("Accounts and profiles<br/>[models.py]")]
  node_user_api["Account operations<br/>[schema.py]"]
  node_jobs[("Jobs and requests<br/>[models.py]")]
  node_job_api["Job operations<br/>[schema.py]"]
end

subgraph group_engagement["Messaging and notifications"]
  node_chat_data[("Chat records<br/>[models.py]")]
  node_chat_socket["Real-time chat<br/>[consumers.py]"]
  node_tasks["Async notifications<br/>[tasks.py]"]
  node_firebase["Push delivery<br/>[firebase.py]"]
  node_welcome["Welcome email<br/>[welcome_emails.py]"]
end

subgraph group_billing["Subscriptions and payments"]
  node_payment_api["Payment operations<br/>[schema.py]"]
  node_payment_service["Checkout service<br/>[services.py]"]
  node_orders[("Subscription orders<br/>[models.py]")]
end

node_client(("Customer or professional"))
node_mercadopago["Mercado Pago"]
node_resend["Resend email"]
node_channel_layer["Channel layer"]

node_client -->|"submits operations"| node_graphql
node_graphql -->|"dispatches schema"| node_user_api
node_graphql -->|"dispatches schema"| node_job_api
node_graphql -->|"dispatches schema"| node_payment_api
node_user_api -->|"uses profiles"| node_users
node_job_api -->|"reads and updates"| node_jobs
node_chat_socket -->|"saves messages"| node_chat_data
node_chat_socket -->|"creates jobs"| node_jobs
node_chat_data -->|"enqueues notifications"| node_tasks
node_tasks -->|"sends pushes"| node_firebase
node_tasks -->|"broadcasts events"| node_channel_layer
node_chat_socket -->|"broadcasts messages"| node_channel_layer
node_payment_api -->|"uses checkout"| node_payment_service
node_payment_service -->|"creates and updates"| node_orders
node_payment_service -->|"creates preferences"| node_mercadopago
node_payment_api -->|"queries orders"| node_orders
node_http -->|"routes payment views"| node_payment_api
node_http -->|"sends welcome email"| node_welcome
node_welcome -->|"sends email"| node_resend

click node_graphql "https://github.com/jsepulvedai1/clanship_backend/blob/main/core/schema.py"
click node_http "https://github.com/jsepulvedai1/clanship_backend/blob/main/core/views.py"
click node_users "https://github.com/jsepulvedai1/clanship_backend/blob/main/users/models.py"
click node_user_api "https://github.com/jsepulvedai1/clanship_backend/blob/main/users/schema.py"
click node_jobs "https://github.com/jsepulvedai1/clanship_backend/blob/main/jobs/models.py"
click node_job_api "https://github.com/jsepulvedai1/clanship_backend/blob/main/jobs/schema.py"
click node_chat_data "https://github.com/jsepulvedai1/clanship_backend/blob/main/chat/models.py"
click node_chat_socket "https://github.com/jsepulvedai1/clanship_backend/blob/main/chat/consumers.py"
click node_tasks "https://github.com/jsepulvedai1/clanship_backend/blob/main/core/tasks.py"
click node_firebase "https://github.com/jsepulvedai1/clanship_backend/blob/main/core/firebase.py"
click node_welcome "https://github.com/jsepulvedai1/clanship_backend/blob/main/users/welcome_emails.py"
click node_payment_api "https://github.com/jsepulvedai1/clanship_backend/blob/main/payments/schema.py"
click node_payment_service "https://github.com/jsepulvedai1/clanship_backend/blob/main/payments/services.py"
click node_orders "https://github.com/jsepulvedai1/clanship_backend/blob/main/payments/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_graphql,node_http toneBlue
class node_users,node_user_api,node_jobs,node_job_api toneAmber
class node_chat_data,node_chat_socket,node_tasks,node_firebase,node_welcome toneMint
class node_payment_api,node_payment_service,node_orders toneRose
class node_client,node_mercadopago,node_resend,node_channel_layer toneIndigo
```

## Components

### API and application

- [GraphQL API](https://github.com/jsepulvedai1/clanship_backend/blob/main/core/schema.py): `core/schema.py`
- [HTTP endpoints](https://github.com/jsepulvedai1/clanship_backend/blob/main/core/views.py): `core/views.py`

### Marketplace domain

- [Accounts and profiles](https://github.com/jsepulvedai1/clanship_backend/blob/main/users/models.py): `users/models.py`
- [Account operations](https://github.com/jsepulvedai1/clanship_backend/blob/main/users/schema.py): `users/schema.py`
- [Jobs and requests](https://github.com/jsepulvedai1/clanship_backend/blob/main/jobs/models.py): `jobs/models.py`
- [Job operations](https://github.com/jsepulvedai1/clanship_backend/blob/main/jobs/schema.py): `jobs/schema.py`

### Messaging and notifications

- [Chat records](https://github.com/jsepulvedai1/clanship_backend/blob/main/chat/models.py): `chat/models.py`
- [Real-time chat](https://github.com/jsepulvedai1/clanship_backend/blob/main/chat/consumers.py): `chat/consumers.py`
- [Async notifications](https://github.com/jsepulvedai1/clanship_backend/blob/main/core/tasks.py): `core/tasks.py`
- [Push delivery](https://github.com/jsepulvedai1/clanship_backend/blob/main/core/firebase.py): `core/firebase.py`
- [Welcome email](https://github.com/jsepulvedai1/clanship_backend/blob/main/users/welcome_emails.py): `users/welcome_emails.py`

### Subscriptions and payments

- [Payment operations](https://github.com/jsepulvedai1/clanship_backend/blob/main/payments/schema.py): `payments/schema.py`
- [Checkout service](https://github.com/jsepulvedai1/clanship_backend/blob/main/payments/services.py): `payments/services.py`
- [Subscription orders](https://github.com/jsepulvedai1/clanship_backend/blob/main/payments/models.py): `payments/models.py`

### Other components

- **Customer or professional**
- **Mercado Pago**
- **Resend email**
- **Channel layer**

## Connections

- Customer or professional → GraphQL API: submits operations (evidence: `core/schema.py`)
- GraphQL API → Account operations: dispatches schema (evidence: `core/schema.py`)
- GraphQL API → Job operations: dispatches schema (evidence: `core/schema.py`)
- GraphQL API → Payment operations: dispatches schema (evidence: `core/schema.py`)
- Account operations → Accounts and profiles: uses profiles (evidence: `users/schema.py`)
- Job operations → Jobs and requests: reads and updates (evidence: `jobs/schema.py`)
- Real-time chat → Chat records: saves messages (evidence: `chat/consumers.py`)
- Real-time chat → Jobs and requests: creates jobs (evidence: `chat/consumers.py`)
- Chat records → Async notifications: enqueues notifications (evidence: `chat/models.py`)
- Async notifications → Push delivery: sends pushes (evidence: `core/tasks.py`)
- Async notifications → Channel layer: broadcasts events (evidence: `core/tasks.py`)
- Real-time chat → Channel layer: broadcasts messages (evidence: `chat/consumers.py`)
- Payment operations → Checkout service: uses checkout
- Checkout service → Subscription orders: creates and updates (evidence: `payments/services.py`)
- Checkout service → Mercado Pago: creates preferences (evidence: `payments/services.py`)
- Payment operations → Subscription orders: queries orders
- HTTP endpoints → Payment operations: routes payment views
- HTTP endpoints → Welcome email: sends welcome email (evidence: `core/views.py`)
- Welcome email → Resend email: sends email (evidence: `users/welcome_emails.py`)
