# christ-mayala/dryapi architecture

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

- Interactive diagram: https://gitdiagram.com/christ-mayala/dryapi
- Repository: https://github.com/christ-mayala/dryapi

## Overview

DRY is a multi-tenant Node.js API framework hosting business applications. The principal workflow is a client request entering the server, being routed through shared middleware into a tenant application, then handled by a feature controller that returns a standardized response. The repository also documents billing, licensing, audit, health, monitoring, and operational support. App-specific capabilities include AI inference, media downloads, marketplace leads, and pilgrimage content. Edges reflect the sampled bootstrap and route code or explicit README statements; unsampled subsystems are represented at their existing directory paths, without assuming their internal call chains.

Main entry points: [`dry/core/application/bootloader.js`](https://github.com/christ-mayala/dryapi/blob/main/dry/core/application/bootloader.js) (Tenant bootloader), [`dry/bootstrap/routes.js`](https://github.com/christ-mayala/dryapi/blob/main/dry/bootstrap/routes.js) (Route bootstrap), [`dryApp/MediaDL/features`](https://github.com/christ-mayala/dryapi/tree/main/dryApp/MediaDL/features) (Media downloads), [`dry/middlewares/protection/auth.middleware.js`](https://github.com/christ-mayala/dryapi/blob/main/dry/middlewares/protection/auth.middleware.js) (JWT authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Shared API runtime"]
  node_server["HTTP server<br/>[server.js]"]
  node_bootstrap["Route bootstrap<br/>[routes.js]"]
  node_tenantboot["Tenant bootloader<br/>[bootloader.js]"]
  node_model["Tenant models<br/>[modelFactory.js]"]
  node_mongo[("MongoDB<br/>[database.js]")]
  node_response["Response formatting<br/>[response.js]"]
end

subgraph group_security["Security and operations"]
  node_middleware["Request middleware"]
  node_auth["JWT authentication<br/>[auth.middleware.js]"]
  node_validation["Input validation"]
  node_query["Query pagination<br/>[queryBuilder.js]"]
  node_ops["Health and metrics<br/>[health.service.js]"]
  node_audit["Audit and alerts<br/>[alert.service.js]"]
  node_email["Email delivery<br/>[email.service.js]"]
end

subgraph group_ai["AI platform"]
  node_freellm["AI inference platform"]
  node_providers["AI providers"]
  node_aiadmin["AI keys and settings"]
end

subgraph group_business["Business applications"]
  node_billing["Billing and licensing"]
  node_mediadl["Media downloads"]
  node_lastreet["Marketplace leads"]
  node_otherapps["Other tenant apps"]
end

subgraph group_content["Content applications"]
  node_pelerin["Pilgrimage content"]
  node_podcast["Podcast pipeline"]
end

node_client(("API client"))

node_client -->|"sends request"| node_server
node_server -->|"starts routes"| node_bootstrap
node_bootstrap -->|"boots applications"| node_tenantboot
node_client -.->|"passes through"| node_middleware
node_middleware -.->|"includes auth"| node_auth
node_auth -->|"loads user"| node_model
node_auth -->|"sends errors"| node_response
node_model -.->|"uses database"| node_mongo
node_tenantboot -->|"mounts tenant apps"| node_freellm
node_tenantboot -.->|"mounts tenant apps"| node_mediadl
node_tenantboot -.->|"mounts tenant apps"| node_lastreet
node_tenantboot -.->|"mounts tenant apps"| node_pelerin
node_tenantboot -.->|"mounts tenant apps"| node_otherapps
node_freellm -.->|"routes inference"| node_providers
node_freellm -.->|"exposes management"| node_aiadmin
node_mediadl -->|"protects routes"| node_auth
node_mediadl -->|"validates requests"| node_validation
node_mediadl -->|"uses query tools"| node_query
node_lastreet -->|"loads tenant models"| node_model
node_lastreet -->|"sends email"| node_email
node_pelerin -->|"runs import pipeline"| node_podcast
node_podcast -->|"returns result"| node_response
node_billing -.->|"uses tenant models"| node_model
node_bootstrap -->|"serves health status"| node_ops
node_bootstrap -->|"formats not-found"| node_response
node_audit -.->|"stores audit data"| node_mongo

click node_server "https://github.com/christ-mayala/dryapi/blob/main/server.js"
click node_bootstrap "https://github.com/christ-mayala/dryapi/blob/main/dry/bootstrap/routes.js"
click node_tenantboot "https://github.com/christ-mayala/dryapi/blob/main/dry/core/application/bootloader.js"
click node_middleware "https://github.com/christ-mayala/dryapi/tree/main/dry/middlewares"
click node_auth "https://github.com/christ-mayala/dryapi/blob/main/dry/middlewares/protection/auth.middleware.js"
click node_validation "https://github.com/christ-mayala/dryapi/blob/main/dry/middlewares/validation/validation.middleware.js"
click node_query "https://github.com/christ-mayala/dryapi/blob/main/dry/middlewares/query/queryBuilder.js"
click node_model "https://github.com/christ-mayala/dryapi/blob/main/dry/core/factories/modelFactory.js"
click node_mongo "https://github.com/christ-mayala/dryapi/blob/main/config/database.js"
click node_response "https://github.com/christ-mayala/dryapi/blob/main/dry/utils/http/response.js"
click node_billing "https://github.com/christ-mayala/dryapi/tree/main/dry/modules"
click node_ops "https://github.com/christ-mayala/dryapi/blob/main/dry/services/health/health.service.js"
click node_audit "https://github.com/christ-mayala/dryapi/blob/main/dry/services/alert/alert.service.js"
click node_freellm "https://github.com/christ-mayala/dryapi/tree/main/dryApp/FreeLLM/core/routes"
click node_providers "https://github.com/christ-mayala/dryapi/tree/main/dryApp/FreeLLM/core/providers"
click node_aiadmin "https://github.com/christ-mayala/dryapi/tree/main/dryApp/FreeLLM/features"
click node_mediadl "https://github.com/christ-mayala/dryapi/tree/main/dryApp/MediaDL/features"
click node_lastreet "https://github.com/christ-mayala/dryapi/blob/main/dryApp/LaStreet/features/leads/controller/leads.controller.js"
click node_pelerin "https://github.com/christ-mayala/dryapi/tree/main/dryApp/Pelerin/features"
click node_podcast "https://github.com/christ-mayala/dryapi/blob/main/dryApp/Pelerin/services/podcastPipeline.service.js"
click node_otherapps "https://github.com/christ-mayala/dryapi/tree/main/dryApp"
click node_email "https://github.com/christ-mayala/dryapi/blob/main/dry/services/auth/email.service.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_bootstrap,node_tenantboot,node_model,node_mongo,node_response,node_client toneBlue
class node_middleware,node_auth,node_validation,node_query,node_ops,node_audit,node_email toneAmber
class node_freellm,node_providers,node_aiadmin toneMint
class node_billing,node_mediadl,node_lastreet,node_otherapps toneRose
class node_pelerin,node_podcast toneIndigo
```

## Components

### Shared API runtime

- [HTTP server](https://github.com/christ-mayala/dryapi/blob/main/server.js): `server.js`
- [Route bootstrap](https://github.com/christ-mayala/dryapi/blob/main/dry/bootstrap/routes.js): `dry/bootstrap/routes.js`
- [Tenant bootloader](https://github.com/christ-mayala/dryapi/blob/main/dry/core/application/bootloader.js): `dry/core/application/bootloader.js`
- [Tenant models](https://github.com/christ-mayala/dryapi/blob/main/dry/core/factories/modelFactory.js): `dry/core/factories/modelFactory.js`
- [MongoDB](https://github.com/christ-mayala/dryapi/blob/main/config/database.js): `config/database.js`
- [Response formatting](https://github.com/christ-mayala/dryapi/blob/main/dry/utils/http/response.js): `dry/utils/http/response.js`

### Security and operations

- [Request middleware](https://github.com/christ-mayala/dryapi/tree/main/dry/middlewares): `dry/middlewares`
- [JWT authentication](https://github.com/christ-mayala/dryapi/blob/main/dry/middlewares/protection/auth.middleware.js): `dry/middlewares/protection/auth.middleware.js`
- [Input validation](https://github.com/christ-mayala/dryapi/blob/main/dry/middlewares/validation/validation.middleware.js): `dry/middlewares/validation/validation.middleware.js`
- [Query pagination](https://github.com/christ-mayala/dryapi/blob/main/dry/middlewares/query/queryBuilder.js): `dry/middlewares/query/queryBuilder.js`
- [Health and metrics](https://github.com/christ-mayala/dryapi/blob/main/dry/services/health/health.service.js): `dry/services/health/health.service.js`
- [Audit and alerts](https://github.com/christ-mayala/dryapi/blob/main/dry/services/alert/alert.service.js): `dry/services/alert/alert.service.js`
- [Email delivery](https://github.com/christ-mayala/dryapi/blob/main/dry/services/auth/email.service.js): `dry/services/auth/email.service.js`

### AI platform

- [AI inference platform](https://github.com/christ-mayala/dryapi/tree/main/dryApp/FreeLLM/core/routes): `dryApp/FreeLLM/core/routes`
- [AI providers](https://github.com/christ-mayala/dryapi/tree/main/dryApp/FreeLLM/core/providers): `dryApp/FreeLLM/core/providers`
- [AI keys and settings](https://github.com/christ-mayala/dryapi/tree/main/dryApp/FreeLLM/features): `dryApp/FreeLLM/features`

### Business applications

- [Billing and licensing](https://github.com/christ-mayala/dryapi/tree/main/dry/modules): `dry/modules`
- [Media downloads](https://github.com/christ-mayala/dryapi/tree/main/dryApp/MediaDL/features): `dryApp/MediaDL/features`
- [Marketplace leads](https://github.com/christ-mayala/dryapi/blob/main/dryApp/LaStreet/features/leads/controller/leads.controller.js): `dryApp/LaStreet/features/leads/controller/leads.controller.js`
- [Other tenant apps](https://github.com/christ-mayala/dryapi/tree/main/dryApp): `dryApp`

### Content applications

- [Pilgrimage content](https://github.com/christ-mayala/dryapi/tree/main/dryApp/Pelerin/features): `dryApp/Pelerin/features`
- [Podcast pipeline](https://github.com/christ-mayala/dryapi/blob/main/dryApp/Pelerin/services/podcastPipeline.service.js): `dryApp/Pelerin/services/podcastPipeline.service.js`

### Other components

- **API client**

## Connections

- API client → HTTP server: sends request (evidence: `README.md`)
- HTTP server → Route bootstrap: starts routes (evidence: `README.md`)
- Route bootstrap → Tenant bootloader: boots applications (evidence: `dry/bootstrap/routes.js`)
- API client → Request middleware: passes through
- Request middleware → JWT authentication: includes auth
- JWT authentication → Tenant models: loads user (evidence: `dry/middlewares/protection/auth.middleware.js`)
- JWT authentication → Response formatting: sends errors (evidence: `dry/middlewares/protection/auth.middleware.js`)
- Tenant models → MongoDB: uses database
- Tenant bootloader → AI inference platform: mounts tenant apps (evidence: `README.md`)
- Tenant bootloader → Media downloads: mounts tenant apps
- Tenant bootloader → Marketplace leads: mounts tenant apps
- Tenant bootloader → Pilgrimage content: mounts tenant apps
- Tenant bootloader → Other tenant apps: mounts tenant apps
- AI inference platform → AI providers: routes inference
- AI inference platform → AI keys and settings: exposes management
- Media downloads → JWT authentication: protects routes (evidence: `dryApp/MediaDL/features/downloads/route/downloads.routes.js`)
- Media downloads → Input validation: validates requests (evidence: `dryApp/MediaDL/features/downloads/route/downloads.routes.js`)
- Media downloads → Query pagination: uses query tools (evidence: `dryApp/MediaDL/features/downloads/route/downloads.routes.js`)
- Marketplace leads → Tenant models: loads tenant models (evidence: `dryApp/LaStreet/features/leads/controller/leads.controller.js`)
- Marketplace leads → Email delivery: sends email (evidence: `dryApp/LaStreet/features/leads/controller/leads.controller.js`)
- Pilgrimage content → Podcast pipeline: runs import pipeline (evidence: `dryApp/Pelerin/features/podcastShow/controller/podcastShow.pipeline.controller.js`)
- Podcast pipeline → Response formatting: returns result (evidence: `dryApp/Pelerin/features/podcastShow/controller/podcastShow.pipeline.controller.js`)
- Billing and licensing → Tenant models: uses tenant models (evidence: `dry/modules/senepay/senepay.routes.js`)
- Route bootstrap → Health and metrics: serves health status (evidence: `dry/bootstrap/routes.js`)
- Route bootstrap → Response formatting: formats not-found (evidence: `dry/bootstrap/routes.js`)
- Audit and alerts → MongoDB: stores audit data (evidence: `dry/services/alert/alert.service.js`)
