How jashanpreet-82099/ai-portfolio works
AI Builder turns a user’s prompt into an editable website: authenticated users create projects, generate and refine HTML using AI, preview it safely, then publish through Vercel or GitHub. The surrounding product adds project management, community browsing/likes, account verification and settings, and credit purchases. The graph follows sampled routing, controller, generation, payment, and preview code; several README-described UI and community details have only tree-level evidence, so uncertain internal calls are omitted.
Main entry points: App.jsx App routes · api.js API client · project.controller.js Project and generation logic · server.js API server
Components 34
Web client
- App routes
FrontEnd/src/App.jsx - Auth and theme state
FrontEnd/src/context/AuthContext.jsx - Dashboard
FrontEnd/src/Pages/DashboardPage.jsx - Website builder
FrontEnd/src/Pages/BuilderPage.jsx - Live preview
FrontEnd/src/Pages/PreviewPage.jsx - Safe HTML preview
FrontEnd/src/utils/safePreview.js - Community gallery
FrontEnd/src/Pages/CommunityPage.jsx - Pricing and credits
FrontEnd/src/Pages/PricingPage.jsx - Profile settings
FrontEnd/src/Pages/SettingsPage.jsx - API client
FrontEnd/src/utils/api.js
Identity
- Auth routes
BackEnd/routes/auth.routes.js - Auth and account logic
BackEnd/controllers/auth.controller.js - JWT auth guard
BackEnd/middleware/Auth.js - User records
BackEnd/models/User.js - OTP and email services
BackEnd/utils/services.js
Site creation
- Project routes
BackEnd/routes/project.routes.js - Project and generation logic
BackEnd/controllers/project.controller.js - Project records
BackEnd/models/Project.js - AI generation services
BackEnd/utils/services.js - Fallback site generator
BackEnd/utils/mockGenerator.js
Publishing and community
- Deploy routes
BackEnd/routes/project.deploy.js - Community routes
BackEnd/routes/community.routes.js - Community logic
BackEnd/controllers/communityController.js - External service helpers
BackEnd/utils/services.js
Credits and billing
- Payment routes
BackEnd/routes/payment.routes.js - Payment and credit logic
BackEnd/controllers/payment.controller.js - Payment records
BackEnd/models/Payment.js
Other components
- Visitor / creator
- API server
BackEnd/server.js - MongoDB
- AI model APIs
- Brevo email
- Stripe
- Vercel
Connections 48
- Visitor / creator → App routes: uses
- App routes → Dashboard: routes to
- App routes → Website builder: routes to
- App routes → Live preview: routes to
- App routes → Community gallery: routes to
- App routes → Pricing and credits: routes to
- App routes → Profile settings: routes to
- Dashboard → API client: requests projects
- Website builder → API client: requests generation
- Live preview → API client: loads project
- Live preview → Safe HTML preview: sanitizes HTML
- Community gallery → API client: requests gallery
- Pricing and credits → API client: requests billing
- Profile settings → API client: requests account
- App routes → Auth and theme state: provides state
- API client → API server: HTTP requests
- API server → Auth routes: mounts
- API server → Project routes: mounts
- API server → Community routes: mounts
- API server → Payment routes: mounts
- Auth routes → Auth and account logic: dispatches
- Auth routes → JWT auth guard: guards routes
- Auth and account logic → User records: reads and writes
- Auth and account logic → Project records: reads activity
- Auth and account logic → OTP and email services: issues and verifies OTP
- OTP and email services → Brevo email: sends mail
- JWT auth guard → User records: loads identity
- Project routes → JWT auth guard: guards routes
- Project routes → Project and generation logic: dispatches
- Project routes → Deploy routes: dispatches deploy
- Project and generation logic → Project records: reads and writes
- Project and generation logic → User records: checks and updates credits
- Project and generation logic → AI generation services: enhances and generates
- Project and generation logic → Fallback site generator: generates fallback
- AI generation services → AI model APIs: calls model APIs
- Project records → MongoDB: persists
- User records → MongoDB: persists
- Deploy routes → External service helpers: publishes project
- External service helpers → Vercel: deploys site
- Community routes → Community logic: dispatches
- Community logic → Project records: reads and updates
- Payment routes → JWT auth guard: guards routes
- Payment routes → Payment and credit logic: dispatches
- Payment and credit logic → Payment records: reads and writes
- Payment and credit logic → User records: adds purchased credits
- Payment and credit logic → External service helpers: creates and verifies checkout
- External service helpers → Stripe: handles checkout
- Payment records → MongoDB: persists