Backend:
cd backend
npm installFrontend:
cd frontend
npm installBackend - Copy .env.example to .env:
cd backend
Copy-Item .env.example .envEdit backend\.env and add your OpenAI API key:
OPENAI_API_KEY=sk-your-actual-openai-api-key-hereFrontend - Copy .env.example to .env:
cd frontend
Copy-Item .env.example .envOption A: Using Docker (Recommended)
Start PostgreSQL and PlantUML server:
docker-compose up -dOption B: Manual Setup
- Install PostgreSQL 14+ and create database:
CREATE DATABASE uml_generator;- Run PlantUML server separately:
docker run -d -p 8080:8080 plantuml/plantuml-server:jettyUpdate your backend\.env with the correct database URL:
DATABASE_URL="postgresql://uml_user:uml_password@localhost:5432/uml_generator"Run Prisma migrations:
cd backend
npm run prisma:generate
npm run prisma:migrateTerminal 1 - Backend:
cd backend
npm run devBackend will run on http://localhost:3000
Terminal 2 - Frontend:
cd frontend
npm run devFrontend will run on http://localhost:5173
Navigate to http://localhost:5173 in your browser
- Enter a project title (e.g., "Online Shopping System")
- Describe your system in the prompt textarea
- Select diagram types (Class, Sequence, Activity, Use Case)
- Click "Generate UML Diagrams"
- View and download generated diagrams
Design an online shopping system where customers can:
- Browse products by category
- Search for products
- Add products to shopping cart
- Manage cart (update quantities, remove items)
- Checkout and place orders
- Pay via credit card or UPI
- Track order status
- View order history
Include:
- User authentication and registration
- Product catalog management
- Inventory management
- Order processing
- Payment gateway integration
- Check if PostgreSQL is running:
docker psor check Windows services - Verify DATABASE_URL in
.env - Ensure OpenAI API key is valid
- Verify backend is running on port 3000
- Check VITE_API_URL in
frontend\.env - Check browser console for CORS errors
- Verify PlantUML server is running: http://localhost:8080
- Check PLANTUML_SERVER_URL in
backend\.env - View backend logs for rendering errors
- Ensure PostgreSQL is running
- Verify database credentials
- Run:
npm run prisma:studioto test connection
cd frontend
npm run buildcd backend
npm run buildcd backend
npm start- Set
NODE_ENV=production - Use secure JWT_SECRET
- Configure proper CORS origins
- Use managed PostgreSQL service
- Consider using a CDN for static assets
cd backend
npm run prisma:studiocd backend
npx prisma migrate dev --name your_migration_namecd backend
npx prisma migrate resetPOST /api/projects
{
"title": "Project Name",
"prompt": "System description...",
"diagramTypes": ["CLASS", "SEQUENCE", "ACTIVITY", "USE_CASE"]
}
GET /api/projects/:id
GET /api/projects
POST /api/diagrams/projects/:projectId/diagrams/:diagramId/regenerate
GET /api/diagrams/:diagramId/image
GET /api/diagrams/:diagramId/source
┌─────────────┐ ┌─────────────┐ ┌──────────────┐
│ React │─────▶│ Express │─────▶│ PostgreSQL │
│ Frontend │ │ Backend │ │ Database │
└─────────────┘ └─────────────┘ └──────────────┘
│
├─────▶ OpenAI API
│
└─────▶ PlantUML Server
- Frontend: React, TypeScript, TailwindCSS, React Query, Vite
- Backend: Node.js, Express, TypeScript, Prisma ORM
- Database: PostgreSQL
- LLM: OpenAI GPT-4
- Diagrams: PlantUML, Mermaid
- Auth: JWT (optional)
For issues or questions:
- Check this documentation
- Review error logs in terminal
- Check browser developer console
- Verify all services are running
- Ensure environment variables are set correctly