You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd backend
npm run dev # Start development server with hot reload
npm run build # Compile TypeScript to JavaScript
npm start # Run production build
Database
npm run prisma:generate # Generate Prisma Client
npm run prisma:migrate # Run database migrations
npm run prisma:studio # Open Prisma Studio (database GUI)
Database Migrations
# Create a new migration
npx prisma migrate dev --name add_user_table
# Apply migrations in production
npx prisma migrate deploy
# Reset database (WARNING: deletes all data)
npx prisma migrate reset
# View migration status
npx prisma migrate status
Frontend Commands
Development
cd frontend
npm run dev # Start development server (http://localhost:5173)
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
Docker Commands
Start Services
docker-compose up -d # Start all services in background
docker-compose up plantuml # Start only PlantUML server
docker-compose up postgres # Start only PostgreSQL
Stop Services
docker-compose down # Stop all services
docker-compose down -v # Stop and remove volumes (deletes data)
# Health checkInvoke-WebRequest http://localhost:3000/health
# Create project (requires auth)$body=@{
title="Test Project"prompt="Design a simple user management system"diagramTypes=@("CLASS","SEQUENCE")
} |ConvertTo-JsonInvoke-WebRequest-Uri http://localhost:3000/api/projects -Method POST -Body $body-ContentType "application/json"
Test PlantUML Server
# Check if PlantUML is runningInvoke-WebRequest http://localhost:8080
Complete Setup from Scratch
# 1. Clone/navigate to project
cd c:\Users\aades\OneDrive\Desktop\diagra
# 2. Install backend dependencies
cd backend
npm install
Copy-Item .env.example .env
# Edit .env and add your OPENAI_API_KEY# 3. Install frontend dependencies
cd ..\frontend
npm install
Copy-Item .env.example .env
# 4. Start Docker services
cd ..
docker-compose up -d
# 5. Setup database
cd backend
npm run prisma:generate
npm run prisma:migrate
# 6. Start backend (new terminal)
npm run dev
# 7. Start frontend (new terminal)
cd ..\frontend
npm run dev
# 8. Open browser# Navigate to http://localhost:5173
Cleanup
Remove all data and start fresh
# Stop all services
docker-compose down -v
# Remove node_modulesRemove-Item-Recurse -Force backend\node_modules
Remove-Item-Recurse -Force frontend\node_modules
# Remove build artifactsRemove-Item-Recurse -Force backend\dist
Remove-Item-Recurse -Force frontend\dist
# Reinstall
cd backend ; npm install
cd ..\frontend ; npm install