A full-stack web application that translates and simplifies government forms using AI. Users can upload form images/PDFs or paste text, select a target language, and receive a translated, structured version with simplified explanations.
- Multi-input Support: Upload images/PDFs, paste text, or select from a form library
- Language Translation: Support for 30+ languages including Indian regional languages
- Form Structure Analysis: AI-powered extraction of form fields, sections, and structure
- Simplified Explanations: Easy-to-understand breakdowns of complex government forms
- Responsive Design: Works on desktop and mobile devices
- Dark/Light Theme: Toggle between themes for better user experience
- Frontend: React 19, TypeScript, Vite, Tailwind CSS
- Backend: Python FastAPI
- AI Service: Google Gemini AI
- Icons: Custom SVG icons
- Styling: Tailwind CSS with dark mode support
├── backend.py # Single Python FastAPI backend file
├── requirements.txt # Python dependencies
├── env.example # Environment variables template
├── components/ # React components
├── contexts/ # React contexts
├── data/ # Static data
├── localization/ # Internationalization
├── services/ # Frontend services
└── README.md # This file
- Node.js (for frontend)
- Python 3.8+ (for backend)
- Google Gemini API key
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Python dependencies:
pip install -r requirements.txt
-
Create environment file:
cp env.example .env
-
Edit
.envfile and add your Google Gemini API key:API_KEY=your_gemini_api_key_here -
Start the backend server:
python backend.py
The backend will be available at http://localhost:8000
-
Install frontend dependencies:
npm install
-
Start the development server:
npm run dev
The frontend will be available at http://localhost:5173 (or the port shown in terminal)
- Make sure both backend and frontend are running
- Open the frontend application in your browser
- Choose your input method (upload file, paste text, or select from library)
- Select your target language
- Click "Translate & Simplify"
- View the translated form structure and simplified explanation
- Copy results for your use
GET /- Health checkGET /api/health- Health check endpointPOST /api/translate- Translate and simplify forms
For detailed API documentation, visit http://localhost:8000/docs when the backend is running.
The application supports 30+ languages including English, Hindi, Bengali, Tamil, Telugu, Gujarati, Marathi, and many more regional and international languages.
The backend is built with Python FastAPI and follows a simple structure without OOP classes as requested. All backend code is contained in a single file:
backend.py: Complete FastAPI application with CORS middleware and AI service integration- Environment-based configuration
The frontend remains unchanged in functionality but now communicates with the backend API instead of directly calling Google Gemini AI.
For production deployment:
- Set up proper environment variables
- Configure CORS origins in
backend.py - Use a production WSGI server like Gunicorn for the backend
- Build the frontend with
npm run build - Serve the built files with a web server like Nginx