How incognito10100/someproject works
1. Overall shape
This is a Next.js App Router application with both UI pages and API route handlers in the same repo. The architecture is split into:
• app/**/page.tsx for routed screens
• app/api/**/route.ts for server-side endpoints
• components/* for reusable client/server UI pieces
• lib/* for shared infrastructure and data access
• prisma/* for the database schema
2. Core domain model
The app appears centered on a productivity / learning workflow built around journals, tasks, chains, circles, streaks, reviews, and leaderboard/activity tracking. Those are not just pages; they are separate domain subsystems with their own API routes and UI surfaces.
3. Frontend shell and navigation
app/layout.tsx, app/globals.css, components/Sidebar.tsx, and components/SessionProvider.tsx define the global shell. The shell likely handles authenticated navigation, session context, and responsive layout, while pages such as dashboard, journal, tasks, review-queue, library, chain, circles, login, and register are the top-level user entry points.
4. Authentication and session boundary
Authentication is implemented with NextAuth via app/api/auth/[...nextauth]/route.ts, plus a custom registration endpoint at app/api/auth/register/route.ts. Shared auth logic lives in lib/auth.ts, and types/next-auth.d.ts extends session/user typing. proxy.ts suggests route protection or request gating at the edge/middleware layer. This creates the main boundary between public pages and authenticated app areas.
5. Primary server/data layer
lib/prisma.ts indicates Prisma is the main database access layer, with the schema defined in prisma/schema.prisma. Most domain state is presumably persisted there. The app likely reads and writes through API routes rather than direct client-to-database access, keeping the browser isolated from the persistence layer.
6. Journal and review workflow
Journaling is a first-class subsystem:
• app/journal/page.tsx
• app/api/journals/route.ts
• app/api/journals/[id]/route.ts
• components/JournalEditor.tsx
A review flow sits on top of that:
• app/review-queue/page.tsx
• app/api/review/journal/[id]/route.ts
• app/api/review/submission/[id]/route.ts
• components/ReviewClient.tsx
This suggests a pipeline where users create journal entries, then certain entries or submissions enter a moderation/review state before becoming fully accepted or scored.
7. Tasks and completion pipeline
Tasks are handled as another domain stream:
• app/tasks/page.tsx
• app/api/tasks/submit/route.ts
• components/TaskList.tsx
There is also admin-facing task management at app/api/admin/tasks/route.ts. The separation implies users submit task evidence or completions through the public task endpoint, while administrators can define or oversee tasks through admin APIs.
8. Chains, circles, and content relationships
The app includes chains and circles as distinct organizational/grouping concepts:
• chain UI: app/chain/page.tsx, components/ChainView.tsx, components/QuickSeedChain.tsx
• chain APIs: app/api/chains/[id]/links/route.ts
• circle APIs: app/api/admin/circles/route.ts, app/circles/page.tsx
The presence of chain links implies a graph-like structure or ordered relationship model. QuickSeedChain suggests users can create or bootstrap chain content quickly, while ChainView likely renders linked items and relationships.
9. Progress and gamification services
Progress tracking is separated into its own subsystem:
• app/api/streaks/route.ts
• lib/streaks.ts
• app/api/leaderboard/route.ts
• app/dashboard/page.tsx
• components/ActivityGraph.tsx
• app/api/activity/route.ts
This points to derived metrics computed from user activity, such as streak counts, ranking, and trend visualization. The dashboard page likely aggregates these signals into a user summary.
10. Notifications and scheduled automation
There are dedicated APIs for background-driven behavior:
• app/api/notifications/route.ts
• app/api/cron/scheduler/route.ts
The cron scheduler route suggests periodic jobs or server-triggered maintenance, likely used to update streaks, trigger notifications, or advance review/task states without manual user interaction.
11. Admin subsystem
Admin capabilities are separated from the main user flow:
• app/admin/page.tsx
• components/AdminClient.tsx
• app/api/admin/* for chains, circles, library, tasks, and users/roles
This is a clear administrative boundary for managing content, permissions, and operational data. The route structure shows that role management is explicit (app/api/admin/users/role/route.ts), which likely ties into NextAuth session roles.
12. External services and deployment
lib/supabase.ts indicates the app integrates with Supabase for some external backend service or storage capability, alongside Prisma-managed persistence. Deployment is configured for Vercel (vercel.json), and the repo is standard Next.js/TypeScript tooling with ESLint, Prettier, and PostCSS. createAdmin.js and hashtest.js look like utility scripts for setup or verification rather than runtime subsystems.
Main entry points: layout.tsx App shell · prisma.ts Prisma · JournalEditor.tsx Domain clients · page.tsx Dashboard
Components 28
Next.js app
Routed UI screens, shared shell, and server route handlers.
- App shell · Global app layout, styles, and authenticated navigation shell.
app/layout.tsx - Home · Public entry page for the app.
app/page.tsx - Auth pages · Login and registration screens.
app/login/page.tsx - Session provider · Client-side session context shared across the app.
components/SessionProvider.tsx - Sidebar · Primary in-app navigation shell.
components/Sidebar.tsx
Core workflows
Primary user-facing product loops and domain surfaces.
- Journal · Journal entry authoring and persistence flow.
app/journal/page.tsx - Review queue · Review and submission handling for journal content.
app/review-queue/page.tsx - Tasks · Task listing and completion submission flow.
app/tasks/page.tsx - Chains · Linked content and ordered chain views.
app/chain/page.tsx - Circles · Circle-based grouping and community surface.
app/circles/page.tsx - Library · Shared library browsing and management surface.
app/library/page.tsx - Dashboard · Aggregated activity, streak, and leaderboard overview.
app/dashboard/page.tsx - Activity API · Activity feed and graph data for progress visuals.
app/api/activity/route.ts - Journal API · Journal CRUD endpoints.
app/api/journals/route.ts - Review APIs · Review journal and submission endpoints.
app/api/review/journal/[id]/route.ts - Tasks API · Task submission endpoint.
app/api/tasks/submit/route.ts - Chain links · Chain link management endpoint.
app/api/chains/[id]/links/route.ts - Domain clients · Reusable workflow components for journal, review, tasks, chains, and metrics.
components/JournalEditor.tsx
Admin surface
Administrative views and control endpoints.
- Admin console · Administrative control page and client.
app/admin/page.tsx - Admin APIs · Administrative control routes for chains, circles, library, tasks, and roles.
app/api/admin/chains/route.ts
Data and services
Persistence, auth, and external integrations.
- Streaks · Streak calculation and persistence helpers.
lib/streaks.ts - Prisma · Primary database access layer for app data.
lib/prisma.ts - Auth core · NextAuth configuration and shared auth logic.
lib/auth.ts - DB schema · Database model definitions and relationships.
prisma/schema.prisma - Supabase · Additional backend/storage integration.
lib/supabase.ts - Auth routes · NextAuth and registration endpoints.
app/api/auth/[...nextauth]/route.ts - Cron scheduler · Scheduled job entrypoint for background updates.
app/api/cron/scheduler/route.ts - Notifications · Notification delivery and retrieval endpoint.
app/api/notifications/route.ts
Connections 36
- Home → App shell: uses shell
- Auth pages → App shell: uses shell
- Dashboard → App shell: uses shell
- Journal → App shell: uses shell
- Review queue → App shell: uses shell
- Tasks → App shell: uses shell
- Chains → App shell: uses shell
- Circles → App shell: uses shell
- Library → App shell: uses shell
- Admin console → App shell: uses shell
- App shell → Sidebar: renders nav
- App shell → Session provider: provides session
- Auth routes → Auth core: configures
- Auth pages → Auth routes: authenticates via
- Admin console → Admin APIs: controls
- Dashboard → Activity API: loads metrics
- Dashboard → Streaks: shows streaks
- Journal → Journal API: reads/writes
- Review queue → Review APIs: reviews via
- Tasks → Tasks API: submits tasks
- Chains → Chain links: loads links
- Activity API → Prisma: queries data
- Journal API → Prisma: persists
- Review APIs → Prisma: persists
- Tasks API → Prisma: persists
- Chain links → Prisma: persists
- Admin APIs → Prisma: administers
- Streaks → Prisma: reads history
- Cron scheduler → Streaks: updates
- Cron scheduler → Notifications: triggers
- Prisma → DB schema: implements
- Prisma → Supabase: integrates with
- Domain clients → Journal API: supports
- Domain clients → Review APIs: supports
- Domain clients → Tasks API: supports
- Domain clients → Chain links: supports