Skip to content

AliSoleimaniNet/QuizDSL-Studio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛠️ QuizDSL Studio: AI-Powered Model-Driven Framework

QuizDSL Studio is an advanced end-to-end ecosystem for Model-Driven Software Development (MDSD). It leverages a custom Domain-Specific Language (DSL) built with Xtext, orchestrated by an ASP.NET Core 10 management studio, and powered by Local LLMs (Ollama) to transform natural language prompts into fully functional Python/Flask web applications.


📂 Repository Structure

The AI intelligence layer. This folder contains the blueprints for the LLM to understand and write our custom DSL.

  • Modelfile: The configuration to build the quiz-master model (base on gemma3:12b) in Ollama.
  • dotnethub.quiz: A real-world example of DSL code generated by the AI based on a complex Farsi prompt for a .NET Developer assessment platform.
  • dotnethub/: The final generated source code (Python/Flask) produced from the DSL.

The core grammar and language infrastructure.

  • org.example.quiz: The base project containing the Xtext Grammar (QuizDSL.xtext) and the Ecore Metamodel.
  • QuizDSLGenerator.java: The Xtend-based transformation engine that converts DSL models into Python code.
  • QuizCompiler.java: The source for the standalone compiler tool used to build the .jar binary.
  • model/generated/: Contains the Ecore Metamodel and the Generated Class Diagram (quizDSL class diagram.png).

The "Studio" — A modern web dashboard built with ASP.NET Core 10.

  • Orchestration: Manages the lifecycle of a quiz: AI Prompting → DSL Generation → Java Compilation → Python Execution.
  • Background Jobs: Uses Hangfire to manage long-running compilation and AI tasks.
  • Static Assets: Contains QuizCompiler.jar (the transpiler) and the UI built with Bootstrap.

The Eclipse Runtime workspace used during development to test the DSL editor, providing live validation and syntax highlighting for .quiz files.


⚙️ Technical Architecture

The project implements a 4-tier pipeline:

  1. Natural Language Input: User provides a prompt (e.g., "Create a Senior .NET quiz with Vazir font and dark theme").
  2. AI Generation (Ollama): The quiz-master model interprets the prompt and writes syntactically correct .quiz code.
  3. DSL Compilation (Java): The QuizCompiler.jar (Xtext/Xtend) parses the model and generates a Python/Flask web app.
  4. Deployment: The Studio executes the Python app on a dedicated port and captures an automated preview screenshot.

🌍 Localization & Extensibility

The current implementation is pre-configured for Persian (RTL) environments. While it's not a "one-click" setting yet, the framework is architecturally ready for global use:

  • AI Adaptability: To switch languages, the Modelfile can be edited to retrain the LLM's prompting logic for English DSL generation.
  • Code Generation: The Xtend Transformer code is modular, allowing developers to modify the templates to generate LTR layouts and English UI components.
  • Customization: By editing the core generator logic and the AI blueprints, the entire pipeline can be repurposed for any language or regional requirement.

🎥 Live Demo

See the QuizDSL Studio in action: From AI prompting to automated DSL generation and web deployment.

ModelManager.mp4

💡 Visual Overview:

  1. DSL-Generated Live Demo: Watch how the DSL transforms into a functional website.
  2. Live Monitoring & Process Control: Real-time logs and easy build management.
  3. Another Perspective: Switching between different generated models seamlessly.

📊 Metamodel & Grammar

The language is formally defined using an Ecore metamodel. You can find the visual representation here:

QuizDSL Class Diagram

The grammar supports:

  • Multiple Quiz levels (Junior, Mid-level, Senior).
  • Dynamic scoring and variable time limits per difficulty.
  • UI Customization (Fonts like "Vazirmatn", Themes, Shuffling).

🚀 Installation & Setup

Prerequisites

  • Ollama: For AI features.
  • Java JRE 21+: To run the compiler.
  • ASP.NET Core 10 Runtime: To run the Studio.
  • Python 3.x: To run the generated apps.

Step 1: Build the AI Model

cd AiModel
ollama create quiz-master -f Modelfile

Step 2: Configure the Studio

  1. Navigate to ModelManager/.
  2. Ensure QuizCompiler.jar is present in the root.
  3. Run the application:
dotnet run --urls "http://localhost:5005"

Step 3: Run a Build

Access the dashboard at http://localhost:5005. Create a "New Model", enter your prompt, and click Generate by AI followed by Build Model.


📝 Example Input (Prompt)

"A platform named 'DotNetHub' for assessing developers. Include 3 levels: Basic (Junior), Medium (Mid-level), and Advanced (Senior). 5 questions each. Scoring out of 20. Advanced level must be very difficult. Time limits: 3, 4, and 5 minutes respectively. Use 'Vazirmatn' font and a .NET-themed UI."


🛠 Built With

  • Xtext/Xtend - Language Development & Code Generation
  • ASP.NET Core 10 - Management Dashboard
  • Ollama (LLM) - Local AI Orchestration
  • Python/Flask - Target Runtime Environment
  • Hangfire - Background Job Processing

Developed by Ali Soleimani

About

An AI-powered MDSD framework using Xtext and .NET 10 to transform natural language prompts into custom DSL models and fully functional Python/Flask quiz applications.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors