Spaces:
Sleeping
Sleeping
| title: AI REST API Generator | |
| emoji: π€ | |
| colorFrom: blue | |
| colorTo: purple | |
| sdk: docker | |
| app_port: 7860 | |
| pinned: false | |
| license: mit | |
| # π€ AI REST API Generator | |
| **AI REST API Generator** is a developer-focused tool that automatically generates **Django REST Framework backends** using AI or manual configuration. | |
| It converts high-level requirements into a fully structured, runnable Django project with CRUD APIs, serializers, views, URLs, and settings. | |
| π§ **Status:** Under active development | |
| π§ **Contact:** [harshadhole04@gmail.com](mailto:harshadhole04@gmail.com) | |
| --- | |
| ## β¨ Features | |
| * β‘ **AI-Powered Backend Generation** | |
| * Generate Django REST APIs from natural language prompts | |
| * Automatically infers models, fields, and relationships | |
| * π§± **Manual Model Builder** | |
| * Define models, fields, relationships (One-to-One, One-to-Many) | |
| * Full control without AI if preferred | |
| * π§© **Schema-Driven Architecture** | |
| * JSON Schema validation before code generation | |
| * Auto-fixes common schema issues safely | |
| * π¦ **Complete Django Project Output** | |
| * Models, serializers, views, URLs | |
| * JWT authentication support | |
| * Database configuration (SQLite / PostgreSQL) | |
| * Static & media configuration | |
| * π₯ **One-Click Download** | |
| * Generated backend is zipped and ready to run | |
| * π§ **Pluggable LLM Support** | |
| * OpenAI | |
| * Groq | |
| * Easy to extend for other providers | |
| --- | |
| ## ποΈ Architecture Overview | |
| ``` | |
| Streamlit UI | |
| β | |
| Pipeline Orchestrator | |
| β | |
| LLM (Model Prompt / Spec Generation) | |
| β | |
| Schema Validation (JSON Schema) | |
| β | |
| Django Code Generator | |
| β | |
| Ready-to-run Django REST Project | |
| ``` | |
| --- | |
| ## π How It Works | |
| 1. **Input** | |
| * Project name & description | |
| * Choose AI-generated models or manual models | |
| * Select database and authentication | |
| * Provide LLM provider and API key | |
| 2. **Validation** | |
| * Generated spec is validated against a strict JSON schema | |
| * Automatic normalization and safe fixes applied | |
| 3. **Generation** | |
| * Django project is created in an isolated run directory | |
| * Apps, models, serializers, views, URLs, settings generated | |
| 4. **Output** | |
| * Project is zipped | |
| * Download instantly from the UI | |
| --- | |
| ## π₯οΈ Running Locally | |
| ### 1οΈβ£ Clone the Repository | |
| ```bash | |
| git clone https://github.com/harshadSH/ai-rest-api-generator.git | |
| cd ai-rest-api-generator | |
| ``` | |
| ### 2οΈβ£ Create Virtual Environment | |
| ```bash | |
| python -m venv venv | |
| source venv/bin/activate # Windows: venv\Scripts\activate | |
| ``` | |
| ### 3οΈβ£ Install Dependencies | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| ### 4οΈβ£ Run the Streamlit App | |
| ```bash | |
| streamlit run app.py | |
| ``` | |
| --- | |
| ## π Generated Project Structure | |
| ``` | |
| project_name/ | |
| βββ manage.py | |
| βββ project_name/ | |
| β βββ settings.py | |
| β βββ urls.py | |
| β βββ wsgi.py | |
| βββ core/ | |
| β βββ models.py | |
| β βββ serializers.py | |
| β βββ views.py | |
| β βββ urls.py | |
| β βββ admin.py | |
| βββ requirements.txt | |
| βββ README.md | |
| ``` | |
| --- | |
| ## π‘οΈ Authentication | |
| * Supports **JWT Authentication** | |
| * All CRUD endpoints can be protected | |
| * Easily extendable to session-based auth | |
| --- | |
| ## π§ͺ Validation & Reliability | |
| * Strict JSON Schema enforcement | |
| * Deterministic naming conventions | |
| * Auto-correction of: | |
| * Database engine names | |
| * Model and field naming | |
| * Missing required fields | |
| * Prevents invalid or unsafe Django code generation | |
| --- | |
| ## π Deployment | |
| This project is suitable for: | |
| * Local development | |
| * Docker-based deployment | |
| * Cloud hosting (AWS, Azure, GCP, Railway, Render) | |
| β οΈ Note: Production hardening (rate limiting, monitoring, secrets management) should be added as per deployment needs. | |
| --- | |
| ## π License | |
| This project is licensed under the **MIT License**. | |
| You are free to use, modify, and distribute it with attribution. | |
| --- | |
| ## π¨βπ» Author | |
| **Harshad Hole** | |
| Bachelor of Engineering β Artificial Intelligence & Data Science | |
| π§ Email: **[harshadhole04@gmail.com](mailto:harshadhole04@gmail.com)** | |
| --- | |
| ## β Why This Project Matters | |
| * Solves repetitive backend boilerplate | |
| * Demonstrates real-world use of LLMs in software engineering | |
| * Combines AI + validation + deterministic code generation | |
| * Strong portfolio-grade project for AI / Backend / Full-Stack roles | |
| --- | |
| If you want, I can also: | |
| * Write a **βProject Motivationβ** section | |
| * Optimize README for **Hugging Face Spaces** | |
| * Add badges (Python, Django, MIT, AI) | |
| * Review it from a recruiterβs perspective | |
| Just tell me π | |