How vinit1936/recall. works
Purpose and Runtime
recall. is a Next.js 16/React 19 application for tracking DSA problems and scheduling reviews through deterministic spaced repetition. It runs as an App Router server/client application, with REST-style route handlers backed by Prisma and Neon PostgreSQL. Primary roots are src/app/layout.tsx, src/app/(landing)/page.tsx, and src/app/(app)/layout.tsx.
Authentication and Access Boundary
NextAuth v5 authenticates users through Google, GitHub, or credential login; Prisma persists users, sessions, accounts, and credentials. Protected application views and user-scoped API operations form the core tenant boundary. Relevant paths: src/auth.ts, src/app/api/auth/[...nextauth]/route.ts, src/app/auth/login/page.tsx.
Persistent Domain Model
Prisma owns the durable model for users, problems, revisions, streak logs, and per-user column definitions. Problem carries platform metadata, lifecycle state, ladder step, due timestamp, and JSON custom fields; Revision records transitions and ratings. PostgreSQL uses pooled and direct Neon connections for serverless runtime versus migrations. Paths: prisma/schema.prisma, src/lib/prisma.ts, prisma/migrations/20260707153101_add_nextauth_tables/migration.sql.
Spaced-Repetition State Engine
The scheduling engine is a pure domain layer defining the 3/7/14/30-day ladder, rating-driven transitions, mastered/recheck handling, due-date normalization, and streak behavior. API handlers invoke it when a user submits a review, then persist both the changed problem and revision/streak records. Paths: src/lib/scheduling.ts, src/app/api/problems/[id]/revise/route.ts, src/app/api/problems/[id]/revise-again/route.ts.
Problem Management API and Dashboard
The problem API is the main CRUD/control surface: create/list/filter problems, update/delete metadata, find due work, retire items, and mutate custom values. The dashboard renders this collection through an interactive table; client fetching/caching uses SWR/native fetch abstractions. Paths: src/app/api/problems/route.ts, src/app/api/problems/[id]/route.ts, src/components/problems-table/index.tsx.
Daily Review and Habit Flow
The /daily page requests due-or-overdue active problems, presents a focused review deck, submits confidence ratings, and then refreshes aggregate streak/activity state. Separate endpoints produce streak status and 365-day heatmap data. Paths: src/app/(app)/daily/page.tsx, src/components/daily/focus-deck.tsx, src/app/api/problems/due/route.ts.
Platform Metadata Resolution
New problems are enriched locally rather than through runtime third-party platform calls. A central resolver registry dispatches by platform to resolver implementations, which query bundled JSON catalogs and apply URL/identifier fallback parsing. Build scripts generate/download catalog data. Paths: src/lib/platforms/index.ts, src/lib/platforms/types.ts, src/data/leetcode-problems.json.
Customization and Export
Users define table columns independently of the relational schema; definitions are persisted while values live in Problem.customFields JSON and are updated atomically. Settings also exposes full user-data export across problems, revisions, and streaks. Paths: src/app/api/columns/route.ts, src/app/api/problems/[id]/custom-fields/route.ts, src/app/api/export/route.ts.
Main entry points: prisma.ts Prisma data access · index.tsx Problems dashboard · layout.tsx App Router layouts · focus-deck.tsx Focus deck
Components 21
App UI
- App Router layouts · Separates landing and protected application experiences.
src/app/(app)/layout.tsx - Landing page
src/app/(landing)/page.tsx - Login page
src/app/auth/login/page.tsx - Problems dashboard · Fetches and manages the user's problem collection.
src/components/problems-table/index.tsx - Daily review
src/app/(app)/daily/page.tsx - Focus deck · Rates due problems and refreshes habit state.
src/components/daily/focus-deck.tsx
Server API
- Auth route handler
src/app/api/auth/[...nextauth]/route.ts - Problems API · User-scoped problem lifecycle and collection operations.
src/app/api/problems/route.ts - Problem detail API
src/app/api/problems/[id]/route.ts - Due work API
src/app/api/problems/due/route.ts - Review API · Applies ratings or recheck actions to a problem.
src/app/api/problems/[id]/revise/route.ts - Columns API · Persists per-user table column definitions.
src/app/api/columns/route.ts - Custom fields API · Atomically updates Problem JSON custom values.
src/app/api/problems/[id]/custom-fields/route.ts - Data export API · Exports user problems, revisions, and streaks.
src/app/api/export/route.ts
Domain Services
- NextAuth · Authenticates Google, GitHub, and credential users.
src/auth.ts - Scheduling engine · Computes ladder transitions, due dates, and streak behavior.
src/lib/scheduling.ts
Persistence
- Prisma data access · Server-side access to the durable user-scoped model.
src/lib/prisma.ts - Prisma domain schema · Defines users, sessions, problems, revisions, streaks, and columns.
prisma/schema.prisma - Neon PostgreSQL · Stores application and NextAuth records.
Platform Metadata
- Platform resolver registry · Resolves platform metadata from local catalogs and URL fallbacks.
src/lib/platforms/index.ts - LeetCode catalog
src/data/leetcode-problems.json
Connections 25
- App Router layouts → Landing page: serves public route
- App Router layouts → Problems dashboard: hosts protected UI
- App Router layouts → Daily review: hosts protected UI
- Login page → Auth route handler: signs in through
- Auth route handler → NextAuth: delegates to
- NextAuth → Prisma data access: persists identity and sessions
- Problems dashboard → Problems API: lists and creates
- Problems dashboard → Problem detail API: updates and deletes
- Problems dashboard → Columns API: configures columns
- Problems dashboard → Custom fields API: edits custom values
- Daily review → Focus deck: renders
- Focus deck → Due work API: loads due work
- Focus deck → Review API: submits rating
- Problems API → Platform resolver registry: enriches new problems
- Platform resolver registry → LeetCode catalog: queries local catalog
- Problems API → Prisma data access: reads and writes problems
- Problem detail API → Prisma data access: mutates problem metadata
- Due work API → Prisma data access: queries active due problems
- Review API → Scheduling engine: computes transition
- Review API → Prisma data access: persists problem, revision, streak
- Columns API → Prisma data access: persists definitions
- Custom fields API → Prisma data access: updates JSON values
- Data export API → Prisma data access: reads user data
- Prisma data access → Prisma domain schema: implements model
- Prisma data access → Neon PostgreSQL: uses pooled/direct connections