How anuritik/builder-ai works
This is an AI-assisted React website builder: users sign in, describe a site, watch it generate, revise and edit its files, preview it, and publish it. The graph separates the browser experience, server request handling, project state, and AI generation/revision. It also includes the documented-by-code preview and publishing paths. Evidence is limited to the README (empty), SOURCE INDEX references, and excerpts; unsampled subsystem details and unsupported connections are omitted.
Main entry points: AppContext.jsx App state and actions · App.jsx Page routing · BuilderPage.jsx Project builder · ai.js Generation and revision
Components 27
Builder interface
- Page routing
client/src/App.jsx - Sign in
client/src/pages/AuthPage.jsx - Project home
client/src/pages/HomePage.jsx - Project builder
client/src/pages/BuilderPage.jsx - Revision chat
client/src/components/ChatPanel.jsx - File explorer
client/src/components/FileExplorer.jsx - Live editor preview
client/src/components/PreviewPanel.jsx - Full preview
client/src/pages/PreviewPage.jsx - Preview renderer
client/src/components/FullPagePreview.jsx - Public project page
client/src/pages/PublishPage.jsx - App state and actions
client/src/context/AppContext.jsx - HTTP client
client/src/api/api.js
Server workflows
- Project endpoints
server/routes/projectRoutes.js - Authentication endpoints
server/routes/authRoutes.js - Project workflow
server/controllers/projectController.js - Revision workflow
server/controllers/chatController.js - Account workflow
server/controllers/authController.js - Session verification
server/middleware/authMiddleware.js
AI generation
- Generation and revision
server/services/ai.js - AI prompts
server/services/prompts.js - Code validation
server/services/codeValidator.js - Patch operations
server/services/diff.js
Project state
- Project records
server/models/Project.js - User records
server/models/User.js
Other components
- User
- MongoDB
- AI model provider
Connections 34
- User → Page routing: uses
client/src/App.jsx - Page routing → Sign in: routes to
client/src/App.jsx - Page routing → Project home: routes to
client/src/App.jsx - Page routing → Project builder: routes to
client/src/App.jsx - Page routing → Full preview: routes to
client/src/App.jsx - Page routing → Public project page: routes to
client/src/App.jsx - Sign in → App state and actions: uses actions
client/src/pages/AuthPage.jsx - Project home → App state and actions: uses actions
client/src/pages/HomePage.jsx - Project builder → App state and actions: uses actions
client/src/pages/BuilderPage.jsx - Project builder → Revision chat: renders
client/src/pages/BuilderPage.jsx - Project builder → File explorer: renders
client/src/pages/BuilderPage.jsx - Project builder → Live editor preview: renders
client/src/pages/BuilderPage.jsx - Live editor preview → App state and actions: saves edits
client/src/components/PreviewPanel.jsx - Full preview → App state and actions: loads project
client/src/pages/PreviewPage.jsx - Full preview → Preview renderer: renders
client/src/pages/PreviewPage.jsx - Public project page → Preview renderer: renders
client/src/pages/PublishPage.jsx - App state and actions → HTTP client: calls
client/src/context/AppContext.jsx - App state and actions → Project endpoints: requests project API
client/src/context/AppContext.jsx - Project endpoints → Session verification: protects routes
server/routes/projectRoutes.js - Project endpoints → Project workflow: dispatches
server/routes/projectRoutes.js - Project endpoints → Revision workflow: dispatches chat
server/routes/projectRoutes.js - Authentication endpoints → Account workflow: dispatches
server/routes/authRoutes.js - Authentication endpoints → Session verification: checks session
server/routes/authRoutes.js - Project workflow → Project records: reads and writes
server/controllers/projectController.js - Project workflow → Generation and revision: generates project
server/controllers/projectController.js - Revision workflow → Project records: reads and writes
server/controllers/chatController.js - Revision workflow → Generation and revision: requests revision
server/controllers/chatController.js - Revision workflow → Patch operations: applies operations
server/controllers/chatController.js - Account workflow → User records: uses accounts
server/controllers/authController.js - Generation and revision → AI prompts: builds prompts
server/services/ai.js - Generation and revision → Code validation: validates code
server/services/ai.js - Generation and revision → AI model provider: calls model
server/services/ai.js - Project records → MongoDB: persists records
- User records → MongoDB: persists records