# pasiotestudio/dbdle architecture

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

- Interactive diagram: https://gitdiagram.com/pasiotestudio/dbdle
- Repository: https://github.com/pasiotestudio/dbdle

## Overview

This repository implements a Dead by Daylight daily guessing game: the backend generates daily answers and serves game-specific clues and checks, while the Next.js frontend provides pages for the game modes. Backend routing, scraping/cache, and daily generation are visible in the excerpts. Frontend page contents were sampled, but no frontend-to-backend calls are shown, so that connection is omitted.

Main entry points: [`backend/util/scrapping.js`](https://github.com/pasiotestudio/dbdle/blob/main/backend/util/scrapping.js) (Game data scraper), [`backend/server.js`](https://github.com/pasiotestudio/dbdle/blob/main/backend/server.js) (HTTP server), [`backend/cache.js`](https://github.com/pasiotestudio/dbdle/blob/main/backend/cache.js) (Runtime cache), [`backend/util/daily.js`](https://github.com/pasiotestudio/dbdle/blob/main/backend/util/daily.js) (Daily answer generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Game frontend"]
  node_home["Home page<br/>[page.tsx]"]
  node_killerpage["Killer game<br/>[page.tsx]"]
  node_lorepage["Lore game<br/>[page.tsx]"]
  node_perkpage["Perk game<br/>[page.tsx]"]
  node_quotepage["Quote game<br/>[page.tsx]"]
  node_splashpage["Splash game<br/>[page.tsx]"]
  node_terrorpage["Terror-radius game<br/>[page.tsx]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.js]"]
  node_killerroute["Killer routes<br/>[killer.js]"]
  node_loreroute["Lore routes<br/>[lore.js]"]
  node_perkroute["Perk routes<br/>[perk.js]"]
  node_quoteroute["Quote routes<br/>[quote.js]"]
  node_splashroute["Splash routes<br/>[splash.js]"]
  node_terrorroute["Terror-radius routes<br/>[terror_radius.js]"]
end

subgraph group_data["Game data"]
  node_scraper["Game data scraper<br/>[scrapping.js]"]
  node_cache[("Runtime cache<br/>[cache.js]")]
  node_constants["Game constants<br/>[constants.js]"]
end

subgraph group_generation["Daily generation"]
  node_daily["Daily answer generator<br/>[daily.js]"]
  node_db[("Daily records")]
end

node_player(("Player"))
node_wiki["Dead by Daylight wiki"]

node_server -->|"mounts"| node_killerroute
node_server -->|"mounts"| node_loreroute
node_server -->|"mounts"| node_perkroute
node_server -->|"mounts"| node_quoteroute
node_server -->|"mounts"| node_splashroute
node_server -->|"mounts"| node_terrorroute
node_server -->|"runs at startup"| node_daily
node_killerroute -->|"gets game data"| node_scraper
node_killerroute -->|"reads daily answer"| node_cache
node_loreroute -->|"gets game data"| node_scraper
node_loreroute -->|"reads daily answer"| node_cache
node_perkroute -->|"gets perks"| node_scraper
node_perkroute -->|"reads daily answer"| node_cache
node_quoteroute -->|"gets game data"| node_scraper
node_quoteroute -->|"reads daily answer"| node_cache
node_splashroute -->|"gets game data"| node_scraper
node_splashroute -->|"reads daily answer"| node_cache
node_splashroute -->|"uses settings"| node_constants
node_terrorroute -->|"gets game data"| node_scraper
node_terrorroute -->|"reads daily answer"| node_cache
node_scraper -->|"caches game data"| node_cache
node_scraper -->|"uses name rules"| node_constants
node_scraper -->|"scrapes pages"| node_wiki
node_daily -->|"loads game data"| node_scraper
node_daily -->|"uses game settings"| node_constants
node_daily -->|"stores daily answers"| node_cache
node_daily -->|"reads and writes records"| node_db

click node_home "https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/page.tsx"
click node_killerpage "https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/killer/page.tsx"
click node_lorepage "https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/lore/page.tsx"
click node_perkpage "https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/perk/page.tsx"
click node_quotepage "https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/quote/page.tsx"
click node_splashpage "https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/splash/page.tsx"
click node_terrorpage "https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/terror_radius/page.tsx"
click node_server "https://github.com/pasiotestudio/dbdle/blob/main/backend/server.js"
click node_killerroute "https://github.com/pasiotestudio/dbdle/blob/main/backend/route/killer.js"
click node_loreroute "https://github.com/pasiotestudio/dbdle/blob/main/backend/route/lore.js"
click node_perkroute "https://github.com/pasiotestudio/dbdle/blob/main/backend/route/perk.js"
click node_quoteroute "https://github.com/pasiotestudio/dbdle/blob/main/backend/route/quote.js"
click node_splashroute "https://github.com/pasiotestudio/dbdle/blob/main/backend/route/splash.js"
click node_terrorroute "https://github.com/pasiotestudio/dbdle/blob/main/backend/route/terror_radius.js"
click node_scraper "https://github.com/pasiotestudio/dbdle/blob/main/backend/util/scrapping.js"
click node_cache "https://github.com/pasiotestudio/dbdle/blob/main/backend/cache.js"
click node_constants "https://github.com/pasiotestudio/dbdle/blob/main/backend/util/constants.js"
click node_daily "https://github.com/pasiotestudio/dbdle/blob/main/backend/util/daily.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_home,node_killerpage,node_lorepage,node_perkpage,node_quotepage,node_splashpage,node_terrorpage toneBlue
class node_server,node_killerroute,node_loreroute,node_perkroute,node_quoteroute,node_splashroute,node_terrorroute toneAmber
class node_scraper,node_cache,node_constants toneMint
class node_daily,node_db toneRose
class node_player,node_wiki toneIndigo
```

## Components

### Game frontend

- [Home page](https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/page.tsx): `frontend/src/app/(main)/page.tsx`
- [Killer game](https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/killer/page.tsx): `frontend/src/app/(main)/(pages)/killer/page.tsx`
- [Lore game](https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/lore/page.tsx): `frontend/src/app/(main)/(pages)/lore/page.tsx`
- [Perk game](https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/perk/page.tsx): `frontend/src/app/(main)/(pages)/perk/page.tsx`
- [Quote game](https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/quote/page.tsx): `frontend/src/app/(main)/(pages)/quote/page.tsx`
- [Splash game](https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/splash/page.tsx): `frontend/src/app/(main)/(pages)/splash/page.tsx`
- [Terror-radius game](https://github.com/pasiotestudio/dbdle/blob/main/frontend/src/app/(main)/(pages)/terror_radius/page.tsx): `frontend/src/app/(main)/(pages)/terror_radius/page.tsx`

### Backend API

- [HTTP server](https://github.com/pasiotestudio/dbdle/blob/main/backend/server.js): `backend/server.js`
- [Killer routes](https://github.com/pasiotestudio/dbdle/blob/main/backend/route/killer.js): `backend/route/killer.js`
- [Lore routes](https://github.com/pasiotestudio/dbdle/blob/main/backend/route/lore.js): `backend/route/lore.js`
- [Perk routes](https://github.com/pasiotestudio/dbdle/blob/main/backend/route/perk.js): `backend/route/perk.js`
- [Quote routes](https://github.com/pasiotestudio/dbdle/blob/main/backend/route/quote.js): `backend/route/quote.js`
- [Splash routes](https://github.com/pasiotestudio/dbdle/blob/main/backend/route/splash.js): `backend/route/splash.js`
- [Terror-radius routes](https://github.com/pasiotestudio/dbdle/blob/main/backend/route/terror_radius.js): `backend/route/terror_radius.js`

### Game data

- [Game data scraper](https://github.com/pasiotestudio/dbdle/blob/main/backend/util/scrapping.js): `backend/util/scrapping.js`
- [Runtime cache](https://github.com/pasiotestudio/dbdle/blob/main/backend/cache.js): `backend/cache.js`
- [Game constants](https://github.com/pasiotestudio/dbdle/blob/main/backend/util/constants.js): `backend/util/constants.js`

### Daily generation

- [Daily answer generator](https://github.com/pasiotestudio/dbdle/blob/main/backend/util/daily.js): `backend/util/daily.js`
- **Daily records**

### Other components

- **Player**
- **Dead by Daylight wiki**

## Connections

- HTTP server → Killer routes: mounts (evidence: `backend/server.js`)
- HTTP server → Lore routes: mounts (evidence: `backend/server.js`)
- HTTP server → Perk routes: mounts (evidence: `backend/server.js`)
- HTTP server → Quote routes: mounts (evidence: `backend/server.js`)
- HTTP server → Splash routes: mounts (evidence: `backend/server.js`)
- HTTP server → Terror-radius routes: mounts (evidence: `backend/server.js`)
- HTTP server → Daily answer generator: runs at startup (evidence: `backend/server.js`)
- Killer routes → Game data scraper: gets game data (evidence: `backend/route/killer.js`)
- Killer routes → Runtime cache: reads daily answer (evidence: `backend/route/killer.js`)
- Lore routes → Game data scraper: gets game data (evidence: `backend/route/lore.js`)
- Lore routes → Runtime cache: reads daily answer (evidence: `backend/route/lore.js`)
- Perk routes → Game data scraper: gets perks (evidence: `backend/route/perk.js`)
- Perk routes → Runtime cache: reads daily answer (evidence: `backend/route/perk.js`)
- Quote routes → Game data scraper: gets game data (evidence: `backend/route/quote.js`)
- Quote routes → Runtime cache: reads daily answer (evidence: `backend/route/quote.js`)
- Splash routes → Game data scraper: gets game data (evidence: `backend/route/splash.js`)
- Splash routes → Runtime cache: reads daily answer (evidence: `backend/route/splash.js`)
- Splash routes → Game constants: uses settings (evidence: `backend/route/splash.js`)
- Terror-radius routes → Game data scraper: gets game data (evidence: `backend/route/terror_radius.js`)
- Terror-radius routes → Runtime cache: reads daily answer (evidence: `backend/route/terror_radius.js`)
- Game data scraper → Runtime cache: caches game data (evidence: `backend/util/scrapping.js`)
- Game data scraper → Game constants: uses name rules (evidence: `backend/util/scrapping.js`)
- Game data scraper → Dead by Daylight wiki: scrapes pages (evidence: `backend/util/scrapping.js`)
- Daily answer generator → Game data scraper: loads game data (evidence: `backend/util/daily.js`)
- Daily answer generator → Game constants: uses game settings (evidence: `backend/util/daily.js`)
- Daily answer generator → Runtime cache: stores daily answers (evidence: `backend/util/daily.js`)
- Daily answer generator → Daily records: reads and writes records (evidence: `backend/util/daily.js`)
