How souhaib-askri/plan-ai works
Plant-AI is a web application for creating and sharing PlantUML diagram projects. Its central workflow is diagram editing with AI assistance, followed by project persistence and image handling; users can also browse projects, copy them, and interact through likes and comments. The graph includes authentication, storage, and the application’s shared sidebar layer. Several routes and pages were not sampled, so their internal connections are omitted rather than inferred.
Main entry points: prisma.ts Database client · minIoControls.ts Diagram image controls · index.tsx App sidebar · route.ts Project API
Components 22
Identity and navigation
- Sign in
src/app/(auth)/signin/page.tsx - Authentication
src/lib/nextAuth.ts - App sidebar
src/components/app-sidebar/index.tsx - Main navigation
src/components/nav-main.tsx - Page navigation
src/components/nav-pages.tsx - User navigation
src/components/nav-user.tsx
Diagram authoring
- Diagram editor
src/app/project/[slug]/edit/components/DiagramEditor/index.tsx - AI assistant
src/app/project/[slug]/edit/components/AiAssistant.tsx - AI endpoint
src/app/api/ai/route.ts
Projects and community
- Project API
src/app/api/projects/[slug]/route.ts - Project view
src/app/(ui)/project/[slug]/page.tsx - Project copying
src/app/api/projects/[slug]/copy/route.ts - Project comments
src/components/ProjectComments/ProjectComments.tsx - Project likes
src/components/LikeProject/LikeProject.tsx
Data and storage
- Project lookup
src/db/getProjectById.ts - Database client
src/lib/prisma.ts - Diagram image controls
src/lib/minIoControls.ts - S3 client
src/lib/s3.ts
Other components
- User
- PlantUML service
- S3 object storage
- AI model providers
Connections 22
- User → Sign in: signs in
- Sign in → Authentication: authenticates with
- Authentication → Database client: configures adapter
src/lib/nextAuth.ts - App sidebar → Main navigation: renders
src/components/app-sidebar/index.tsx - App sidebar → Page navigation: renders
src/components/app-sidebar/index.tsx - App sidebar → User navigation: renders
src/components/app-sidebar/index.tsx - User → Diagram editor: edits diagrams
- AI assistant → AI endpoint: requests assistance
- AI endpoint → AI model providers: invokes model
src/app/api/ai/route.ts - AI endpoint → Database client: stores conversations
src/app/api/ai/route.ts - User → Project view: views projects
- Project API → Project lookup: loads project
src/app/api/projects/[slug]/route.ts - Project API → Database client: updates project
src/app/api/projects/[slug]/route.ts - Project API → Diagram image controls: deletes images
src/app/api/projects/[slug]/route.ts - Project copying → Database client: copies project data
src/app/api/projects/[slug]/copy/route.ts - Project copying → Diagram image controls: generates and uploads images
src/app/api/projects/[slug]/copy/route.ts - Project comments → User: supports discussion
- Project likes → User: supports liking
- Project lookup → Database client: queries
src/db/getProjectById.ts - Diagram image controls → PlantUML service: renders diagram images
src/lib/minIoControls.ts - Diagram image controls → S3 client: uses client
src/lib/minIoControls.ts - S3 client → S3 object storage: accesses objects