Update README.md
Browse files
README.md
CHANGED
|
@@ -1,207 +1,217 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
-
*
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
*
|
| 25 |
-
|
| 26 |
-
*
|
| 27 |
-
*
|
| 28 |
-
|
| 29 |
-
*
|
| 30 |
-
|
| 31 |
-
*
|
| 32 |
-
*
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
*
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
*
|
| 43 |
-
*
|
| 44 |
-
*
|
| 45 |
-
|
| 46 |
-
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
*
|
| 83 |
-
*
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
*
|
| 88 |
-
*
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
```
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
```
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
βββ
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
*
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
*
|
| 169 |
-
*
|
| 170 |
-
*
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
*
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
*
|
| 204 |
-
*
|
| 205 |
-
*
|
| 206 |
-
|
| 207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: AI REST API Generator
|
| 3 |
+
emoji: π€
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
+
pinned: false
|
| 9 |
+
license: mit
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# π€ AI REST API Generator
|
| 13 |
+
|
| 14 |
+
**AI REST API Generator** is a developer-focused tool that automatically generates **Django REST Framework backends** using AI or manual configuration.
|
| 15 |
+
It converts high-level requirements into a fully structured, runnable Django project with CRUD APIs, serializers, views, URLs, and settings.
|
| 16 |
+
|
| 17 |
+
π§ **Status:** Under active development
|
| 18 |
+
π§ **Contact:** [harshadhole04@gmail.com](mailto:harshadhole04@gmail.com)
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## β¨ Features
|
| 23 |
+
|
| 24 |
+
* β‘ **AI-Powered Backend Generation**
|
| 25 |
+
|
| 26 |
+
* Generate Django REST APIs from natural language prompts
|
| 27 |
+
* Automatically infers models, fields, and relationships
|
| 28 |
+
|
| 29 |
+
* π§± **Manual Model Builder**
|
| 30 |
+
|
| 31 |
+
* Define models, fields, relationships (One-to-One, One-to-Many)
|
| 32 |
+
* Full control without AI if preferred
|
| 33 |
+
|
| 34 |
+
* π§© **Schema-Driven Architecture**
|
| 35 |
+
|
| 36 |
+
* JSON Schema validation before code generation
|
| 37 |
+
* Auto-fixes common schema issues safely
|
| 38 |
+
|
| 39 |
+
* π¦ **Complete Django Project Output**
|
| 40 |
+
|
| 41 |
+
* Models, serializers, views, URLs
|
| 42 |
+
* JWT authentication support
|
| 43 |
+
* Database configuration (SQLite / PostgreSQL)
|
| 44 |
+
* Static & media configuration
|
| 45 |
+
|
| 46 |
+
* π₯ **One-Click Download**
|
| 47 |
+
|
| 48 |
+
* Generated backend is zipped and ready to run
|
| 49 |
+
|
| 50 |
+
* π§ **Pluggable LLM Support**
|
| 51 |
+
|
| 52 |
+
* OpenAI
|
| 53 |
+
* Groq
|
| 54 |
+
* Easy to extend for other providers
|
| 55 |
+
|
| 56 |
+
---
|
| 57 |
+
|
| 58 |
+
## ποΈ Architecture Overview
|
| 59 |
+
|
| 60 |
+
```
|
| 61 |
+
Streamlit UI
|
| 62 |
+
β
|
| 63 |
+
Pipeline Orchestrator
|
| 64 |
+
β
|
| 65 |
+
LLM (Model Prompt / Spec Generation)
|
| 66 |
+
β
|
| 67 |
+
Schema Validation (JSON Schema)
|
| 68 |
+
β
|
| 69 |
+
Django Code Generator
|
| 70 |
+
β
|
| 71 |
+
Ready-to-run Django REST Project
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
+
## π How It Works
|
| 77 |
+
|
| 78 |
+
1. **Input**
|
| 79 |
+
|
| 80 |
+
* Project name & description
|
| 81 |
+
* Choose AI-generated models or manual models
|
| 82 |
+
* Select database and authentication
|
| 83 |
+
* Provide LLM provider and API key
|
| 84 |
+
|
| 85 |
+
2. **Validation**
|
| 86 |
+
|
| 87 |
+
* Generated spec is validated against a strict JSON schema
|
| 88 |
+
* Automatic normalization and safe fixes applied
|
| 89 |
+
|
| 90 |
+
3. **Generation**
|
| 91 |
+
|
| 92 |
+
* Django project is created in an isolated run directory
|
| 93 |
+
* Apps, models, serializers, views, URLs, settings generated
|
| 94 |
+
|
| 95 |
+
4. **Output**
|
| 96 |
+
|
| 97 |
+
* Project is zipped
|
| 98 |
+
* Download instantly from the UI
|
| 99 |
+
|
| 100 |
+
---
|
| 101 |
+
|
| 102 |
+
## π₯οΈ Running Locally
|
| 103 |
+
|
| 104 |
+
### 1οΈβ£ Clone the Repository
|
| 105 |
+
|
| 106 |
+
```bash
|
| 107 |
+
git clone https://github.com/harshadSH/ai-rest-api-generator.git
|
| 108 |
+
cd ai-rest-api-generator
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
### 2οΈβ£ Create Virtual Environment
|
| 112 |
+
|
| 113 |
+
```bash
|
| 114 |
+
python -m venv venv
|
| 115 |
+
source venv/bin/activate # Windows: venv\Scripts\activate
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
### 3οΈβ£ Install Dependencies
|
| 119 |
+
|
| 120 |
+
```bash
|
| 121 |
+
pip install -r requirements.txt
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
### 4οΈβ£ Run the Streamlit App
|
| 125 |
+
|
| 126 |
+
```bash
|
| 127 |
+
streamlit run app.py
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
|
| 132 |
+
## π Generated Project Structure
|
| 133 |
+
|
| 134 |
+
```
|
| 135 |
+
project_name/
|
| 136 |
+
βββ manage.py
|
| 137 |
+
βββ project_name/
|
| 138 |
+
β βββ settings.py
|
| 139 |
+
β βββ urls.py
|
| 140 |
+
β βββ wsgi.py
|
| 141 |
+
βββ core/
|
| 142 |
+
β βββ models.py
|
| 143 |
+
β βββ serializers.py
|
| 144 |
+
β βββ views.py
|
| 145 |
+
β βββ urls.py
|
| 146 |
+
β βββ admin.py
|
| 147 |
+
βββ requirements.txt
|
| 148 |
+
βββ README.md
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
---
|
| 152 |
+
|
| 153 |
+
## π‘οΈ Authentication
|
| 154 |
+
|
| 155 |
+
* Supports **JWT Authentication**
|
| 156 |
+
* All CRUD endpoints can be protected
|
| 157 |
+
* Easily extendable to session-based auth
|
| 158 |
+
|
| 159 |
+
---
|
| 160 |
+
|
| 161 |
+
## π§ͺ Validation & Reliability
|
| 162 |
+
|
| 163 |
+
* Strict JSON Schema enforcement
|
| 164 |
+
* Deterministic naming conventions
|
| 165 |
+
* Auto-correction of:
|
| 166 |
+
|
| 167 |
+
* Database engine names
|
| 168 |
+
* Model and field naming
|
| 169 |
+
* Missing required fields
|
| 170 |
+
* Prevents invalid or unsafe Django code generation
|
| 171 |
+
|
| 172 |
+
---
|
| 173 |
+
|
| 174 |
+
## π Deployment
|
| 175 |
+
|
| 176 |
+
This project is suitable for:
|
| 177 |
+
|
| 178 |
+
* Local development
|
| 179 |
+
* Docker-based deployment
|
| 180 |
+
* Cloud hosting (AWS, Azure, GCP, Railway, Render)
|
| 181 |
+
|
| 182 |
+
β οΈ Note: Production hardening (rate limiting, monitoring, secrets management) should be added as per deployment needs.
|
| 183 |
+
|
| 184 |
+
---
|
| 185 |
+
|
| 186 |
+
## π License
|
| 187 |
+
|
| 188 |
+
This project is licensed under the **MIT License**.
|
| 189 |
+
You are free to use, modify, and distribute it with attribution.
|
| 190 |
+
|
| 191 |
+
---
|
| 192 |
+
|
| 193 |
+
## π¨βπ» Author
|
| 194 |
+
|
| 195 |
+
**Harshad Hole**
|
| 196 |
+
Bachelor of Engineering β Artificial Intelligence & Data Science
|
| 197 |
+
π§ Email: **[harshadhole04@gmail.com](mailto:harshadhole04@gmail.com)**
|
| 198 |
+
|
| 199 |
+
---
|
| 200 |
+
|
| 201 |
+
## β Why This Project Matters
|
| 202 |
+
|
| 203 |
+
* Solves repetitive backend boilerplate
|
| 204 |
+
* Demonstrates real-world use of LLMs in software engineering
|
| 205 |
+
* Combines AI + validation + deterministic code generation
|
| 206 |
+
* Strong portfolio-grade project for AI / Backend / Full-Stack roles
|
| 207 |
+
|
| 208 |
+
---
|
| 209 |
+
|
| 210 |
+
If you want, I can also:
|
| 211 |
+
|
| 212 |
+
* Write a **βProject Motivationβ** section
|
| 213 |
+
* Optimize README for **Hugging Face Spaces**
|
| 214 |
+
* Add badges (Python, Django, MIT, AI)
|
| 215 |
+
* Review it from a recruiterβs perspective
|
| 216 |
+
|
| 217 |
+
Just tell me π
|