# samcreviston/rpglorehold architecture

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

- Interactive diagram: https://gitdiagram.com/samcreviston/rpglorehold
- Repository: https://github.com/samcreviston/rpglorehold

## Overview

This is a planning scaffold for an RPG content publishing and campaign-management platform, not a complete implementation: the README explicitly says business logic is absent. Its intended user journey spans discovering reference content and published modules, creating or publishing modules, and organizing them into campaigns for play. The graph shows documented product areas and the server’s explicit route-to-controller structure; frontend-to-backend and several service-to-provider connections are indicative of the scaffold’s architecture, not verified runtime behavior in the sampled source.

Main entry points: [`server/src/server.ts`](https://github.com/samcreviston/rpglorehold/blob/main/server/src/server.ts) (API application), [`client/src/routes/AppRoutes.tsx`](https://github.com/samcreviston/rpglorehold/blob/main/client/src/routes/AppRoutes.tsx) (Page routing), [`client/src/pages/ModuleCreatorPage.tsx`](https://github.com/samcreviston/rpglorehold/blob/main/client/src/pages/ModuleCreatorPage.tsx) (Creator pages), [`client/src/components/creator/ModuleEditor.tsx`](https://github.com/samcreviston/rpglorehold/blob/main/client/src/components/creator/ModuleEditor.tsx) (Module editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_routes["Page routing<br/>[AppRoutes.tsx]"]
  node_searchpage["Search pages<br/>[SearchPage.tsx]"]
  node_creatorpage["Creator pages"]
  node_campaignpage["Campaign pages<br/>[DmHomePage.tsx]"]
  node_clientsearch["Search client<br/>[search.ts]"]
  node_clientmodules["Module client<br/>[modules.ts]"]
  node_clientcampaigns["Campaign client<br/>[campaigns.ts]"]
end

subgraph group_authoring["Creation and play"]
  node_editor["Module editor<br/>[ModuleEditor.tsx]"]
  node_aiwriter["AI generation"]
  node_reference["5e reference"]
  node_session["Session manager"]
end

subgraph group_api["Backend API"]
  node_server["API application<br/>[server.ts]"]
  node_searchroutes["Search routes<br/>[searchRoutes.ts]"]
  node_moduleroutes["Module routes<br/>[moduleRoutes.ts]"]
  node_campaignroutes["Campaign routes<br/>[campaignRoutes.ts]"]
  node_airoutes["AI routes<br/>[aiRoutes.ts]"]
  node_searchcontroller["Search controller"]
  node_modulecontroller["Module controller"]
end

subgraph group_domain["Domain services"]
  node_searchservice["Search service<br/>[searchService.ts]"]
  node_moduleservice["Module service<br/>[moduleService.ts]"]
  node_aiservice["AI generation service"]
  node_campaignservice["Campaign service<br/>[campaignService.ts]"]
  node_authservice["Authentication service<br/>[authService.ts]"]
end

subgraph group_integrations["Data and providers"]
  node_models["Domain models<br/>[Module.ts]"]
  node_mongo[("MongoDB<br/>[db.ts]")]
  node_meili[("Meilisearch<br/>[meilisearch.ts]")]
end

node_user(("Platform user"))
node_openai{{"OpenAI"}}
node_open5e{{"Open5e"}}

node_user -->|"opens pages"| node_routes
node_routes -->|"routes to"| node_searchpage
node_routes -->|"routes to"| node_creatorpage
node_routes -->|"routes to"| node_campaignpage
node_searchpage -.->|"requests search"| node_clientsearch
node_creatorpage -->|"edits modules"| node_editor
node_editor -.->|"saves module"| node_clientmodules
node_editor -->|"uses generation"| node_aiwriter
node_creatorpage -->|"browses reference"| node_reference
node_campaignpage -->|"manages sessions"| node_session
node_session -.->|"loads campaigns"| node_clientcampaigns
node_clientsearch -.->|"HTTP request"| node_searchroutes
node_clientmodules -.->|"HTTP request"| node_moduleroutes
node_clientcampaigns -.->|"HTTP request"| node_campaignroutes
node_server -->|"mounts routes"| node_searchroutes
node_server -->|"mounts routes"| node_moduleroutes
node_server -->|"mounts routes"| node_campaignroutes
node_server -->|"mounts routes"| node_airoutes
node_searchroutes -->|"dispatches"| node_searchcontroller
node_searchcontroller -->|"queries"| node_searchservice
node_searchservice -->|"searches indexes"| node_meili
node_searchservice -->|"search documents"| node_models
node_moduleroutes -->|"dispatches"| node_modulecontroller
node_modulecontroller -->|"module operations"| node_moduleservice
node_modulecontroller -->|"tracks ownership"| node_authservice
node_moduleservice -->|"reads and writes"| node_models
node_campaignroutes -->|"campaign operations"| node_campaignservice
node_airoutes -->|"generation requests"| node_aiservice
node_aiservice -.->|"generates content"| node_openai
node_reference -->|"searches reference"| node_open5e
node_models -->|"persists data"| node_mongo

click node_routes "https://github.com/samcreviston/rpglorehold/blob/main/client/src/routes/AppRoutes.tsx"
click node_searchpage "https://github.com/samcreviston/rpglorehold/blob/main/client/src/pages/SearchPage.tsx"
click node_creatorpage "https://github.com/samcreviston/rpglorehold/blob/main/client/src/pages/ModuleCreatorPage.tsx"
click node_campaignpage "https://github.com/samcreviston/rpglorehold/blob/main/client/src/pages/DmHomePage.tsx"
click node_clientsearch "https://github.com/samcreviston/rpglorehold/blob/main/client/src/api/search.ts"
click node_clientmodules "https://github.com/samcreviston/rpglorehold/blob/main/client/src/api/modules.ts"
click node_clientcampaigns "https://github.com/samcreviston/rpglorehold/blob/main/client/src/api/campaigns.ts"
click node_editor "https://github.com/samcreviston/rpglorehold/blob/main/client/src/components/creator/ModuleEditor.tsx"
click node_aiwriter "https://github.com/samcreviston/rpglorehold/blob/main/client/src/components/creator/AIContentGenerator.tsx"
click node_reference "https://github.com/samcreviston/rpglorehold/blob/main/client/src/components/content/ContentManagerTool.tsx"
click node_session "https://github.com/samcreviston/rpglorehold/blob/main/client/src/components/campaign/SessionManagerPanel.tsx"
click node_server "https://github.com/samcreviston/rpglorehold/blob/main/server/src/server.ts"
click node_searchroutes "https://github.com/samcreviston/rpglorehold/blob/main/server/src/routes/searchRoutes.ts"
click node_moduleroutes "https://github.com/samcreviston/rpglorehold/blob/main/server/src/routes/moduleRoutes.ts"
click node_campaignroutes "https://github.com/samcreviston/rpglorehold/blob/main/server/src/routes/campaignRoutes.ts"
click node_airoutes "https://github.com/samcreviston/rpglorehold/blob/main/server/src/routes/aiRoutes.ts"
click node_searchcontroller "https://github.com/samcreviston/rpglorehold/blob/main/server/src/controllers/searchController.ts"
click node_modulecontroller "https://github.com/samcreviston/rpglorehold/blob/main/server/src/controllers/moduleController.ts"
click node_searchservice "https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/searchService.ts"
click node_moduleservice "https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/moduleService.ts"
click node_aiservice "https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/aiGenerationService.ts"
click node_campaignservice "https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/campaignService.ts"
click node_authservice "https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/authService.ts"
click node_models "https://github.com/samcreviston/rpglorehold/blob/main/server/src/models/Module.ts"
click node_mongo "https://github.com/samcreviston/rpglorehold/blob/main/server/src/config/db.ts"
click node_meili "https://github.com/samcreviston/rpglorehold/blob/main/server/src/config/meilisearch.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_routes,node_searchpage,node_creatorpage,node_campaignpage,node_clientsearch,node_clientmodules,node_clientcampaigns,node_user toneBlue
class node_editor,node_aiwriter,node_reference,node_session toneAmber
class node_server,node_searchroutes,node_moduleroutes,node_campaignroutes,node_airoutes,node_searchcontroller,node_modulecontroller toneMint
class node_searchservice,node_moduleservice,node_aiservice,node_campaignservice,node_authservice toneRose
class node_models,node_mongo,node_meili,node_openai,node_open5e toneIndigo
```

## Components

### Client experience

- [Page routing](https://github.com/samcreviston/rpglorehold/blob/main/client/src/routes/AppRoutes.tsx): `client/src/routes/AppRoutes.tsx`
- [Search pages](https://github.com/samcreviston/rpglorehold/blob/main/client/src/pages/SearchPage.tsx): `client/src/pages/SearchPage.tsx`
- [Creator pages](https://github.com/samcreviston/rpglorehold/blob/main/client/src/pages/ModuleCreatorPage.tsx): `client/src/pages/ModuleCreatorPage.tsx`
- [Campaign pages](https://github.com/samcreviston/rpglorehold/blob/main/client/src/pages/DmHomePage.tsx): `client/src/pages/DmHomePage.tsx`
- [Search client](https://github.com/samcreviston/rpglorehold/blob/main/client/src/api/search.ts): `client/src/api/search.ts`
- [Module client](https://github.com/samcreviston/rpglorehold/blob/main/client/src/api/modules.ts): `client/src/api/modules.ts`
- [Campaign client](https://github.com/samcreviston/rpglorehold/blob/main/client/src/api/campaigns.ts): `client/src/api/campaigns.ts`

### Creation and play

- [Module editor](https://github.com/samcreviston/rpglorehold/blob/main/client/src/components/creator/ModuleEditor.tsx): `client/src/components/creator/ModuleEditor.tsx`
- [AI generation](https://github.com/samcreviston/rpglorehold/blob/main/client/src/components/creator/AIContentGenerator.tsx): `client/src/components/creator/AIContentGenerator.tsx`
- [5e reference](https://github.com/samcreviston/rpglorehold/blob/main/client/src/components/content/ContentManagerTool.tsx): `client/src/components/content/ContentManagerTool.tsx`
- [Session manager](https://github.com/samcreviston/rpglorehold/blob/main/client/src/components/campaign/SessionManagerPanel.tsx): `client/src/components/campaign/SessionManagerPanel.tsx`

### Backend API

- [API application](https://github.com/samcreviston/rpglorehold/blob/main/server/src/server.ts): `server/src/server.ts`
- [Search routes](https://github.com/samcreviston/rpglorehold/blob/main/server/src/routes/searchRoutes.ts): `server/src/routes/searchRoutes.ts`
- [Module routes](https://github.com/samcreviston/rpglorehold/blob/main/server/src/routes/moduleRoutes.ts): `server/src/routes/moduleRoutes.ts`
- [Campaign routes](https://github.com/samcreviston/rpglorehold/blob/main/server/src/routes/campaignRoutes.ts): `server/src/routes/campaignRoutes.ts`
- [AI routes](https://github.com/samcreviston/rpglorehold/blob/main/server/src/routes/aiRoutes.ts): `server/src/routes/aiRoutes.ts`
- [Search controller](https://github.com/samcreviston/rpglorehold/blob/main/server/src/controllers/searchController.ts): `server/src/controllers/searchController.ts`
- [Module controller](https://github.com/samcreviston/rpglorehold/blob/main/server/src/controllers/moduleController.ts): `server/src/controllers/moduleController.ts`

### Domain services

- [Search service](https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/searchService.ts): `server/src/services/searchService.ts`
- [Module service](https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/moduleService.ts): `server/src/services/moduleService.ts`
- [AI generation service](https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/aiGenerationService.ts): `server/src/services/aiGenerationService.ts`
- [Campaign service](https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/campaignService.ts): `server/src/services/campaignService.ts`
- [Authentication service](https://github.com/samcreviston/rpglorehold/blob/main/server/src/services/authService.ts): `server/src/services/authService.ts`

### Data and providers

- [Domain models](https://github.com/samcreviston/rpglorehold/blob/main/server/src/models/Module.ts): `server/src/models/Module.ts`
- [MongoDB](https://github.com/samcreviston/rpglorehold/blob/main/server/src/config/db.ts): `server/src/config/db.ts`
- [Meilisearch](https://github.com/samcreviston/rpglorehold/blob/main/server/src/config/meilisearch.ts): `server/src/config/meilisearch.ts`

### Other components

- **Platform user**
- **OpenAI**
- **Open5e**

## Connections

- Platform user → Page routing: opens pages
- Page routing → Search pages: routes to
- Page routing → Creator pages: routes to
- Page routing → Campaign pages: routes to
- Search pages → Search client: requests search
- Creator pages → Module editor: edits modules
- Module editor → Module client: saves module
- Module editor → AI generation: uses generation
- Creator pages → 5e reference: browses reference
- Campaign pages → Session manager: manages sessions
- Session manager → Campaign client: loads campaigns
- Search client → Search routes: HTTP request
- Module client → Module routes: HTTP request
- Campaign client → Campaign routes: HTTP request
- API application → Search routes: mounts routes
- API application → Module routes: mounts routes
- API application → Campaign routes: mounts routes
- API application → AI routes: mounts routes
- Search routes → Search controller: dispatches
- Search controller → Search service: queries
- Search service → Meilisearch: searches indexes
- Search service → Domain models: search documents
- Module routes → Module controller: dispatches
- Module controller → Module service: module operations
- Module controller → Authentication service: tracks ownership
- Module service → Domain models: reads and writes
- Campaign routes → Campaign service: campaign operations
- AI routes → AI generation service: generation requests
- AI generation service → OpenAI: generates content
- 5e reference → Open5e: searches reference
- Domain models → MongoDB: persists data
