How justintimejt/crackdresume works
Project type and purpose
• Project type: Full-stack web application built with Next.js 15 (React + TypeScript).
• Purpose: AI-powered resume generation—take user input, invoke Google Gemini to produce LaTeX, compile to PDF, return outputs, optionally open in Overleaf, all without requiring login.
File structure
• src/app: Next.js “App Router” layers (pages, layouts, client/server components).
• /api/compile-pdf-online and /api/generate – serverless API routes.
• /build – React pages for the LaTeX compile flow.
• /components – shared UI pieces (Form, TemplateSelector, LoadScreen).
• /result – render final PDF download page.
• src/lib: wrappers for Supabase admin (server) and client (browser) SDKs.
• public/assets: static images.
• Config files: next.config.ts, postcss.config.mjs, eslint.config.mjs, tsconfig.json.
Extract architecture insights from README
• Frontend: React + Next.js + Tailwind CSS
• Backend: Next.js serverless API routes running Node.js
• Database: Supabase (PostgreSQL) accessed via RLS, temporary storage of resume data
• AI Engine: Google Gemini Flash 1.5 external API
• Deployment: Vercel (serverless functions + CDN)
Main components
a. User’s Browser (Client)
b. Next.js Frontend (React pages & client components)
c. Next.js Server (Serverless Functions):
• compile-pdf-online route
• generate route
d. Supabase Database (PostgreSQL) + RLS policies
e. Supabase Admin & Client SDK layers
f. Google Gemini Flash 1.5 AI API
g. LaTeX Compiler (built into serverless function runtime)
h. Overleaf (external link/integration)
i. Deployment Platform: Vercel
Relationships & data flows
1) User inputs resume content via Next.js Form component.
2) Frontend posts to /api/generate →
• Next.js function uses Gemini API key to call Google Gemini.
• Receives enhanced content/LaTeX source.
• Optionally stores raw input + generated LaTeX in Supabase via Admin SDK.
3) Frontend invokes /api/compile-pdf-online →
• Takes LaTeX, compiles to PDF in the serverless environment.
• Stores PDF blob temporarily (e.g., Supabase Storage or in-memory).
4) Next.js returns download URL or PDF stream to client.
5) Client displays PDF and “Edit in Overleaf” link pointing to externally hosted Overleaf project.
6) Supabase enforces RLS to ensure data expires after 24h, no persistent user accounts.
Architectural patterns and design principles
• Monolithic Next.js app with clear separation:
• Frontend (React + client components)
• Backend (API routes = serverless functions)
• Server-side rendering / client-side hydration hybrid.
• “Backend-for-Frontend” pattern: API routes tailor responses to the UI needs.
• External service integration: Google Gemini and Overleaf.
• Data layer abstraction: src/lib/supabase-admin.ts (server) vs. src/lib/supabase-client.ts (client).