How ujjwaltyagi10/prepdoc works
Purpose and runtime
This is a Vite-built React/TypeScript single-page application for MAANGCo-style interview preparation: dashboards and question content for DSA, system design, and frontend topics, with authentication, progress tracking, and premium subscription gating. Browser entry is index.html, which mounts src/main.tsx; src/App.tsx is the top-level application composition. Deployment is configured for Vercel in vercel.json.
Application shell and routing
src/components/app-shell.tsx provides the authenticated application chrome and hosts feature panels. Route selection is centralized in src/routes/app-router.tsx, separating public and private route sets through src/routes/public-routes.tsx and src/routes/private-routes.tsx. Stable path definitions belong in src/routes/route-paths.ts, forming the boundary between navigation/UI and page access policy.
Public acquisition and account access
The unauthenticated experience includes a landing surface, dashboard preview, and policy/contact pages: src/components/landing-page.tsx, src/components/public-dashboard-preview.tsx, and src/components/auth-screen.tsx. src/components/auth-gate-modal.tsx can interrupt protected actions and direct users into authentication. src/hooks/useGoogleOneTap.ts indicates Google One Tap is an external identity integration; backend-facing authentication calls are isolated in src/lib/auth-api.ts.
Learning content and feature panels
Three major content domains are represented by dedicated panels: src/components/dsa-panel.tsx, src/components/system-design-panel.tsx, and src/components/frontend-panel.tsx. Their bundled/content-model sources are src/data/dsa.ts, src/data/system-design.ts, and src/data/frontend.ts. This permits core question/catalog rendering to work from client-side data while API modules handle user-specific state.
User dashboard and progress
src/components/dashboard-panel.tsx is the signed-in progress-oriented home surface. Question retrieval/state and user completion persistence cross API boundaries through src/lib/questions-api.ts and src/lib/progress-api.ts; shared domain shapes are in src/types/maangco.ts. Local browser persistence is encapsulated by src/hooks/use-local-storage.ts, likely supporting session/UI state without coupling panels directly to storage.
Subscription and entitlement boundary
Premium access is represented as a distinct entitlement layer rather than embedded in topic panels. src/components/premium-gate-modal.tsx blocks restricted actions, while src/components/premium-modal.tsx presents upgrade flow. Plan discovery and subscription lifecycle calls are separated into src/lib/plans-api.ts and src/lib/subscription-api.ts. src/types/razorpay.d.ts identifies Razorpay as the payment-checkout integration boundary.
Assets, PWA, and presentation
Topic visuals and instructional media are bundled under src/assets/Video and src/assets, while reusable UI primitives live in src/components/ui/button.tsx and src/components/ui/shimmer.tsx. PWA/browser metadata is supplied by public/site.webmanifest; generated service-worker artifacts exist in dev-dist/sw.js, enabling offline/cache behavior in that distribution output.
Main entry points: private-routes.tsx Public and private routes · app-shell.tsx Authenticated shell · dsa-panel.tsx Topic panels · progress-api.ts Questions and progress APIs
Components 21
Application Runtime
- Browser / Vite · SPA entry and browser execution.
index.html - React bootstrap
src/main.tsx - App composition
src/App.tsx - PWA offline assets · Manifest and generated service worker support offline caching.
public/site.webmanifest
Routing & Access
- App router
src/routes/app-router.tsx - Public and private routes · Separates unauthenticated and authenticated page access.
src/routes/private-routes.tsx - Route paths
src/routes/route-paths.ts - Authenticated shell · Hosts signed-in feature panels.
src/components/app-shell.tsx - Landing and account UI · Landing, preview, and authentication surfaces.
src/components/landing-page.tsx - Auth gate modal
src/components/auth-gate-modal.tsx
Learning Experience
- Progress dashboard
src/components/dashboard-panel.tsx - Topic panels · DSA, system-design, and frontend learning views.
src/components/dsa-panel.tsx - Bundled catalogs · Client-side DSA, system-design, and frontend question content.
src/data/dsa.ts - Learning domain types
src/types/maangco.ts
User State & Commerce
- Authentication API
src/lib/auth-api.ts - Google One Tap
src/hooks/useGoogleOneTap.ts - Questions and progress APIs · Retrieves question state and persists completion.
src/lib/progress-api.ts - Local storage hook · Encapsulates local session and UI persistence.
src/hooks/use-local-storage.ts - Premium access flow · Gates restricted actions and presents upgrades.
src/components/premium-gate-modal.tsx - Plans and subscriptions · Discovers plans and manages subscription lifecycle.
src/lib/plans-api.ts - Razorpay checkout
src/types/razorpay.d.ts
Connections 21
- Browser / Vite → React bootstrap: loads
- React bootstrap → App composition: mounts
- App composition → App router: renders
- App router → Public and private routes: selects access set
- Public and private routes → Route paths: uses paths
- Public and private routes → Authenticated shell: authenticated routes
- Public and private routes → Landing and account UI: public routes
- Landing and account UI → Auth gate modal: prompts protected users
- Auth gate modal → Authentication API: starts sign-in
- Google One Tap → Authentication API: authenticates through
- Authenticated shell → Progress dashboard: hosts
- Authenticated shell → Topic panels: hosts
- Topic panels → Bundled catalogs: renders catalog data
- Progress dashboard → Questions and progress APIs: loads and saves progress
- Topic panels → Questions and progress APIs: gets question state
- Questions and progress APIs → Learning domain types: uses
- Authenticated shell → Local storage hook: persists UI state
- Topic panels → Premium access flow: requests restricted access
- Premium access flow → Plans and subscriptions: checks and upgrades
- Plans and subscriptions → Razorpay checkout: opens checkout
- Browser / Vite → PWA offline assets: uses manifest and cache