An AI-powered system for automatically generating and testing 1-page websites based on simple descriptions.
This system uses large language models (LLMs) and browser automation to:
- Generate detailed requirements and acceptance criteria from a simple description
- Create a complete Flask website implementation based on those requirements
- Test the website against the acceptance criteria using browser automation
- Iteratively improve the website until all criteria are met
The system uses a directed graph-based workflow to manage the process, with nodes for requirements generation, script generation, testing, and code editing.
- Python 3.11 or higher
- pip package manager
- Clone the repository:
git clone https://github.com/ta-klauz/agentic-website-dev.git
cd agentic-website-dev- Install dependencies:
pip install -r requirements.txt- Install Playwright browsers
playwright install- Set up your OpenAI API key:
export OPENAI_API_KEY=your_api_key_here- Enable LangSmith tracing (optional but recommended):
export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY="<your-langsmith-api-key>"For detailed LangSmith setup instructions, visit the LangSmith documentation.
Run the main script with a description of the website you want to create:
python main.py --description "Create a landing page for a coffee shop with a menu, about section, and contact form"This will generate a complete Flask website with HTML, CSS, and JavaScript, and test it against the automatically generated requirements.
Example usage is provided in the examples directory:
python examples/simple_website_generation.pymain.py: Main entry point for website generationexamples/: Contains example scripts showing how to use the systemnodes/: Individual workflow components (requirements generation, script generation, testing, code editing)
The graph-based workflow consists of the following steps, which are implemented as Langgraph nodes:
- Requirements Generation: Converts a brief description into detailed requirements and acceptance criteria
- Script Generation: Creates a 1-page Flask website implementation
- Testing: Uses browser automation to test the website against each acceptance criteria
- Code Editing: Fixes any issues identified during testing Steps 3-4 are repeated until all criteria are met or maximum iterations are reached
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
When using this system, follow these security guidelines to protect sensitive data and ensure safe execution:
- Never hardcode API keys in scripts or commit them to version control.
- Use environment variables to store your API keys:
export OPENAI_API_KEY=your_api_key_here - For production, use secure secret management tools.
- Run in a sandboxed environment when possible to isolate the system.
- Use virtual environments to manage dependencies:
python -m venv venv source venv/bin/activate # Linux/Mac .\venv\Scripts\activate # Windows
- LangChain for the LLM integration framework
- LangGraph for the workflow graph structure
- browser_use package for browser automation