# trapitbisen/marvel-nexus architecture

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

- Interactive diagram: https://gitdiagram.com/trapitbisen/marvel-nexus
- Repository: https://github.com/trapitbisen/marvel-nexus

## Overview

Marvel Nexus is a Next.js application for exploring and managing a Marvel media catalogue, with search across media and characters, classification, universe metadata, and provider-backed imports. The principal supported workflow is a catalogue search request routed through media search, provider adapters, deduplication and Marvel classification; separate routes retrieve stored records and perform imports or universe seeding. UI pages indicate broader dashboard, timeline, watchlist, news and statistics capabilities, but their data wiring was not established from the supplied excerpts. Edges are limited to relationships shown in excerpts or the source index.

Main entry points: [`src/lib/catalogue/media-search.service.ts`](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/media-search.service.ts) (Media search), [`src/lib/db/mongodb.ts`](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/db/mongodb.ts) (MongoDB connection), [`src/lib/catalogue/media-bulk-import.service.ts`](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/media-bulk-import.service.ts) (Bulk import), [`src/lib/catalogue/universe-seed.service.ts`](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/universe-seed.service.ts) (Universe seeding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_explore["Explore<br/>[page.tsx]"]
  node_characters_ui["Characters<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_timeline["Timeline<br/>[page.tsx]"]
  node_watchlist["Watchlist<br/>[page.tsx]"]
  node_news["News<br/>[page.tsx]"]
  node_stats["Statistics<br/>[page.tsx]"]
  node_settings["Settings<br/>[page.tsx]"]
  node_menu["Menu<br/>[page.tsx]"]
end

subgraph group_catalogue["Catalogue workflows"]
  node_media_search_route["Media search API<br/>[route.ts]"]
  node_media_search["Media search"]
  node_classification["Marvel classification"]
  node_character_route["Character API<br/>[route.ts]"]
  node_character_search["Character search"]
  node_bulk_route["Media import API<br/>[route.ts]"]
  node_bulk_import["Bulk import"]
  node_media_catalogue["Catalogue service"]
  node_universe_route["Universe API<br/>[route.ts]"]
  node_seed_route["Universe seed API<br/>[route.ts]"]
  node_universe_seed["Universe seeding"]
  node_universe_data["Universe definitions<br/>[universes.ts]"]
end

subgraph group_providers["Provider integrations"]
  node_omdb["OMDb adapter<br/>[omdb.adapter.ts]"]
  node_tvmaze["TVmaze adapter<br/>[tvmaze.adapter.ts]"]
  node_metron["Metron adapter<br/>[metron.adapter.ts]"]
  node_wikidata["Wikidata adapter"]
end

subgraph group_persistence["Persistence and domain"]
  node_media_types["Media types<br/>[media.ts]"]
  node_character_types["Character types<br/>[character.ts]"]
  node_media_model["Media model<br/>[Media.ts]"]
  node_universe_model["Universe model<br/>[Universe.ts]"]
  node_mongo["MongoDB connection<br/>[mongodb.ts]"]
end

node_user(("User"))
node_database[("MongoDB")]

node_media_search_route -->|"calls"| node_media_search
node_media_search -->|"searches"| node_omdb
node_media_search -->|"searches"| node_tvmaze
node_media_search -->|"searches"| node_metron
node_media_search -->|"classifies"| node_classification
node_character_route -->|"calls"| node_character_search
node_character_search -->|"searches"| node_wikidata
node_bulk_route -->|"searches"| node_media_search
node_bulk_route -->|"imports"| node_bulk_import
node_bulk_import -->|"classifies"| node_classification
node_bulk_import -->|"connects"| node_mongo
node_bulk_import -->|"writes"| node_media_model
node_media_catalogue -->|"connects"| node_mongo
node_media_catalogue -->|"queries"| node_media_model
node_media_catalogue -->|"classifies"| node_classification
node_universe_route -->|"connects"| node_mongo
node_universe_route -->|"queries"| node_universe_model
node_seed_route -->|"calls"| node_universe_seed
node_universe_seed -->|"connects"| node_mongo
node_universe_seed -->|"writes"| node_universe_model
node_universe_seed -->|"uses"| node_universe_data
node_mongo -->|"connects"| node_database
node_media_model -->|"types"| node_media_types
node_universe_model -->|"types"| node_media_types
node_character_search -->|"uses"| node_character_types
node_media_search -->|"uses"| node_media_types
node_user -.->|"visits"| node_explore
node_user -.->|"visits"| node_characters_ui
node_user -.->|"visits"| node_dashboard
node_user -.->|"visits"| node_timeline
node_user -.->|"visits"| node_watchlist
node_user -.->|"visits"| node_news
node_user -.->|"visits"| node_stats
node_user -.->|"visits"| node_settings
node_user -.->|"visits"| node_menu

click node_explore "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/explore/page.tsx"
click node_characters_ui "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/characters/page.tsx"
click node_dashboard "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/dashboard/page.tsx"
click node_timeline "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/timeline/page.tsx"
click node_watchlist "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/watchlist/page.tsx"
click node_news "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/news/page.tsx"
click node_stats "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/stats/page.tsx"
click node_settings "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/settings/page.tsx"
click node_menu "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/menu/page.tsx"
click node_media_search_route "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/catalogue/search/route.ts"
click node_media_search "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/media-search.service.ts"
click node_classification "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/marvel-classification.ts"
click node_character_route "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/catalogue/characters/route.ts"
click node_character_search "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/character-search.service.ts"
click node_bulk_route "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/admin/import/media/route.ts"
click node_bulk_import "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/media-bulk-import.service.ts"
click node_media_catalogue "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/media-catalogue.service.ts"
click node_universe_route "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/catalogue/universes/route.ts"
click node_seed_route "https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/admin/seed/universes/route.ts"
click node_universe_seed "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/universe-seed.service.ts"
click node_universe_data "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/universes.ts"
click node_omdb "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/providers/omdb/omdb.adapter.ts"
click node_tvmaze "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/providers/tvmaze/tvmaze.adapter.ts"
click node_metron "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/providers/metron/metron.adapter.ts"
click node_wikidata "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/providers/wikidata/wikidata.adapter.ts"
click node_media_types "https://github.com/trapitbisen/marvel-nexus/blob/master/src/types/catalogue/media.ts"
click node_character_types "https://github.com/trapitbisen/marvel-nexus/blob/master/src/types/catalogue/character.ts"
click node_media_model "https://github.com/trapitbisen/marvel-nexus/blob/master/src/models/Media.ts"
click node_universe_model "https://github.com/trapitbisen/marvel-nexus/blob/master/src/models/Universe.ts"
click node_mongo "https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/db/mongodb.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_explore,node_characters_ui,node_dashboard,node_timeline,node_watchlist,node_news,node_stats,node_settings,node_menu,node_user toneBlue
class node_media_search_route,node_media_search,node_classification,node_character_route,node_character_search,node_bulk_route,node_bulk_import,node_media_catalogue,node_universe_route,node_seed_route,node_universe_seed,node_universe_data,node_database toneAmber
class node_omdb,node_tvmaze,node_metron,node_wikidata toneMint
class node_media_types,node_character_types,node_media_model,node_universe_model,node_mongo toneRose
```

## Components

### App experience

- [Explore](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/explore/page.tsx): `src/app/(app)/explore/page.tsx`
- [Characters](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/characters/page.tsx): `src/app/(app)/characters/page.tsx`
- [Dashboard](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/dashboard/page.tsx): `src/app/(app)/dashboard/page.tsx`
- [Timeline](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/timeline/page.tsx): `src/app/(app)/timeline/page.tsx`
- [Watchlist](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/watchlist/page.tsx): `src/app/(app)/watchlist/page.tsx`
- [News](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/news/page.tsx): `src/app/(app)/news/page.tsx`
- [Statistics](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/stats/page.tsx): `src/app/(app)/stats/page.tsx`
- [Settings](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/settings/page.tsx): `src/app/(app)/settings/page.tsx`
- [Menu](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/(app)/menu/page.tsx): `src/app/(app)/menu/page.tsx`

### Catalogue workflows

- [Media search API](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/catalogue/search/route.ts): `src/app/api/catalogue/search/route.ts`
- [Media search](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/media-search.service.ts): `src/lib/catalogue/media-search.service.ts`
- [Marvel classification](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/marvel-classification.ts): `src/lib/catalogue/marvel-classification.ts`
- [Character API](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/catalogue/characters/route.ts): `src/app/api/catalogue/characters/route.ts`
- [Character search](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/character-search.service.ts): `src/lib/catalogue/character-search.service.ts`
- [Media import API](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/admin/import/media/route.ts): `src/app/api/admin/import/media/route.ts`
- [Bulk import](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/media-bulk-import.service.ts): `src/lib/catalogue/media-bulk-import.service.ts`
- [Catalogue service](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/media-catalogue.service.ts): `src/lib/catalogue/media-catalogue.service.ts`
- [Universe API](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/catalogue/universes/route.ts): `src/app/api/catalogue/universes/route.ts`
- [Universe seed API](https://github.com/trapitbisen/marvel-nexus/blob/master/src/app/api/admin/seed/universes/route.ts): `src/app/api/admin/seed/universes/route.ts`
- [Universe seeding](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/universe-seed.service.ts): `src/lib/catalogue/universe-seed.service.ts`
- [Universe definitions](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/catalogue/universes.ts): `src/lib/catalogue/universes.ts`

### Provider integrations

- [OMDb adapter](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/providers/omdb/omdb.adapter.ts): `src/lib/providers/omdb/omdb.adapter.ts`
- [TVmaze adapter](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/providers/tvmaze/tvmaze.adapter.ts): `src/lib/providers/tvmaze/tvmaze.adapter.ts`
- [Metron adapter](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/providers/metron/metron.adapter.ts): `src/lib/providers/metron/metron.adapter.ts`
- [Wikidata adapter](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/providers/wikidata/wikidata.adapter.ts): `src/lib/providers/wikidata/wikidata.adapter.ts`

### Persistence and domain

- [Media types](https://github.com/trapitbisen/marvel-nexus/blob/master/src/types/catalogue/media.ts): `src/types/catalogue/media.ts`
- [Character types](https://github.com/trapitbisen/marvel-nexus/blob/master/src/types/catalogue/character.ts): `src/types/catalogue/character.ts`
- [Media model](https://github.com/trapitbisen/marvel-nexus/blob/master/src/models/Media.ts): `src/models/Media.ts`
- [Universe model](https://github.com/trapitbisen/marvel-nexus/blob/master/src/models/Universe.ts): `src/models/Universe.ts`
- [MongoDB connection](https://github.com/trapitbisen/marvel-nexus/blob/master/src/lib/db/mongodb.ts): `src/lib/db/mongodb.ts`

### Other components

- **User**
- **MongoDB**

## Connections

- Media search API → Media search: calls (evidence: `src/app/api/catalogue/search/route.ts`)
- Media search → OMDb adapter: searches (evidence: `src/lib/catalogue/media-search.service.ts`)
- Media search → TVmaze adapter: searches (evidence: `src/lib/catalogue/media-search.service.ts`)
- Media search → Metron adapter: searches (evidence: `src/lib/catalogue/media-search.service.ts`)
- Media search → Marvel classification: classifies (evidence: `src/lib/catalogue/media-search.service.ts`)
- Character API → Character search: calls (evidence: `src/app/api/catalogue/characters/route.ts`)
- Character search → Wikidata adapter: searches (evidence: `src/lib/catalogue/character-search.service.ts`)
- Media import API → Media search: searches (evidence: `src/app/api/admin/import/media/route.ts`)
- Media import API → Bulk import: imports (evidence: `src/app/api/admin/import/media/route.ts`)
- Bulk import → Marvel classification: classifies (evidence: `src/lib/catalogue/media-bulk-import.service.ts`)
- Bulk import → MongoDB connection: connects (evidence: `src/lib/catalogue/media-bulk-import.service.ts`)
- Bulk import → Media model: writes (evidence: `src/lib/catalogue/media-bulk-import.service.ts`)
- Catalogue service → MongoDB connection: connects (evidence: `src/lib/catalogue/media-catalogue.service.ts`)
- Catalogue service → Media model: queries (evidence: `src/lib/catalogue/media-catalogue.service.ts`)
- Catalogue service → Marvel classification: classifies (evidence: `src/lib/catalogue/media-catalogue.service.ts`)
- Universe API → MongoDB connection: connects (evidence: `src/app/api/catalogue/universes/route.ts`)
- Universe API → Universe model: queries (evidence: `src/app/api/catalogue/universes/route.ts`)
- Universe seed API → Universe seeding: calls (evidence: `src/app/api/admin/seed/universes/route.ts`)
- Universe seeding → MongoDB connection: connects (evidence: `src/lib/catalogue/universe-seed.service.ts`)
- Universe seeding → Universe model: writes (evidence: `src/lib/catalogue/universe-seed.service.ts`)
- Universe seeding → Universe definitions: uses (evidence: `src/lib/catalogue/universe-seed.service.ts`)
- MongoDB connection → MongoDB: connects (evidence: `src/lib/db/mongodb.ts`)
- Media model → Media types: types (evidence: `src/models/Media.ts`)
- Universe model → Media types: types (evidence: `src/models/Universe.ts`)
- Character search → Character types: uses (evidence: `src/lib/catalogue/character-search.service.ts`)
- Media search → Media types: uses (evidence: `src/lib/catalogue/media-search.service.ts`)
- User → Explore: visits
- User → Characters: visits
- User → Dashboard: visits
- User → Timeline: visits
- User → Watchlist: visits
- User → News: visits
- User → Statistics: visits
- User → Settings: visits
- User → Menu: visits
