How darshan-beep/ai-developer works
This is an AI-assisted website builder: users authenticate, create projects from prompts, watch generated files arrive, refine them through chat or live code edits, then preview and publish the result. The client coordinates project state and API requests; server routes dispatch to authenticated controllers, which persist project state and call AI generation or revision services. The graph preserves authentication, project management, editing, preview, and public publishing. Some unsampled components are represented by their exact paths; their internal wiring is omitted where source excerpts do not establish it.
Main entry points: AppContext.jsx Client project state · App.jsx Route application · ai.js Generate and revise · BuilderPage.jsx Project builder
Components 27
Builder client
- Route application
client/src/App.jsx - Sign-in and registration
client/src/pages/AuthPage.jsx - Project home
client/src/pages/HomePage.jsx - Project builder
client/src/pages/BuilderPage.jsx - Client project state
client/src/context/AppContext.jsx - HTTP client
client/src/api/api.js
Application API
- Authentication routes
server/routes/Authroutes.js - Project routes
server/routes/projectroutes.js - Account operations
server/controllers/AuthController.js - Project operations
server/controllers/ProjectController.js - Chat revisions
server/controllers/Chatcontroller.js - Session authentication
server/middleware/Authmiddleware.js
AI generation
- Generate and revise
server/services/ai.js - Generation prompts
server/services/prompts.js - Code validation
server/services/codeValidator.js - Patch operations
server/services/diff.js
Identity and projects
- Project records
server/models/Project.js - User records
server/models/Usermodel.js
Preview and publish
- Private preview page
client/src/pages/PreviewPage.jsx - Interactive preview
client/src/components/PreviewPanel.jsx - Full-page preview
client/src/components/FullPagePreview.jsx - Dependency detection
client/src/utils/sandpackUtils.js - Preview error monitor
client/src/components/SandpackErrorMonitor.jsx - Public project page
client/src/pages/PublishPage.jsx - Publish controls
client/src/components/Publishmodel.jsx
Other components
- User
- OpenRouter model service
Connections 37
- User → Route application: uses
- Route application → Sign-in and registration: routes to
client/src/App.jsx - Route application → Project home: routes to
client/src/App.jsx - Route application → Project builder: routes to
client/src/App.jsx - Route application → Private preview page: routes to
client/src/App.jsx - Route application → Public project page: routes to
client/src/App.jsx - Sign-in and registration → Client project state: uses
client/src/pages/AuthPage.jsx - Project home → Client project state: uses
client/src/pages/HomePage.jsx - Project builder → Client project state: uses
client/src/pages/BuilderPage.jsx - Client project state → HTTP client: sends requests
client/src/context/AppContext.jsx - Client project state → Authentication routes: calls auth endpoints
client/src/context/AppContext.jsx - Client project state → Project routes: calls project endpoints
client/src/context/AppContext.jsx - Authentication routes → Session authentication: protects session check
server/routes/Authroutes.js - Authentication routes → Account operations: dispatches
server/routes/Authroutes.js - Project routes → Session authentication: authenticates
server/routes/projectroutes.js - Project routes → Project operations: dispatches
server/routes/projectroutes.js - Project routes → Chat revisions: dispatches chat
server/routes/projectroutes.js - Account operations → User records: reads and writes
server/controllers/AuthController.js - Project operations → Project records: reads and writes
server/controllers/ProjectController.js - Project operations → Generate and revise: generates project
server/controllers/ProjectController.js - Chat revisions → Project records: reads and writes
server/controllers/Chatcontroller.js - Chat revisions → Generate and revise: requests revision
server/controllers/Chatcontroller.js - Chat revisions → Patch operations: applies operations
server/controllers/Chatcontroller.js - Generate and revise → Generation prompts: builds prompts
server/services/ai.js - Generate and revise → Code validation: validates code
server/services/ai.js - Generate and revise → OpenRouter model service: requests generation
server/services/ai.js - Private preview page → Client project state: loads project
client/src/pages/PreviewPage.jsx - Private preview page → Full-page preview: renders
client/src/pages/PreviewPage.jsx - Project builder → Interactive preview: renders
client/src/pages/BuilderPage.jsx - Interactive preview → Client project state: saves live edits
client/src/components/PreviewPanel.jsx - Interactive preview → Dependency detection: detects dependencies
client/src/components/PreviewPanel.jsx - Interactive preview → Preview error monitor: monitors errors
client/src/components/PreviewPanel.jsx - Full-page preview → Dependency detection: detects dependencies
client/src/components/FullPagePreview.jsx - Full-page preview → Preview error monitor: monitors errors
client/src/components/FullPagePreview.jsx - Project builder → Publish controls: renders controls
client/src/pages/BuilderPage.jsx - Public project page → Full-page preview: renders preview
client/src/pages/PublishPage.jsx - Public project page → HTTP client: loads project
client/src/pages/PublishPage.jsx