How alan-uai/tradumanga works
Tradumanga is a web app for importing manga/manhwa chapters, translating pages contextually into Brazilian Portuguese, and reading the rendered results. The main flow starts with a URL import or chapter upload, enters a durable Inngest workflow, ingests pages, analyzes and translates them with Gemini, renders and QA-checks artifacts, stores them in Supabase, and exposes them in the reader. The graph also includes account/anonymous-session handling and reading progress. Pipeline stages and some service links follow the README; unsampled routes and implementations are not inferred beyond documented behavior.
Main entry points: inngest-runtime.ts Page pipeline runtime · admin.ts Supabase admin access · access.ts Actor and access checks · route.ts URL import API
Components 31
Reader experience
- Library and dashboard
app/page.tsx - New import
app/new/page.tsx - Processing view
components/processing-client.tsx - Reader
app/reader/[id]/page.tsx - Reading progress
components/reader-progress-tracker.tsx
Identity and access
- Session bootstrap
components/anonymous-session-bootstrap.tsx - Anonymous local state
lib/anonymous/localState.ts - Anonymous sessions
lib/anonymous/session.ts - Actor and access checks
lib/anonymous/access.ts - Account migration
app/api/migrate-anonymous/route.ts
Import and ingestion
- URL import API
app/api/import/url/route.ts - Chapter creation API
app/api/chapters/route.ts - URL source handling
lib/ingest/url.ts - MangaDex source
lib/ingest/mangadex.ts - MangaDex reader proxy
app/api/mangadex/reader/route.ts
Translation pipeline
- Inngest endpoint
app/api/inngest/route.ts - Workflow functions
lib/inngest/functions.ts - Page pipeline runtime
lib/pipeline/inngest-runtime.ts - Gemini analysis and translation
lib/pipeline/gemini.ts - Page composition and QA
lib/pipeline/page-layers.ts - Image processing provider
lib/pipeline/openrouter-image.ts - Translated page artifacts
lib/pipeline/inngest-runtime.ts
Persistence and orchestration
- Inngest client
lib/inngest/client.ts - Supabase admin access
lib/supabase/admin.ts - Supabase server auth
lib/supabase/server.ts - Supabase browser client
lib/supabase/client.ts - Supabase database and storage
lib/supabase/admin.ts
Other components
- Visitor
- Inngest Cloud
- Gemini
- Supabase
Connections 38
- Visitor → Library and dashboard: opens
- Visitor → New import: starts import
- New import → URL import API: submits URL
app/api/import/url/route.ts - URL import API → URL source handling: canonicalizes URL
app/api/import/url/route.ts - URL import API → MangaDex source: detects source
app/api/import/url/route.ts - URL import API → Inngest client: sends event
app/api/import/url/route.ts - Inngest endpoint → Inngest client: serves functions
app/api/inngest/route.ts - Inngest endpoint → Workflow functions: registers
app/api/inngest/route.ts - Inngest client → Inngest Cloud: dispatches workflow
README.md - Workflow functions → Page pipeline runtime: runs stages
lib/inngest/functions.ts - Page pipeline runtime → URL source handling: ingests sources
lib/pipeline/inngest-runtime.ts - Page pipeline runtime → Gemini analysis and translation: analyzes and translates
lib/inngest/functions.ts - Page pipeline runtime → Page composition and QA: composes pages
lib/pipeline/inngest-runtime.ts - Gemini analysis and translation → Gemini: requests analysis
README.md - Page composition and QA → Translated page artifacts: renders and QA-checks
README.md - Page pipeline runtime → Supabase admin access: records pipeline state
lib/pipeline/inngest-runtime.ts - Page pipeline runtime → Translated page artifacts: stores artifacts
README.md - Supabase admin access → Supabase: accesses data
README.md - Chapter creation API → Actor and access checks: checks access
app/api/chapters/route.ts - Chapter creation API → URL source handling: validates source
app/api/chapters/route.ts - MangaDex reader proxy → MangaDex source: uses source helper
app/api/mangadex/reader/route.ts - Processing view → Reader: redirects when ready
components/processing-client.tsx - Processing view → Supabase: polls status API
- Reader → Reading progress: renders tracker
app/reader/[id]/page.tsx - Reading progress → Anonymous local state: saves local progress
components/reader-progress-tracker.tsx - Session bootstrap → Anonymous local state: loads local manifest
components/anonymous-session-bootstrap.tsx - Session bootstrap → Supabase browser client: uses browser client
components/anonymous-session-bootstrap.tsx - Anonymous sessions → Supabase admin access: stores session records
lib/anonymous/session.ts - Actor and access checks → Anonymous sessions: resolves session
lib/anonymous/access.ts - Actor and access checks → Supabase server auth: checks signed-in user
lib/anonymous/access.ts - Actor and access checks → Supabase admin access: checks ownership
lib/anonymous/access.ts - Account migration → Anonymous sessions: gets session ID
app/api/migrate-anonymous/route.ts - Account migration → Supabase server auth: authenticates user
app/api/migrate-anonymous/route.ts - Account migration → Supabase admin access: migrates records
app/api/migrate-anonymous/route.ts - Supabase admin access → Supabase database and storage: accesses store
lib/supabase/admin.ts - Supabase server auth → Supabase: authenticates
README.md - Supabase browser client → Supabase: connects client
- Page pipeline runtime → Image processing provider: optional image processing