A complete Full-Stack AI-powered application that converts plain text into context-aware, structured JSON prompts for better AI model comprehension.
The system features a React + Tailwind frontend for easy text input and history tracking, and a FastAPI + Pydantic AI + Mistral AI backend for intelligent JSON generation and validation.
- Frontend (Static Site):
https://json-prompt-generator.onrender.com - Backend API:
https://json-prompt-backend.onrender.com
- Advanced Pydantic AI Integration: Strong validation and structured responses
- Mistral AI Powered: Context-aware JSON generation with relevant keys only
- Smart Validation: Multi-layer type checking and error recovery
- Async Operations: High-performance async/await for scalability
- Robust Error Handling: Built-in retry logic, graceful fallbacks
- Multi-Domain Support: Handles code generation, travel planning, data science, writing, and more
- Instant Text-to-JSON Conversion
- Conversion History: Stores latest 5 conversions
- Copy to Clipboard for generated JSON
- Responsive UI with sidebar navigation
- Customizable JSON Structure
Backend:
- FastAPI (Python 3.9+)
- Pydantic AI with Mistral AI integration
- Uvicorn
- python-dotenv
Frontend:
- React + TypeScript
- Vite
- Tailwind CSS
- Lucide React Icons
JSON-Prompt-Generator/
βββ backend/ # FastAPI backend
β βββ main.py
β βββ services/
β β βββ generator.py
β βββ requirements.txt
β βββ .env
β
βββ frontend/ # React frontend
β βββ src/
β β βββ App.tsx
β β βββ main.tsx
β β βββ components/
β β β βββ Sidebar.tsx
β β β βββ TextToJsonConverter.tsx
β β β βββ HistoryView.tsx
β βββ index.html
β βββ package.json
β βββ tailwind.config.js
β βββ vite.config.ts
βββ README.mdgit clone https://github.com/MSG-Mutual-Support-to-Grow/JSON-Prompt-Generator.git
cd JSON-Prompt-GeneratorThe backend setup instructions are in the backend/README.md
The frontend setup instructions are in the frontend/README.md
Transform plain text into structured JSON with context-aware key selection.
Request:
{
"text": "plan a trip to Tokyo in December",
"num_keys": 5,
"include_ai_content": true
}Response Example:
{
"response": {
"text": "plan a trip to Tokyo in December",
"city": "Tokyo",
"country": "Japan",
"month": "December",
"activities": ["sightseeing", "food tours"]
},
"source": "mistral"
}Health check endpoint.
- Programming β Generates language, framework, libraries, etc.
- Travel β Generates destination, budget, activities, etc.
- Content Writing β Generates topic, tone, audience, word_count.
- Text Input β JSON Output instantly via API
- Copy JSON to Clipboard
- View Conversion History
- Responsive Design for desktop & mobile
- Code Style: PEP 8 (backend), TypeScript best practices (frontend)
- Strong Typing: Pydantic models for backend validation
- CORS Ready: Accepts requests from http://localhost:3000 and http://localhost:5173
- Backend not starting? Activate venv and check
.envfile - CORS issues? Update
allow_originsinmain.py - Port conflicts? Change with
--portflag in uvicorn or vite
This project is licensed under the MIT License.
- aswathkarthick75-collab
- Joelrtharakan
- DicksonLegend
- gokul18062006
- Niranjan070
- snipergib
- hazim564-dotcom
- ThirupathiS-45
- Klassy01
Pull requests are welcome! Please follow:
- PEP 8 for Python code
- TypeScript standards for frontend
- Add docstrings/comments for clarity