YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

NyaySetu RTI Application Generator

Flask-based PDF generator for RTI (Right to Information) applications with professional formatting.

Features

  • Generate formatted RTI application PDFs
  • Support for all standard RTI form fields
  • BPL (Below Poverty Line) status handling
  • PDF overlay on official templates
  • REST API for integration

Local Development

Setup

# Navigate to the RTI Generator directory
cd temp/RTI_Generator

# Create a virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Run Locally

python app.py

The service will be available at http://localhost:5001

Test the API

Health check:

curl http://localhost:5001/

Generate RTI PDF:

curl -X POST http://localhost:5001/api/generate-rti \
  -H "Content-Type: application/json" \
  -d '{
    "applicant_name": "John Doe",
    "guardian_name": "Jane Doe",
    "address": "123 Main Street, Mumbai",
    "phone": "022-12345678",
    "mobile": "9876543210",
    "fee_amount": "10",
    "payment_mode": "Cash",
    "payment_date": "29/12/2025",
    "favoring": "Public Information Officer",
    "photocopy_amount": "2",
    "num_pages": "5",
    "cd_amount": "",
    "bpl_status": "No",
    "bpl_certificate": "",
    "date": "29/12/2025"
  }' \
  --output test_rti.pdf

Deployment to Render

Prerequisites

  1. A GitHub account
  2. A Render account (free tier available)

Steps

  1. Initialize Git Repository (if not already done):

    cd temp/RTI_Generator
    git init
    git add .
    git commit -m "Initial RTI generator setup"
    
  2. Create GitHub Repository:

    • Go to GitHub and create a new repository (e.g., nyaysetu-rti-generator)
    • Push your code:
      git remote add origin https://github.com/YOUR_USERNAME/nyaysetu-rti-generator.git
      git branch -M main
      git push -u origin main
      
  3. Deploy on Render:

    • Go to Render Dashboard
    • Click New β†’ Web Service
    • Connect your GitHub repository
    • Render will auto-detect the render.yaml configuration
    • Click Create Web Service
    • Wait for deployment to complete
  4. Get Your Service URL:

    • Once deployed, you'll get a URL like: https://nyaysetu-rti-generator.onrender.com
    • Copy this URL for configuring your frontend

API Endpoints

GET /

Health check endpoint.

Response:

{
  "status": "healthy",
  "service": "RTI Application Generator",
  "version": "1.0.0"
}

POST /api/generate-rti

Generate RTI application PDF.

Request Body:

{
  "applicant_name": "string (required)",
  "guardian_name": "string (required)",
  "address": "string (required)",
  "phone": "string",
  "mobile": "string (required)",
  "fee_amount": "string",
  "payment_mode": "string",
  "payment_date": "string",
  "favoring": "string",
  "photocopy_amount": "string",
  "num_pages": "string",
  "cd_amount": "string",
  "bpl_status": "string",
  "bpl_certificate": "string",
  "date": "string"
}

Response:

  • Content-Type: application/pdf
  • The generated RTI application PDF

Integration with Next.js Frontend

After deploying to Render, update your Next.js .env.local:

RTI_API_URL=https://nyaysetu-rti-generator.onrender.com

Project Structure

RTI_Generator/
β”œβ”€β”€ app.py                      # Flask application with API endpoints
β”œβ”€β”€ generate_rti.py             # PDF generation logic
β”œβ”€β”€ requirements.txt            # Python dependencies
β”œβ”€β”€ render.yaml                 # Render deployment configuration
β”œβ”€β”€ .gitignore                  # Git ignore rules
β”œβ”€β”€ README.md                   # This file
β”œβ”€β”€ pdf_templates/              # PDF template files
β”‚   └── rti_background.pdf
└── output/                     # Generated PDFs (gitignored)

Dependencies

  • Flask 3.0.0: Web framework
  • flask-cors 4.0.0: CORS support for API
  • reportlab 4.0.7: PDF generation
  • PyPDF2 3.0.1: PDF manipulation
  • gunicorn 21.2.0: Production WSGI server

Troubleshooting

PDF Generation Fails

  • Ensure pdf_templates/rti_background.pdf exists
  • Check file permissions on the output directory
  • Verify all required fields are provided

CORS Issues

  • The backend has CORS enabled for all origins
  • If issues persist, check Render logs

Cold Starts

  • Free tier Render services sleep after inactivity
  • First request may take 30-60 seconds
  • Consider upgrading to paid tier for always-on service

License

Part of the NyaySetu legal assistance platform. # rti-generation-backend

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support