# sinkaroid/lustpress architecture

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

- Interactive diagram: https://gitdiagram.com/sinkaroid/lustpress
- Repository: https://github.com/sinkaroid/lustpress

## Overview

LustPress is a unified REST and GraphQL scraping API for eight adult-video sites. A request enters the server through REST routing or GraphQL, dispatches to site-specific get, search, random, or related handlers, and returns normalized video data. Site handlers either fetch site pages through the shared fetch/cache service and parse them with scraper adapters, or use a site API directly. The README documents the supported operations across all eight sites; several implementations are unsampled, so their internal links are not asserted. The graph focuses on runtime components and omits build and test machinery.

Main entry points: [`src/LustPress.ts`](https://github.com/sinkaroid/lustpress/blob/master/src/LustPress.ts) (Fetch and cache), [`src/index.ts`](https://github.com/sinkaroid/lustpress/blob/master/src/index.ts) (Application server), [`src/controller`](https://github.com/sinkaroid/lustpress/tree/master/src/controller) (Site operation handlers), [`src/scraper`](https://github.com/sinkaroid/lustpress/tree/master/src/scraper) (Site scraper adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API entrypoints"]
  node_server["Application server<br/>[index.ts]"]
  node_rest["REST routes<br/>[endpoint.ts]"]
  node_gql_handler["GraphQL handler<br/>[handler.ts]"]
  node_gql_schema["GraphQL schema<br/>[schema.ts]"]
end

subgraph group_domain["Site operations"]
  node_operations["Site operation handlers"]
end

subgraph group_scraping["Scraping and fetch"]
  node_scrapers["Site scraper adapters"]
end

subgraph group_support["Shared support"]
  node_fetch_cache["Fetch and cache<br/>[LustPress.ts]"]
  node_challenge["Pornhub challenge solver<br/>[ph-solver.ts]"]
  node_response_types["Response contracts<br/>[interfaces.ts]"]
end

node_client(("API consumer"))
node_site_services["Video sites"]
node_cache_store[("Key-value cache")]
node_graphql_clients(("GraphQL clients"))

node_client -->|"sends requests"| node_server
node_server -->|"registers routes"| node_rest
node_server -->|"registers GraphQL"| node_gql_handler
node_rest -->|"dispatches requests"| node_operations
node_gql_handler -->|"uses schema"| node_gql_schema
node_gql_schema -->|"resolves operations"| node_operations
node_operations -->|"scrapes pages"| node_scrapers
node_scrapers -->|"fetches page bodies"| node_fetch_cache
node_fetch_cache -->|"reads and writes"| node_cache_store
node_fetch_cache -->|"solves challenges"| node_challenge
node_fetch_cache -->|"requests pages"| node_site_services
node_operations -->|"queries site API"| node_site_services
node_scrapers -->|"builds typed results"| node_response_types
node_graphql_clients -.->|"sends queries"| node_server

click node_server "https://github.com/sinkaroid/lustpress/blob/master/src/index.ts"
click node_rest "https://github.com/sinkaroid/lustpress/blob/master/src/router/endpoint.ts"
click node_gql_handler "https://github.com/sinkaroid/lustpress/blob/master/src/graphql/handler.ts"
click node_gql_schema "https://github.com/sinkaroid/lustpress/blob/master/src/graphql/schema.ts"
click node_operations "https://github.com/sinkaroid/lustpress/tree/master/src/controller"
click node_scrapers "https://github.com/sinkaroid/lustpress/tree/master/src/scraper"
click node_fetch_cache "https://github.com/sinkaroid/lustpress/blob/master/src/LustPress.ts"
click node_challenge "https://github.com/sinkaroid/lustpress/blob/master/src/utils/ph-solver.ts"
click node_response_types "https://github.com/sinkaroid/lustpress/blob/master/src/interfaces.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_rest,node_gql_handler,node_gql_schema,node_graphql_clients toneBlue
class node_operations,node_cache_store toneAmber
class node_scrapers,node_client toneMint
class node_fetch_cache,node_challenge,node_response_types toneRose
class node_site_services toneIndigo
```

## Components

### API entrypoints

- [Application server](https://github.com/sinkaroid/lustpress/blob/master/src/index.ts): `src/index.ts`
- [REST routes](https://github.com/sinkaroid/lustpress/blob/master/src/router/endpoint.ts): `src/router/endpoint.ts`
- [GraphQL handler](https://github.com/sinkaroid/lustpress/blob/master/src/graphql/handler.ts): `src/graphql/handler.ts`
- [GraphQL schema](https://github.com/sinkaroid/lustpress/blob/master/src/graphql/schema.ts): `src/graphql/schema.ts`

### Site operations

- [Site operation handlers](https://github.com/sinkaroid/lustpress/tree/master/src/controller): `src/controller`

### Scraping and fetch

- [Site scraper adapters](https://github.com/sinkaroid/lustpress/tree/master/src/scraper): `src/scraper`

### Shared support

- [Fetch and cache](https://github.com/sinkaroid/lustpress/blob/master/src/LustPress.ts): `src/LustPress.ts`
- [Pornhub challenge solver](https://github.com/sinkaroid/lustpress/blob/master/src/utils/ph-solver.ts): `src/utils/ph-solver.ts`
- [Response contracts](https://github.com/sinkaroid/lustpress/blob/master/src/interfaces.ts): `src/interfaces.ts`

### Other components

- **API consumer**
- **Video sites**
- **Key-value cache**
- **GraphQL clients**

## Connections

- API consumer → Application server: sends requests
- Application server → REST routes: registers routes (evidence: `src/index.ts`)
- Application server → GraphQL handler: registers GraphQL (evidence: `src/index.ts`)
- REST routes → Site operation handlers: dispatches requests (evidence: `src/router/endpoint.ts`)
- GraphQL handler → GraphQL schema: uses schema (evidence: `src/graphql/handler.ts`)
- GraphQL schema → Site operation handlers: resolves operations (evidence: `src/graphql/schema.ts`)
- Site operation handlers → Site scraper adapters: scrapes pages (evidence: `src/controller/eporner/epornerGet.ts`)
- Site scraper adapters → Fetch and cache: fetches page bodies (evidence: `src/scraper/eporner/epornerGetController.ts`)
- Fetch and cache → Key-value cache: reads and writes (evidence: `src/LustPress.ts`)
- Fetch and cache → Pornhub challenge solver: solves challenges (evidence: `src/LustPress.ts`)
- Fetch and cache → Video sites: requests pages (evidence: `src/LustPress.ts`)
- Site operation handlers → Video sites: queries site API (evidence: `src/controller/txxx/txxxSearch.ts`)
- Site scraper adapters → Response contracts: builds typed results (evidence: `src/scraper/eporner/epornerGetController.ts`)
- GraphQL clients → Application server: sends queries
