A comprehensive document management system with AI-powered OCR, summarization, and real-time collaboration features.
- Frontend: React + TypeScript + Vite
- Backend: FastAPI + Python
- Database: SQLite (development) / PostgreSQL (production)
- AI Services: Google Gemini, Tesseract OCR
- Storage: AWS S3 (optional)
- Authentication: JWT-based
- Node.js 18+ and npm
- Python 3.8+
- Git
# Run the setup script
setup.batBackend (.env):
DATABASE_URL=sqlite:///./faiss_app.db
SECRET_KEY=your-super-secret-key
GEMINI_API_KEY=your-gemini-api-key
AWS_ACCESS_KEY_ID=your-aws-key
AWS_SECRET_ACCESS_KEY=your-aws-secret
AWS_REGION=us-east-1
AWS_S3_BUCKET=your-bucket-nameFrontend (.env):
VITE_API_BASE_URL=http://localhost:8000
VITE_GEMINI_API_KEY=your-gemini-api-key# Start both frontend and backend
start-dev.batcd Backend
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python -m uvicorn app.main:app --reload --port 8000cd Frontend
npm install
npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/api/docs
- Health Check: http://localhost:8000/health
| Username | Password | Role | Department |
|---|---|---|---|
| admin@kmrl.co.in | password123 | Admin | All |
| director.ops@kmrl.co.in | password123 | Director | Operations |
| manager.fin@kmrl.co.in | password123 | Manager | Finance |
| staff.safety@kmrl.co.in | password123 | Staff | Safety |
- Multi-language OCR: Tesseract + Google Vision API
- AI Summarization: English (BART) + Malayalam (IndicBART)
- Format Support: PDF, Images, Word, Text files
- Real-time Processing: Instant analysis and summaries
- Role-based Access: Staff, Manager, Director, Board Member, Admin
- Department Filtering: Operations, HR, Finance, Legal, IT, Safety
- JWT Authentication: Secure token-based auth
- Session Management: Auto-logout and session validation
- Semantic Search: Find documents by content and context
- Priority Classification: High, Medium, Low priority detection
- Due Date Tracking: Automatic deadline monitoring
- Language Detection: Auto-route to appropriate AI models
- Document Sharing: Share with specific users
- Real-time Updates: WebSocket-based collaboration
- Comment System: Threaded discussions
- Activity Tracking: Full audit logs
cd Frontend
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production buildcd Backend
python -m uvicorn app.main:app --reload --port 8000- Visit http://localhost:8000/api/docs for Swagger UI
- Use tools like Postman or curl for API testing
- Health check:
curl http://localhost:8000/health
KMRL-Platform/
βββ Frontend/ # React + TypeScript
β βββ src/
β β βββ components/ # React components
β β βββ hooks/ # Custom hooks
β β βββ services/ # API services
β β βββ contexts/ # React contexts
β β βββ main.tsx # Entry point
β βββ public/
β βββ package.json
βββ Backend/ # FastAPI + Python
β βββ app/
β β βββ core/ # Core functionality
β β βββ routes/ # API endpoints
β β βββ models/ # Database models
β β βββ services/ # Business logic
β β βββ main.py # FastAPI app
β βββ requirements.txt
βββ setup.bat # Setup script
βββ start-dev.bat # Development starter
βββ README.md
VITE_API_BASE_URL: Backend API URL GEMINI_API_KEY: Google Gemini API key for AI features DATABASE_URL: Database connection string AWS_*: AWS credentials for S3 storage SECRET_KEY: JWT signing key
cd Frontend
npm run test # Run unit tests
npm run e2e # Run e2e testscd Backend
pytest # Run all tests
pytest -v # Verbose outputcd Frontend
npm run build
# Serve from Backend/static/ or deploy to CDNcd Backend
pip install gunicorn
gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and add tests
- Commit:
git commit -am 'Add feature' - Push:
git push origin feature-name - Create a Pull Request
MIT License - see LICENSE file for details
For support, email: zodiacmrv@gmail.com
KMRL Document Intelligence Platform - Empowering decisions with intelligent document processing.