BharatLens is a AI-powered multimodal RAG platform designed to explore and understand global geopolitics through India’s perspective.
It provides clear, insightful responses that help users grasp the strategic, economic, and cultural dimensions of international affairs.
Whether it’s analyzing global events, interpreting diplomatic trends, or contextualizing policies, BharatLens offers an India-centered lens to view the world.
- Frontend: Built in React.js (designed using Lovable) and deployed separately (link will be added soon).
- Backend: FastAPI server with:
- Async support (async SQLAlchemy, asyncpg, etc.)
- JWT Authentication
- Session & Conversation management
- Integration with OpenAI LLM
- Implemented RAG (Retrieval-Augmented Generation)
- Database: PostgreSQL (hosted on Neon)
- Deployment: Deployed on Render.com using Docker + GitHub Actions CI/CD.
- Try Out Live API: https://bharatlens.onrender.com/docs
- 🔐 User Authentication (Register, Login, Profile Management)
- 💬 Chat Sessions: Create sessions, store conversation history
- 🤖 LLM Integration: Powered by OpenAI GPT
- 📜 Conversation History: Retrieve past chats, with pagination support
- 🗑️ Delete Sessions: Cascade delete messages when a session is removed
- 🧩 Modular Architecture: Easily extendable
POST /auth/register→ Register new userPOST /auth/login→ Login and get JWT token
POST /api/v1/chat/sessions→ Create new chat sessionGET /api/v1/chat/sessions→ Get all user sessions with messagesDELETE /api/v1/chat/sessions/{session_id}→ Delete session + messagesPOST /api/v1/chat/sessions/{session_id}/messages→ Send message & get LLM responseGET /api/v1/chat/sessions/{session_id}/messages→ Get messages (paginated)
git clone https://github.com/1abhi6/BharatLens
cd BharatLensCopy .env.example to .env and fill in your secrets:
cp .env.example .envRequired values:
DATABASE_URL→ Neon Postgres connection stringJWT_SECRET_KEY→ Any secure random stringOPENAI_API_KEY→ Your OpenAI API key
I recommend uv as a package manager for speed and reproducibility:
uv venv.\.venv\Scripts\activateuv pip install -r pyproject.tomluvicorn app.main:app --reloadBackend will be available at http://localhost:8000
API docs are available at http://localhost:8000/docs
You can also run the backend inside a container:
docker build -t bharatlens-backend .
docker run --env-file .env -p 8000:8000 bharatlens-backendThe frontend UI is built separately in React (repo link will be added here). Once deployed, the UI connects to this backend at https://bharatlens.onrender.com.
Pull requests are welcome! Please open an issue first to discuss changes. Make sure to update tests as appropriate.
This project is licensed under the MIT License.
Developed with ❤️ by Abhishek Gupta