How saumyajha7/leetlab works
LeetLab is an Expo/React Native coding-practice app. The main path is authenticated browsing, problem detail, code editing and server-judged submission, ending in per-case verdicts; home and profile support that workflow. Supabase supplies sessions, profiles and problem data, while the server endpoint protects hidden test cases and calls the external judge. Edges are limited to README statements and shown imports/calls; several route implementations were not sampled, so their internal wiring is not inferred.
Main entry points: supabase.ts Supabase client · submit+api.ts Submission API · (tabs)/index.tsx Home dashboard · [problemId]/index.tsx Problem detail
Components 25
Identity & session
- Login and signup
src/app/(auth) - Auth screens
src/components/auth - Google sign-in
src/hooks/useGoogleAuth.ts - Session state
src/stores/useSessionStore.ts - Profile state
src/stores/useProfileStore.ts - Supabase client
src/lib/supabase.ts - Supabase Auth and Postgres
Problem discovery
- Home dashboard
src/app/(tabs)/index.tsx - Home cards
src/components/home - Problem library
src/app/(tabs)/problems.tsx - Problem detail
src/app/(tabs)/[problemId]/index.tsx - Problem detail query
src/hooks/useProblem.ts - Problem summaries
src/stores/useProblemsStore.ts - Problem components
src/components/problems
Code submission
- Code editor
src/app/(tabs)/[problemId]/codeEditor.tsx - Editor components
src/components/editor - Submission API
src/app/api/submit+api.ts - Judge execution
src/lib/judge.ts - CodeBox / Judge0
- Verdict screen
src/app/(tabs)/[problemId]/result.tsx - Verdict components
src/components/result
App support
- Profile screen
src/app/(tabs)/profile.tsx - Profile components
src/components/profile - App entry and routing
src/app/_layout.tsx
Other components
- Learner
Connections 28
- Learner → Login and signup: starts with
- Login and signup → Auth screens: renders
src/app/(auth)/signup.tsx - Auth screens → Google sign-in: invokes
- Google sign-in → Supabase client: signs in via
src/hooks/useGoogleAuth.ts - Supabase client → Supabase Auth and Postgres: auth and queries
- App entry and routing → Session state: initializes
src/stores/useSessionStore.ts - Session state → Supabase client: subscribes to auth
src/stores/useSessionStore.ts - Session state → Profile state: fetches or clears
src/stores/useSessionStore.ts - Home dashboard → Home cards: renders
src/app/(tabs)/index.tsx - Home dashboard → Problem summaries: reads and refreshes
src/app/(tabs)/index.tsx - Home dashboard → Profile state: reads and refreshes
src/app/(tabs)/index.tsx - Problem summaries → Supabase client: queries summaries
src/stores/useProblemsStore.ts - Problem library → Problem summaries: uses
src/app/(tabs)/problems.tsx - Problem library → Problem components: renders
src/app/(tabs)/problems.tsx - Problem detail → Problem detail query: loads problem
src/app/(tabs)/[problemId]/index.tsx - Problem detail → Problem components: renders
src/app/(tabs)/[problemId]/index.tsx - Problem detail query → Supabase client: queries detail
src/hooks/useProblem.ts - Problem detail → Code editor: opens editor
- Code editor → Editor components: renders
- Code editor → Submission API: posts code
- Submission API → Supabase Auth and Postgres: authenticates and fetches tests
- Submission API → Judge execution: runs test cases
src/app/api/submit+api.ts - Judge execution → CodeBox / Judge0: executes submissions
src/lib/judge.ts - Submission API → Verdict screen: returns verdict data
- Verdict screen → Verdict components: renders
- Profile screen → Profile components: renders
- Profile screen → Profile state: uses profile
- Profile components → Supabase client: signs out
src/components/profile/SignOutButton.tsx