Skip to content

JasonToups/ai-website-generator

Repository files navigation

AI Website Generator

A CrewAI-powered website builder that uses a team of AI agents (Product Manager, UI/UX Designer, and Software Engineer) to generate React applications with Tailwind CSS.

πŸš€ Quick Start

# Complete setup and start development
make setup
make dev

That's it! The backend will be available at http://localhost:8000 and the frontend at http://localhost:5173.

πŸ“‹ Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Poetry (for Python dependency management)
  • An Anthropic API key

πŸ› οΈ Installation

Option 1: Using Makefile (Recommended)

# Install all dependencies
make install

# Create .env file and complete setup
make setup

# Start development servers
make dev

Option 2: Manual Installation

  1. Install backend dependencies:

    poetry install
  2. Install frontend dependencies:

    cd frontend
    npm install
  3. Set up environment variables:

    cp .env.example .env
    # Edit .env and add your ANTHROPIC_API_KEY

πŸ”§ Configuration

Add your Anthropic API key to the .env file:

ANTHROPIC_API_KEY=your_anthropic_api_key_here

🎯 Usage

Development

# Start both backend and frontend
make dev

# Start only backend
make backend

# Start only frontend
make frontend

Testing & Quality

# Run all tests
make test

# Lint code
make lint

# Format code
make format

Production

# Build for production
make build

# Start production server
make start

πŸ“ Project Structure

ai-website-generator/
β”œβ”€β”€ backend/                 # FastAPI backend
β”‚   β”œβ”€β”€ agents/             # CrewAI agents
β”‚   β”‚   β”œβ”€β”€ product_manager.py
β”‚   β”‚   β”œβ”€β”€ ui_designer.py
β”‚   β”‚   └── software_engineer.py
β”‚   β”œβ”€β”€ api/                # API routes
β”‚   β”œβ”€β”€ crew/               # CrewAI crew configuration
β”‚   β”œβ”€β”€ mcp/                # MCP server integrations
β”‚   └── utils/              # Utility functions
β”œβ”€β”€ frontend/               # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # React components
β”‚   β”‚   └── lib/           # Utilities
β”‚   └── public/
β”œβ”€β”€ generated/              # Generated websites
β”œβ”€β”€ data/                   # Project data storage
β”œβ”€β”€ memory-bank/           # AI memory and documentation
└── Makefile              # Development commands

πŸ€– How It Works

  1. Product Manager Agent: Analyzes requirements and creates project specifications
  2. UI/UX Designer Agent: Creates design systems and component specifications
  3. Software Engineer Agent: Implements the React application with TypeScript and Tailwind CSS

The agents work together in sequence to deliver a complete, production-ready website.

🌐 API Endpoints

  • GET / - API information
  • GET /health - Health check
  • POST /api/v1/generate - Start website generation
  • GET /api/v1/projects/{id}/status - Get project status
  • GET /api/v1/projects - List all projects
  • GET /api/v1/projects/{id}/files - Get generated files

πŸ“– Available Make Commands

Run make help to see all available commands:

Setup & Installation

  • make setup - Complete project setup
  • make install - Install all dependencies

Development

  • make dev - Start both servers
  • make backend - Start FastAPI server
  • make frontend - Start React server

Testing & Quality

  • make test - Run all tests
  • make lint - Lint code
  • make format - Format code

Production

  • make build - Build for production
  • make start - Start production server

Utilities

  • make clean - Clean build artifacts
  • make reset - Reset project state
  • make logs - Show application logs
  • make health - Check application health
  • make status - Show project status

πŸ” Development Workflow

  1. Start development:

    make dev
  2. Make changes to code

  3. Test and lint:

    make quick-test
  4. Generate a website:

    • Open http://localhost:5173
    • Enter website description and requirements
    • Watch the AI agents work together

πŸš€ Deployment

# Prepare for deployment
make deploy-prep

# Build production assets
make build

# Start production server
make start

πŸ§ͺ Testing

The project includes comprehensive testing:

  • Backend: pytest with async support
  • Frontend: Vitest with React Testing Library
  • Linting: flake8, mypy, ESLint
  • Formatting: black, isort, Prettier

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests: make quick-test
  5. Submit a pull request

πŸ“ License

This project is licensed under the MIT License.

πŸ†˜ Troubleshooting

Common Issues

Backend won't start:

  • Check that your ANTHROPIC_API_KEY is set in .env
  • Ensure Poetry dependencies are installed: make install

Frontend won't start:

  • Check Node.js version (18+ required)
  • Clear cache: make clean && make install

Generation fails:

  • Verify API key is valid
  • Check backend logs: make logs
  • Ensure all agents are properly configured

Getting Help

  • Check the logs: make logs
  • Verify health: make health
  • Reset project: make reset

For more help, check the memory-bank documentation or create an issue.

About

Generate Websites with the power of CrewAI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published