# dragonminez/dragonminez-web architecture

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

- Interactive diagram: https://gitdiagram.com/dragonminez/dragonminez-web
- Repository: https://github.com/dragonminez/dragonminez-web

## Overview

DragonMineZ Web is a community platform for browsing, previewing, creating, and sharing Minecraft character hair designs, with favorites, voting, a multilingual interface, and a forum. The central workflow is browsing or previewing designs, then creating or managing one through authenticated API and persistence layers. The editor and forum are distinct product branches. Edges are limited to relationships shown in excerpts, the source index, or the README; several feature implementations were not sampled, so their internal wiring is left unspecified.

Main entry points: [`src/lib/forum/auth.ts`](https://github.com/dragonminez/dragonminez-web/blob/main/src/lib/forum/auth.ts) (Forum Identity), [`src/components/features/editor/hairThumbnails.ts`](https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/editor/hairThumbnails.ts) (Thumbnail Renderer), [`src/pages/api/hairs/index.ts`](https://github.com/dragonminez/dragonminez-web/blob/main/src/pages/api/hairs/index.ts) (Hair API), [`src/repositories/hair.repository.ts`](https://github.com/dragonminez/dragonminez-web/blob/main/src/repositories/hair.repository.ts) (Hair Repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_salon["Hair Salon"]
  node_hair_list["Hair Catalog<br/>[HairList.tsx]"]
  node_hair_preview["3D Preview<br/>[HairPreview.tsx]"]
  node_hair_form["Hair Form<br/>[useHairForm.ts]"]
end

subgraph group_editor["Design Editor"]
  node_hair_editor["Hair Editor<br/>[HairEditorPage.tsx]"]
  node_thumbnail_renderer["Thumbnail Renderer<br/>[hairThumbnails.ts]"]
  node_hair_scene["Hair Scene<br/>[hairScene.ts]"]
  node_hair_codec["Hair Codec<br/>[codec.ts]"]
end

subgraph group_backend["API and Data"]
  node_hair_api["Hair API<br/>[index.ts]"]
  node_hair_service["Hair Service<br/>[hair.service.ts]"]
  node_hair_repository["Hair Repository<br/>[hair.repository.ts]"]
  node_database[("PostgreSQL")]
  node_prisma_client["Prisma Client<br/>[prisma.ts]"]
end

subgraph group_community["Community Features"]
  node_like_feature["Favorites<br/>[useLike.ts]"]
  node_voting["Voting<br/>[VotingSystem.tsx]"]
  node_forum_routes["Forum Actions<br/>[&#91;action&#93;.ts]"]
  node_forum_auth["Forum Identity<br/>[auth.ts]"]
end

subgraph group_platform["Shared Platform"]
  node_language["Language Store<br/>[store.ts]"]
  node_language_provider["Language Provider"]
  node_language_hook["Language Hook<br/>[useLanguage.ts]"]
  node_middleware["Request Middleware<br/>[middleware.ts]"]
  node_api_responses["API Responses<br/>[response.ts]"]
end

node_visitor(("Site Visitor"))
node_discord["Discord"]

node_visitor -->|"browses"| node_hair_list
node_hair_list -.->|"shows previews"| node_hair_preview
node_visitor -->|"creates designs"| node_hair_editor
node_hair_preview -->|"requests thumbnails"| node_thumbnail_renderer
node_thumbnail_renderer -->|"uses scene"| node_hair_scene
node_thumbnail_renderer -->|"decodes hair"| node_hair_codec
node_hair_form -->|"validates codes"| node_hair_codec
node_hair_form -->|"submits designs"| node_hair_api
node_hair_api -->|"calls service"| node_hair_service
node_hair_api -->|"calls repository"| node_hair_repository
node_hair_service -->|"delegates queries"| node_hair_repository
node_hair_repository -->|"queries through"| node_prisma_client
node_prisma_client -->|"connects to"| node_database
node_visitor -->|"saves favorites"| node_like_feature
node_visitor -->|"votes"| node_voting
node_visitor -->|"uses forum"| node_forum_routes
node_forum_routes -.->|"checks identity"| node_forum_auth
node_forum_auth -->|"checks staff roles"| node_discord
node_forum_auth -->|"loads forum user"| node_prisma_client
node_language_provider -->|"provides context"| node_language_hook
node_language_hook -->|"reads and updates"| node_language
node_middleware -->|"uses responses"| node_api_responses
node_middleware -->|"loads identity"| node_forum_auth

click node_hair_list "https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/hairs/HairList.tsx"
click node_hair_preview "https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/hairs/HairPreview.tsx"
click node_hair_form "https://github.com/dragonminez/dragonminez-web/blob/main/src/hooks/useHairForm.ts"
click node_hair_editor "https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/editor/HairEditorPage.tsx"
click node_thumbnail_renderer "https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/editor/hairThumbnails.ts"
click node_hair_scene "https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/editor/hairScene.ts"
click node_hair_codec "https://github.com/dragonminez/dragonminez-web/blob/main/src/lib/hair/codec.ts"
click node_hair_api "https://github.com/dragonminez/dragonminez-web/blob/main/src/pages/api/hairs/index.ts"
click node_hair_service "https://github.com/dragonminez/dragonminez-web/blob/main/src/services/hair.service.ts"
click node_hair_repository "https://github.com/dragonminez/dragonminez-web/blob/main/src/repositories/hair.repository.ts"
click node_prisma_client "https://github.com/dragonminez/dragonminez-web/blob/main/src/lib/prisma.ts"
click node_like_feature "https://github.com/dragonminez/dragonminez-web/blob/main/src/hooks/useLike.ts"
click node_voting "https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/vote/VotingSystem.tsx"
click node_forum_routes "https://github.com/dragonminez/dragonminez-web/blob/main/src/pages/forum/act/%5Baction%5D.ts"
click node_forum_auth "https://github.com/dragonminez/dragonminez-web/blob/main/src/lib/forum/auth.ts"
click node_language "https://github.com/dragonminez/dragonminez-web/blob/main/src/i18n/store.ts"
click node_language_provider "https://github.com/dragonminez/dragonminez-web/blob/main/src/providers/LanguageProvider.tsx"
click node_language_hook "https://github.com/dragonminez/dragonminez-web/blob/main/src/i18n/useLanguage.ts"
click node_middleware "https://github.com/dragonminez/dragonminez-web/blob/main/src/middleware.ts"
click node_api_responses "https://github.com/dragonminez/dragonminez-web/blob/main/src/lib/api/response.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_hair_list,node_hair_preview,node_hair_form toneBlue
class node_hair_editor,node_thumbnail_renderer,node_hair_scene,node_hair_codec toneAmber
class node_hair_api,node_hair_service,node_hair_repository,node_database,node_prisma_client toneMint
class node_like_feature,node_voting,node_forum_routes,node_forum_auth toneRose
class node_language,node_language_provider,node_language_hook,node_middleware,node_api_responses,node_visitor,node_discord toneIndigo
```

## Components

### Hair Salon

- [Hair Catalog](https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/hairs/HairList.tsx): `src/components/features/hairs/HairList.tsx`
- [3D Preview](https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/hairs/HairPreview.tsx): `src/components/features/hairs/HairPreview.tsx`
- [Hair Form](https://github.com/dragonminez/dragonminez-web/blob/main/src/hooks/useHairForm.ts): `src/hooks/useHairForm.ts`

### Design Editor

- [Hair Editor](https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/editor/HairEditorPage.tsx): `src/components/features/editor/HairEditorPage.tsx`
- [Thumbnail Renderer](https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/editor/hairThumbnails.ts): `src/components/features/editor/hairThumbnails.ts`
- [Hair Scene](https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/editor/hairScene.ts): `src/components/features/editor/hairScene.ts`
- [Hair Codec](https://github.com/dragonminez/dragonminez-web/blob/main/src/lib/hair/codec.ts): `src/lib/hair/codec.ts`

### API and Data

- [Hair API](https://github.com/dragonminez/dragonminez-web/blob/main/src/pages/api/hairs/index.ts): `src/pages/api/hairs/index.ts`
- [Hair Service](https://github.com/dragonminez/dragonminez-web/blob/main/src/services/hair.service.ts): `src/services/hair.service.ts`
- [Hair Repository](https://github.com/dragonminez/dragonminez-web/blob/main/src/repositories/hair.repository.ts): `src/repositories/hair.repository.ts`
- **PostgreSQL**
- [Prisma Client](https://github.com/dragonminez/dragonminez-web/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`

### Community Features

- [Favorites](https://github.com/dragonminez/dragonminez-web/blob/main/src/hooks/useLike.ts): `src/hooks/useLike.ts`
- [Voting](https://github.com/dragonminez/dragonminez-web/blob/main/src/components/features/vote/VotingSystem.tsx): `src/components/features/vote/VotingSystem.tsx`
- [Forum Actions](https://github.com/dragonminez/dragonminez-web/blob/main/src/pages/forum/act/%5Baction%5D.ts): `src/pages/forum/act/[action].ts`
- [Forum Identity](https://github.com/dragonminez/dragonminez-web/blob/main/src/lib/forum/auth.ts): `src/lib/forum/auth.ts`

### Shared Platform

- [Language Store](https://github.com/dragonminez/dragonminez-web/blob/main/src/i18n/store.ts): `src/i18n/store.ts`
- [Language Provider](https://github.com/dragonminez/dragonminez-web/blob/main/src/providers/LanguageProvider.tsx): `src/providers/LanguageProvider.tsx`
- [Language Hook](https://github.com/dragonminez/dragonminez-web/blob/main/src/i18n/useLanguage.ts): `src/i18n/useLanguage.ts`
- [Request Middleware](https://github.com/dragonminez/dragonminez-web/blob/main/src/middleware.ts): `src/middleware.ts`
- [API Responses](https://github.com/dragonminez/dragonminez-web/blob/main/src/lib/api/response.ts): `src/lib/api/response.ts`

### Other components

- **Site Visitor**
- **Discord**

## Connections

- Site Visitor → Hair Catalog: browses
- Hair Catalog → 3D Preview: shows previews
- Site Visitor → Hair Editor: creates designs
- 3D Preview → Thumbnail Renderer: requests thumbnails (evidence: `src/components/features/hairs/HairPreview.tsx`)
- Thumbnail Renderer → Hair Scene: uses scene (evidence: `src/components/features/editor/hairThumbnails.ts`)
- Thumbnail Renderer → Hair Codec: decodes hair (evidence: `src/components/features/editor/hairThumbnails.ts`)
- Hair Form → Hair Codec: validates codes (evidence: `src/hooks/useHairForm.ts`)
- Hair Form → Hair API: submits designs (evidence: `src/hooks/useHairForm.ts`)
- Hair API → Hair Service: calls service (evidence: `src/pages/api/hairs/index.ts`)
- Hair API → Hair Repository: calls repository (evidence: `src/pages/api/hairs/index.ts`)
- Hair Service → Hair Repository: delegates queries (evidence: `src/services/hair.service.ts`)
- Hair Repository → Prisma Client: queries through (evidence: `src/repositories/hair.repository.ts`)
- Prisma Client → PostgreSQL: connects to (evidence: `src/lib/prisma.ts`)
- Site Visitor → Favorites: saves favorites
- Site Visitor → Voting: votes
- Site Visitor → Forum Actions: uses forum
- Forum Actions → Forum Identity: checks identity
- Forum Identity → Discord: checks staff roles (evidence: `src/lib/forum/auth.ts`)
- Forum Identity → Prisma Client: loads forum user (evidence: `src/lib/forum/auth.ts`)
- Language Provider → Language Hook: provides context (evidence: `src/i18n/useLanguage.ts`)
- Language Hook → Language Store: reads and updates (evidence: `src/i18n/useLanguage.ts`)
- Request Middleware → API Responses: uses responses (evidence: `src/middleware.ts`)
- Request Middleware → Forum Identity: loads identity (evidence: `src/middleware.ts`)
