Alibi is a full-stack web application that helps immigrants - documented or undocumented - understand important legal and medical documents in their native languages.
The app runs fully offline on the backend, without any cloud APIs, user accounts, or internet-based AI services for FREE. Users interact through a web browser, and all document processing and AI chatbot functionality is powered by local, open-source software.
Users can upload pictures of physical documents - such as medical records, legal notices, or government forms. Alibi will:
- Extract all visible English text from the image
- Translate it to the user's chosen language
- Rebuild the image with translated text in place of the original text
- Return the new translated image to the browser for viewing/download
Users can ask questions in any language - and the chatbot will:
- Automatically detect and translate the message into English
- Generate a clear, simple response using a locally hosted LLM
- Translate the answer back into the user's original language
- Deliver the translated answer directly in the web interface
🚨 Alibi does not offer legal advice. It provides general information and help only. No user data or documents are stored on the server.
Frontend (HTML/CSS/JScript) ↓ ↑ REST API (Flask / FastAPI backend) ↓ ↑ OCR | Translation | LLM (Google Generative AI) | Image Editor
All processing happens in your own backend - no external APIs for document translation, no cloud calls, no user accounts.
| Part | Technology Used |
|---|---|
| 🌐 Frontend | React, Vite, HTML/CSS/JavaScript |
| ⚙️ Backend (Document Translator) | Python + Flask |
| ⚙️ Backend (Chatbot) | Python + FastAPI + Uvicorn + Gemini API |
| 🔍 OCR | Pytesseract |
| 🌍 Translation | DeepL API |
| 🖼️ Image Processing | Pillow (PIL) |
| 📦 Package Management | pip (Python), npm (JavaScript) |
- Python 3.9+
- npm & pip
- Basic command line usage
- 4-8 GB RAM recommended
- Internet access (for API calls)
Setup Instructions (Make sure all terminal windows are opened in your code editor with the same root directory)
You may want to create a virtual environment for managing the required packages and libraries from the requirements.txt files
- Clone the Repo
git clone https://github.com/Achak0120/Alibi.git- Install requirements.txt
cd Alibi
pip install -r backend/NLP_chatbot/requirements.txt
pip install -r requirements.txt- Run the Document Translator Backend (Open a new terminal window --> Terminal 1)
cd backend/document_translator
python server.py- ** Run the Chatbot Backend** (Open a new terminal window --> Terminal 2, but keep all previous terminal windows open)
cd backend/NLP_chatbot
uvicorn main:app --host 0.0.0.0 --port 8001 --reload- Run the Frontend (Open a new terminal window --> Terminal 3, but keep all previous terminal windows open)
cd frontend
npm install (only do once, either globally or in your virtual environment)
npm run dev- Navigate to Project Frontend via URL in your search engine
The most common port to enter the project is (http://localhost:5173/) To make sure you are in the correct port url, check the terminal output in terminal 3 after you complete Step 5 and travel to that URL