How namanjainakt/ai-resume-analyzer works
1. Overall shape
- This is a single React Router v7 SSR application, not a split frontend/backend repo.
- The app/routes directory defines both page routes and server endpoints, while app/lib/*.server.ts holds the server-side integration layer.
- The deployment model is serverless-friendly, with Vercel as the target runtime.
2. Request boundary and app shell
- app/root.tsx is the top-level entry and likely wires global providers such as Clerk.
- app/routes.ts and the route files define the navigation graph for the whole product.
- Public pages (home, auth, not-found, sitemap) sit alongside authenticated application pages under app.*.
3. Authentication boundary
- Clerk is the identity system and acts as the gate for the main product surfaces.
- app/lib/auth.server.ts centralizes session/user checks on the server side.
- The authenticated experience is split across routes like app.profile, app.resumes, app.settings, app.tracker, and the feature-specific tools.
4. Core persistence layer
- MongoDB Atlas is the primary structured datastore, accessed through app/lib/db.server.ts and app/models/Resume.server.ts.
- Resume metadata, analysis results, and user-related application state are stored here.
- The database is the system of record for app state, while uploaded binary files are kept elsewhere.
5. File storage strategy
- Uploaded PDFs are not stored in MongoDB; they are pushed to Telegram via app/lib/telegram.server.ts.
- This makes Telegram the external file store for source resumes and related artifacts.
- The architecture is unusual but important: metadata in MongoDB, files in Telegram, and the app reconstructs references between them.
6. Upload and resume-analysis pipeline
- The upload flow is centered on app/routes/Upload.tsx and app/routes/Upload.server.ts.
- The server side likely parses the PDF, extracts text, scores ATS fit, and stores the result in MongoDB.
- Helper modules such as app/lib/pdf.server.ts, app/lib/pdf2img.ts, app/lib/resume.server.ts, and app/lib/resumePdf.server.ts support parsing, conversion, and downstream rendering.
7. AI orchestration layer
- All model calls are funneled through app/lib/ai.server.ts, using Google AI via @ai-sdk/google.
- The default model is configured centrally, so AI behavior is a platform-level concern rather than feature-specific ad hoc calls.
- constants/ likely contains prompt templates and scoring instructions that drive consistent outputs across tools.
8. Feature modules built on the AI layer
- Several routes are thin feature shells over the AI service: cover-letter, interview-prep, linkedin, tailor, and parts of build.
- These features likely share a pattern: collect user input on the client, run a server action, then render structured AI output back into the UI.
- app/components/AIChat.tsx, Summary.tsx, ATS.tsx, KeywordMatch.tsx, and similar components render the analysis results.
9. Resume builder and template system
- The builder is a separate subsystem from analysis, centered on app/routes/build.tsx and the template directories.
- app/templates/ contains both preview components and PDF-specific templates under app/templates/pdf/.
- This split matters: interactive preview is rendered in React, while final export uses PDF rendering components, likely via @react-pdf/renderer.
10. Search and learning resources
- Skill-gap learning is backed by app/lib/search.server.ts and the optional YouTube Data API integration.
- This feature enriches analysis with external learning content rather than generating everything locally.
- It is a secondary integration boundary: the app scores skills first, then fetches tutorials/resources for missing areas.
11. Media, preview, and export surfaces
- app/routes/api.pdf.tsx, app/routes/api.pdf.server.ts, and app/routes/api.og.tsx expose generated artifacts for sharing/export.
- app/components/PDFPreview.tsx, PDFThumbnail.tsx, and ResumeCard.tsx support visual browsing of resume assets.
- There is also a PWA-like delivery layer in public/ with a manifest and service worker.
12. UI composition and stateful interaction
- app/components/ contains the reusable UI building blocks for scores, comparison views, upload flows, navigation, and dashboards.
- Components like ScoreGauge, ScoreCircle, ScoreComparison, ResumeCompare, and CustomWeights indicate the app presents analytical results visually, not just as text.
- AppShell, Navbar, and Sidebar-style components likely provide the authenticated layout around the feature routes.
13. Operational boundaries
- The app depends on external services that materially shape architecture: Clerk for auth, MongoDB for persistence, Telegram for file storage, Google AI for generation, and YouTube API for learning content.
- AI_PDF_MODE suggests a configurable parsing strategy, which can change the analysis pipeline without changing the user-facing routes.
- scripts/verify-*.mjs and the docs indicate the repo is built with deployment validation in mind, especially for third-party service connectivity.
Main entry points: app._index.tsx Dashboard · ai.server.ts AI Service · Upload.server.ts Upload Server · routes.ts Routes
Components 25
Routing & Shell
Top-level SSR app entry and route map
- Root · Top-level app entry that mounts providers and global layout
app/root.tsx - Routes · Central route configuration for the application
app/routes.ts - Home · Public landing page
app/routes/home.tsx - Auth · Authentication entry surface
app/routes/auth.tsx - App Shell · Authenticated layout and navigation wrapper
app/routes/app.tsx - Dashboard · Main authenticated landing page
app/routes/app._index.tsx
Core Services
Server-side integrations and shared persistence
- MongoDB · Primary system of record for resume and user state
app/lib/db.server.ts - Clerk Auth · Session and user access control boundary
app/lib/auth.server.ts - AI Service · Centralized Google AI orchestration layer
app/lib/ai.server.ts - Telegram Store · External store for uploaded PDFs and artifacts
app/lib/telegram.server.ts - PDF Tools · PDF parsing and conversion utilities
app/lib/pdf.server.ts - Search · Learning-resource lookup for skill gaps
app/lib/search.server.ts - Resume Model · Resume persistence and access abstraction
app/models/Resume.server.ts
Feature Surfaces
Main authenticated and public product flows
- Upload Flow · PDF upload, extraction, scoring, and persistence flow
app/routes/Upload.tsx - Upload Server · Server-side upload processing and resume analysis
app/routes/Upload.server.ts - Tailor · Resume tailoring workflow and output
app/routes/app.tailor.tsx - Cover Letter · AI-assisted cover letter generation surface
app/routes/cover-letter.tsx - Interview Prep · Interview practice and preparation surface
app/routes/interview-prep.tsx - LinkedIn · LinkedIn-oriented profile and content generation
app/routes/linkedin.tsx - Resumes · Resume management and browsing surface
app/routes/app.resumes.tsx
Builder & Templates
Resume creation and export templates
Delivery & Public Assets
Generated artifacts and static delivery
- PDF Export · Generated PDF artifact endpoint
app/routes/api.pdf.tsx - OG Image · Social preview image endpoint
app/routes/api.og.tsx - Public Assets · Manifest, service worker, icons, and robots delivery
public
Connections 31
- Routes → Home: maps · Defines the public landing route
- Routes → Auth: maps · Defines authentication route
- Routes → App Shell: maps · Defines protected app shell
- App Shell → Dashboard: nests · Authenticated dashboard sits under the shell
- Root → Routes: loads · Bootstraps the full route tree
- Root → App Shell: wraps · Provides global providers and layout
- App Shell → Clerk Auth: guards · Checks session and user access
- Upload Flow → Upload Server: action · Client upload UI submits to server processing
- Upload Server → PDF Tools: parses · Extracts and converts uploaded PDFs
- Upload Server → Telegram Store: stores files · Pushes source PDFs to external file store
- Upload Server → MongoDB: persists · Stores metadata and analysis results
- Upload Server → Resume Model: uses · Writes through the resume data model
- Resume Model → MongoDB: backed by · MongoDB is the system of record
- Tailor → AI Service: calls · Uses centralized AI orchestration
- Cover Letter → AI Service: calls · Uses centralized AI orchestration
- Interview Prep → AI Service: calls · Uses centralized AI orchestration
- LinkedIn → AI Service: calls · Uses centralized AI orchestration
- AI Service → MongoDB: reads state · Uses stored resume and user context
- AI Service → Search: enriches · Fetches learning resources for gaps
- Builder → Templates: renders · Interactive builder previews templates
- Templates → PDF Export: exports · PDF templates support export endpoint
- Templates → OG Image: supports · Template visuals feed social previews
- Resumes → Resume Model: lists · Browses stored resume records
- Dashboard → Upload Flow: routes to · Main dashboard links into upload flow
- Dashboard → Resumes: routes to · Dashboard surfaces resume management
- Dashboard → Builder: routes to · Dashboard surfaces builder entry
- Dashboard → Tailor: routes to · Dashboard surfaces tailoring tools
- Dashboard → Cover Letter: routes to · Dashboard surfaces cover-letter tool
- Dashboard → Interview Prep: routes to · Dashboard surfaces interview prep tool
- Dashboard → LinkedIn: routes to · Dashboard surfaces LinkedIn tool
- Dashboard → Public Assets: shares assets · App can reference static delivery assets