How backend-ingress-within/ingress-within-main works
Ingress Within is a self-exploration and psychoeducation platform. Its principal journey is journaling, followed by background processing that surfaces patterns and reflections, builds emotional vocabulary, and supports revisiting progress through reports. The graph also preserves the documented exercise, knowledge, and psychoeducation capabilities. Source excerpts support the journal-to-queue and worker relationships; several other feature links are dashed because their implementation was not sampled.
Main entry points: triggers.ts Processing triggers · route.ts Journal entries · registry.ts Background queue · reflectionWorker.ts Reflection generation
Components 19
Reflective experience
- Application UI
src/App.jsx - Journal entries
src/app/api/entries/route.ts - Guided sessions
src/app/api/session/route.ts
Insight processing
- Background queue
src/lib/queue/registry.ts - Processing triggers
src/lib/queue/triggers.ts - Entry scoring
src/lib/queue/workers/entryScoringWorker.ts - Crisis detection
src/lib/queue/workers/crisisDetectionWorker.ts - Reflection generation
src/lib/queue/workers/reflectionWorker.ts - Intelligence orchestration
src/lib/orchestrator/intelligenceOrchestrator.ts - Knowledge and vocabulary
src/lib/knowledge/knowledgeService.ts - Vocabulary engine
src/lib/vocabEngine.ts - Progress reports
src/lib/weeklyReportOrchestrator.ts
Guided learning
- Guided exercises
src/lib/exercises/v4/services/exerciseService.ts - Interventions
src/lib/interventions/engine/intervention-engine.ts - Psychoeducation modules
src/lib/modules/moduleCatalogService.ts
Platform services
- AI provider pipeline
src/lib/ai/factory.ts - Supabase
src/lib/db.ts - User authentication
src/lib/auth-helper.ts
Other components
- Person
Connections 25
- Person → Application UI: uses
- Application UI → Journal entries: writes reflections
- Person → Guided sessions: completes
- Journal entries → Processing triggers: starts processing
src/app/api/entries/route.ts - Guided sessions → Processing triggers: starts processing
src/app/api/session/route.ts - Processing triggers → Background queue: enqueues jobs
src/lib/queue/triggers.ts - Background queue → Entry scoring: dispatches
src/lib/queue/registry.ts - Background queue → Crisis detection: dispatches
src/lib/queue/registry.ts - Background queue → Reflection generation: dispatches
src/lib/queue/registry.ts - Reflection generation → AI provider pipeline: uses provider
src/lib/queue/workers/reflectionWorker.ts - Crisis detection → Intelligence orchestration: updates job
src/lib/queue/workers/crisisDetectionWorker.ts - Reflection generation → Intelligence orchestration: updates job
src/lib/queue/workers/reflectionWorker.ts - Reflection generation → Knowledge and vocabulary: uses knowledge
src/lib/queue/workers/reflectionWorker.ts - Processing triggers → Knowledge and vocabulary: invokes processing
src/lib/queue/triggers.ts - Processing triggers → Progress reports: checks summaries
src/lib/queue/triggers.ts - Person → Guided exercises: explores
README.md - Person → Interventions: uses guidance
README.md - Person → Psychoeducation modules: learns concepts
README.md - Journal entries → Supabase: reads and writes
src/app/api/entries/route.ts - User authentication → Supabase: validates sessions
src/lib/auth-helper.ts - Journal entries → User authentication: authenticates request
src/app/api/entries/route.ts - Guided sessions → User authentication: authenticates request
src/app/api/session/route.ts - AI provider pipeline → Supabase: records outcomes
src/lib/ai/pipeline.ts - Person → Knowledge and vocabulary: builds vocabulary
README.md - Person → Progress reports: reviews progress
README.md