An intelligent system design assistant that guides users through a structured, multi-step process to create comprehensive system designs. Built with FastAPI backend and modern HTML/CSS/JavaScript frontend.
- Multi-Step Process: Guided workflow from initial question β clarifying questions β complete design
- AI-Powered: Uses Google's Gemini AI for intelligent responses
- Interactive UI: Beautiful, responsive interface with progress tracking
- Streaming Responses: Real-time streaming of AI responses
- Mermaid Diagrams: Automatic rendering of system architecture diagrams
- Export Functionality: Download complete designs as text files
- Comprehensive Logging: Detailed logging for monitoring and debugging
- Python 3.12+
- Google AI API Key (Get one here)
uvpackage manager (recommended) orpip
-
Clone the repository
git clone <repository-url> cd Design-Ai
-
Install dependencies
uv sync
-
Set up environment variables
export GOOGLE_API_KEY="your-google-ai-api-key-here" # or create a .env file with: GOOGLE_API_KEY=your-key-here
-
Run the application
# Using Makefile (recommended) make run # Or directly with uv uv run python run.py
-
Open the frontend
- Server: http://localhost:8000
- Frontend: Open
frontend/index.htmlin your browser
Design-Ai/
βββ backend/ # FastAPI backend
β βββ __init__.py
β βββ main.py # Main FastAPI application
βββ frontend/ # HTML/CSS/JS frontend
β βββ index.html # Main frontend file
βββ logs/ # Application logs
β βββ system_design_ai.log
βββ docs/ # Documentation
βββ static/ # Static assets (future use)
βββ run.py # Startup script
βββ Makefile # Development commands
βββ pyproject.toml # Project dependencies (uv)
βββ config.template # Environment config template
βββ uv.lock # Dependency lock file
βββ .gitignore # Git ignore rules
βββ README.md # This file
- User describes their system design challenge
- Examples: "Design a chat app like WhatsApp", "Build a URL shortener"
- AI asks 5-7 targeted questions to understand requirements
- Covers scale, functionality, performance, data, constraints
- User provides detailed answers
- AI generates comprehensive system design based on all gathered information
- Includes: Overview, Architecture, Components, Technology Stack, Scalability, Trade-offs
- Features Mermaid diagrams for visual architecture representation
POST /clarify- Generate clarifying questionsPOST /design- Generate final system design- Both endpoints support streaming responses
- Progress Bar: Visual indication of current step
- Responsive Design: Works on desktop and mobile
- Streaming UI: Real-time display of AI responses
- Section-Based Layout: Organized display of design components
- Export Function: Download designs as text files
- Mermaid Integration: Automatic diagram rendering
GOOGLE_API_KEY: Your Google AI API key (required)
- Logs are written to
logs/system_design_ai.log - Console output for development
- Configurable log levels
# Show all available commands
make help
# Complete setup (install dependencies + check config)
make setup
# Start development server with auto-reload
make dev
# Start production server
make run
# Check server status
make status
# View logs
make logs
# Stop server
make kill# Start backend with auto-reload using uv
uv run uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000
# Or use the startup script with uv
uv run python run.py- FastAPI: Modern web framework for APIs
- Uvicorn: ASGI server
- Google Generative AI: AI model integration
- Pydantic: Data validation
- "Design a URL shortener like bit.ly that can handle 100M URLs"
- "Create a chat application like WhatsApp for 1 billion users"
- "Build a video streaming platform like YouTube"
- "Design a ride-sharing system like Uber"
- How many users do you expect to use this system?
- What are the core features you want to implement?
- What are your performance requirements (latency, throughput)?
- What data do you need to store and how much?
- Are there any integration requirements with external systems?
- What are your constraints (budget, timeline, existing tech stack)?
- What are your non-functional requirements (security, compliance)?
-
Google AI API Key not set
- Error: "API key not configured"
- Solution: Set the
GOOGLE_API_KEYenvironment variable
-
Model not found errors
- Error: "models/gemini-2.5-flash is not found"
- Solution: Check your API key and model availability
-
CORS errors
- Error: "CORS Missing Allow Origin"
- Solution: Ensure the backend is running and CORS is configured
Check logs/system_design_ai.log for detailed error information and request tracking.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google AI for the Gemini model
- FastAPI for the excellent web framework
- Mermaid.js for diagram rendering
- The open-source community for inspiration and tools