This project is a tool for automatically generating a complete application with a Domain-Driven Design (DDD) model and application services from requirements and commands. It leverages Large Language Models (LLMs) to interpret natural language requirements and generate clean, well-structured code that follows DDD and onion architecture principles.
- Model Generation: Convert natural language requirements into a complete domain model with entities, value objects, aggregates, and repositories
- Application Services Generation: Create application services based on commands that interact with the domain model
- Infrastructure Code Generation: Generate the infrastructure layer based on the domain model and 'infrastructure requirements'
- Interface Generation: Generate an interface for the application (currently restricted to a CLI)
- Project Files Generation: Generate the project files, e.g. README, third-party dependencies, etc.
- Command-Line Interface: Easy-to-use CLI for all operations
- Requirements Collection: Users define model requirements, commands and infrastructure requirements in natural language
- App Generation: The system uses LLMs to interpret requirements and generate a the different application layers (onion architecture)
- Code Output: Generated code is written to the file system in the proper structure
- The ai-app-generator can generate itself from natural language requirements (CLI only)
- The generated application can be built incrementally by adding and modifying requirements
- Go beyond CLI applications, i.e. serverless
- Build a SaaS for generating applications from requirements
- Build a comprehensive requirements engineering SaaS that provides the base for generating applications using AI
# Clone the repository
git clone [email protected]:Flugtiger/ai-app-generator.git
cd ai-app-generator
# Install dependencies
pip install -e .
Create a model requirement:
python -m src.interface.cli.main model-requirement create --text "A model requirement"
Create a command:
python -m src.interface.cli.main command create --name MyFirstCommand --description "A command description"
Create an infrastructure requirement:
python -m src.interface.cli.main infrastructure-requirement create --text "An infra requirement"
You can generate the layers of an application one by one (in the correct order: application and infrastructure depend on the model; the interface depends on application, model and infrastructure; the project files depend on the interface and infrastructure layers):
python -m src.interface.cli.main generate model
python -m src.interface.cli.main generate application
python -m src.interface.cli.main generate infrastructure
python -m src.interface.cli.main generate interface
python -m src.interface.cli.main generate project
You can also generate the complete application in one go:
python -m src.interface.cli.main generate all
Warning
Generating the ai-app-generator itself currently costs about 0,60$ (using claude-3-7-sonnet-latest)
The ai-app-generator can generate itself from its own requirements. To do so, use the following workflow:
./ingest_model_reqs.sh
./ingest_commands.sh
./ingest_infra_reqs.sh
python -m src.interface.cli.main generate all
Note: There is currently an incompatibility between the libraries 'tree-sitter' and 'tree-sitter-languages' that are used by Claude to implement the CodeCompressor service. To fix this, replace 'tree-sitter-languages' with 'tree-sitter-language-pack' in the generated app. Sadly, Claude doesn't know about this new library yet.
- Python 3.8 or higher
- Access to an LLM API (currently configured for Anthropic Claude)
-
Clone the repository:
git clone [email protected]:Flugtiger/ai-app-generator.git cd ai-app-generator
-
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install in development mode:
pip install -e .
-
Set up your API key:
export ANTHROPIC_API_KEY=your_api_key_here # On Windows: set ANTHROPIC_API_KEY=your_api_key_here
pytest
src/application
: Contains application servicessrc/model
: Contains the domain modelsrc/infrastructure
: Contains infrastructure implementationssrc/interface
: Command-line interfacerequirements
: Requirements for the ai-app-generator itself
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.