Domain Modelling Copilot is an intelligent web-based assistant that revolutionizes how you create domain models from natural language descriptions. Simply describe your business ideas, software requirements, or system concepts in plain English, and watch as our AI-powered tool transforms them into professional domain models and UML diagrams automatically.
Domain modeling is a crucial skill in software engineering, but traditional approaches often require learning complex tools and manual diagram creation, which can be time-consuming and intimidating for students and professionals alike. This project addresses the gap between natural language requirements and structured domain models by leveraging AI technology. Our motivation is to democratize domain modeling by making it accessible through conversational interfaces, allowing users to focus on the conceptual aspects rather than technical tool mastery. This approach not only accelerates the learning process for students but also enhances productivity for experienced practitioners who need to quickly prototype and iterate on domain models.
- Talk Naturally - Simply describe your project ideas in everyday language through a chat interface
- Helpful Suggestions - The system guides you by asking questions when your description needs more details
- Instant Models - Turn your written descriptions into professional business models automatically
- Visual Diagrams - Generate clear, easy-to-read diagrams that show how your system works
- Change Anything - Add, remove, or modify parts of your model with simple Inputs.
- Safety Checks - The system asks for confirmation before deleting important parts to prevent mistakes.
- Never Lose Work - Every change is automatically saved as a new version of your project
- Easy Undo - Go back to any previous version with one click if you don't like the changes
- Always Available - Your projects are safely stored and available whenever you come back
- Multiple Projects - Work on several different projects at the same time without mixing them up
The domain model illustrating the core entities, relationships, and business logic of the Domain Modelling Copilot system.
System context showing external entities and their interactions with the Domain Modelling Copilot.
Activity flow diagram depicting the complete user workflow from requirement input to domain model generation.
- Python 3.9+
- Flask (Web Framework)
- OpenAI API (Natural Language Processing)
- MongoDB (Database & Version Control)
- PlantUML (Diagram Generation)
- dotenv (Environment Configuration)
- pytest (Testing Framework)
domain-modelling-copilot/
├── .env # Environment variables (API keys, DB config)
├── .gitignore # Git ignore rules
├── README.md # Project documentation
├── requirements.txt # Python dependencies
├── run.py # Application entry point
│
├── src/ # Source code directory
│ ├── app.py # Main Flask application with routes
│ │
│ ├── controller/ # Request handlers and route logic
│ │ ├── __init__.py
│ │ ├── chat_controller.py # Chat and UML generation endpoints
│ │ └── project_controller.py # Project management endpoints
│ │
│ ├── model/ # Business logic and data models
│ │ ├── __init__.py
│ │ ├── chat_history.py # Chat message storage and management
│ │ ├── domain_model_description.py # Domain model text representation
│ │ ├── gpt2.py # OpenAI integration and PlantUML generation
│ │ ├── llm_service.py # Language model orchestration service
│ │ ├── openai_client.py # OpenAI API client configuration
│ │ └── project_service.py # MongoDB operations and version control
│ │
│ └── view/ # Frontend templates and static assets
│ ├── templates/
│ │ └── index.html # Main application interface
│ └── static/
│ ├── css/
│ │ └── style.css # Application styling
│ └── js/
│ ├── app-controller.js # Main application logic
│ ├── chat-view.js # Chat interface management
│ ├── project-view.js # Project selection and management
│ ├── uml-view.js # UML diagram rendering
│ └── main.js # Application initialization
│
└── tests/ # Test suite
└── __init__.py
Before running the application, ensure you have the following installed:
python --version
Required: Python 3.9 or higher
If Python is not installed or the version is below 3.9:
- Windows: Download from python.org
- macOS: Use Homebrew:
brew install python@3.9
- Linux: Use your package manager:
sudo apt install python3.9
pip --version
Upgrade pip to the latest version:
python -m pip install --upgrade pip
Required: MongoDB for data storage and version control
- Windows: Download from MongoDB Download Center
- macOS: Use Homebrew:
brew install mongodb-community
- Linux: Follow the MongoDB Installation Guide
Start MongoDB Server:
mongod
git clone https://github.com/DarshanScripts/domain-modelling-copilot.git
cd domain-modelling-copilot
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
Note: Virtual environment is recommended but not required. It helps isolate project dependencies from your system Python installation. If you prefer to install packages globally, you can skip this step.
pip install -r requirements.txt
- Open MongoDB Compass (or your preferred MongoDB client)
- Click "Connect" or "New Connection"
- Enter Connection String:
mongodb://localhost:27017
- Create Database: Create a new database named
DMC
(Domain Modelling Copilot) or any name you prefer - Update .env file if you chose a different database name:
MONGODB_URI="mongodb://localhost:27017/your_database_name"
Update the .env
file in the root directory with your OpenAI API key:
GPT_MODEL="gpt-4o-mini"
OPENAI_API_KEY="your_openai_api_key_here"
MONGODB_URI="mongodb://localhost:27017/"
Replace "your_openai_api_key_here"
with your actual OpenAI API key.
python run.py
Visit: http://localhost:5000
-
Access the Application: Open your browser and navigate to
http://localhost:5000
-
Input Scenarios: Enter natural language descriptions of your domain scenarios in the chat interface. Be descriptive and include:
- Business Context: What kind of system or business you're modeling
- Key Entities: Main objects, people, or concepts in your domain
- Relationships: How different entities interact with each other
- Business Rules: Important constraints or processes
Example Scenarios:
"I want to model an online bookstore system where customers can browse books, add them to cart, place orders, and make payments. The system should track inventory, manage customer accounts, and handle order fulfillment."
"Create a domain model for a university course registration system. Students can enroll in courses, professors teach courses, and courses have prerequisites. The system tracks grades, schedules, and student progress."
-
Interact with AI Assistant: If your description needs more details, the system will ask follow-up questions like:
- "What types of users will interact with this system?"
- "How do customers make payments?"
- "What information should be stored about each entity?"
-
Generate Models: Once you provide sufficient information, the system will automatically:
- Create a natural language description of your domain model
- Generate a visual domain model diagram
- Produce PlantUML diagrams for technical documentation
-
View and Edit Results:
- Review the generated domain model description
- Examine the visual diagrams
- Make changes by chatting: "Add a discount system" or "Remove the inventory tracking"
-
Version Control & Saving:
- Automatic Saving: All changes are automatically saved as new versions in MongoDB
- Undo Changes: Click the "Undo" button to revert to the previous version before saving your project
- Multiple Projects: Work on several different projects simultaneously with complete version history
Developed by Darshan Shah. Connect with me:
- LinkedIn: Darshan Shah
- Facebook: DarshanScripts
- GitHub: DarshanScripts
- Quora: Darshan Shah
- Medium: DarshanScripts
- Fiverr: DarshanScripts