"Legal docs shouldnβt feel like decoding ancient scrolls."
Jura simplifies legal document analysis using AI - helping people extract key details, summarize insights, and even listen to legal content through text-to-speech.
The legal domain is complex, and accessing case details efficiently can be challenging. I came across people who were either deceived by fake documents or simply unable to read the content of legal paperwork.
Jura was born to fix that - a tool to make legal analysis more accessible, accurate, and AI-assisted.
- Upload Legal PDFs: Quickly upload scanned or digital legal documents.
- Extract Key Details: Pull out important case info using AI-powered text extraction.
- Summarize Insights: Get concise summaries of lengthy, jargon-heavy legal docs.
- Text-to-Speech: Listen to summaries or entire documents for improved accessibility.
- Frontend: React
- Backend: Node.js + Express
- AI Processing: Gemini APIs for translation, summarization, and text extraction
- Styling: HTML & CSS
- Case lookup & status tracking features for real-time legal insights
- Userβprosecutor/lawyer connection functionality
- More languages and better OCR for global accessibility
Built With: HTML, CSS, React, Node.js, Express, Gemini APIs
- Docker and Docker Compose installed on your system
- Install Docker Desktop (includes Docker Compose)
- Google Gemini API keys (get them from Google AI Studio)
This is the easiest way to run the entire application with both frontend and backend.
-
Clone the repository
git clone https://github.com/GnautSpace/Jura.git cd Jura -
Set up environment variables
Copy the example environment file and add your API keys:
Linux / macOS / Git Bash
cp .env.example .env
Windows (PowerShell)
copy .env.example .env
Edit the
.envfile and add your Gemini API keys:GEMINI_API_KEY=your_actual_api_key_here GEMINI_API_KEY_1=your_actual_api_key_1_here
-
Run the application
Development mode (with hot-reload):
docker-compose up
Production mode:
docker-compose -f docker-compose.prod.yml up
Run in detached mode (background):
docker-compose up -d
-
Access the application
- Frontend: http://localhost:5173
- Backend API (Main): http://localhost:3000
- Backend API (LexiBot): http://localhost:5000
-
Stop the application
docker-compose down
Stop and remove volumes:
docker-compose down -v
The application uses the following environment variables:
| Variable | Description | Required | Default |
|---|---|---|---|
GEMINI_API_KEY |
Google Gemini API key for LexiBot | Yes | - |
GEMINI_API_KEY_1 |
Google Gemini API key for document processing | Yes | - |
NODE_ENV |
Environment mode (development or production) |
No | development |
VITE_API_URL |
Backend API URL for frontend | No | http://localhost:3000 |
VITE_LEXI_API_URL |
LexiBot API URL for frontend | No | http://localhost:5000 |
How to get Gemini API keys:
- Go to Google AI Studio
- Click
Get API keyfrom the left sidebar - Create a project if you haven't already
- Generate an API key for your project
- Copy the key (it should start with
AIza)
If you prefer to run the services locally without Docker:
-
Clone the repo
git clone https://github.com/GnautSpace/Jura.git cd Jura -
Setup Backend
cd backend cp .env.example .env # Edit .env and add your API keys npm install npm run dev:both # Runs both servers with hot-reload
-
Setup Frontend (in a new terminal)
cd frontend npm install npm run dev -
Access the application
- Frontend: http://localhost:5173
- Backend: http://localhost:3000 & http://localhost:5000
Build images:
docker-compose buildRebuild without cache:
docker-compose build --no-cacheView logs:
docker-compose logs -fView logs for specific service:
docker-compose logs -f frontend
docker-compose logs -f backendExecute commands in container:
docker-compose exec backend sh
docker-compose exec frontend shRestart services:
docker-compose restartThe backend includes comprehensive unit and integration tests with Jest and Supertest.
Running Tests:
# Run all tests
npm test --prefix backend
# Run tests in watch mode (re-runs on file changes)
npm run test:watch --prefix backend
# Run tests with coverage report
npm run test:coverage --prefix backend
# Run only unit tests
npm run test:unit --prefix backend
# Run only integration tests
npm run test:integration --prefix backendTest Coverage:
Current test coverage for backend:
- 68 test cases covering critical functionality
- 52% statement coverage on server.cjs
- 43% branch coverage
- Unit tests for utility functions (sanitization, validation, error handling)
- Integration tests for API endpoints (/chat, /health)
- Mocked external dependencies (Gemini API)
Test Structure:
backend/tests/
βββ unit/
β βββ utils.test.js # Utility function tests
β βββ errors.test.js # Error handling tests
βββ integration/
β βββ api.test.js # API endpoint tests
βββ mocks/
β βββ gemini.mock.js # Gemini API mock
βββ setup.js # Test environment setup
βββ README.md # Detailed testing guide
For detailed testing documentation, see Testing Guide
Port already in use:
# Find and kill the process using the port (example for port 3000)
# Linux/macOS:
lsof -ti:3000 | xargs kill -9
# Windows:
netstat -ano | findstr :3000
taskkill /PID <PID> /FContainer won't start:
# Check logs
docker-compose logs backend
docker-compose logs frontend
# Rebuild containers
docker-compose down
docker-compose build --no-cache
docker-compose upHot-reload not working:
- Make sure you're using
docker-compose.yml(notdocker-compose.prod.yml) - On Windows, ensure file sharing is enabled in Docker Desktop settings
- Try stopping and restarting the containers
API key errors:
- Make sure your
.envfile exists in the root directory - Check that API keys start with
AIza - Ensure no quotes around the API keys in
.envfile - Try restarting the containers after updating
.env
Cannot connect to backend:
- Verify both services are running:
docker-compose ps - Check if ports 3000, 5000, and 5173 are available
- Make sure the backend container is healthy:
docker-compose logs backend
For more detailed information:
Docker & Deployment:
- Docker Setup Guide - Comprehensive Docker documentation
- Dockerization Summary - Implementation details
- Docker Quick Reference - Quick command reference
- Dockerization Checklist - Verification checklist
- GitHub Actions Example - CI/CD template
Testing:
- Testing Guide - Comprehensive testing documentation
- Error Handling Guide - Backend error handling
please check (CONTRIBUTING.md)[https://github.com/GnautSpace/Jura/blob/main/CONTRIBUTING.md]
This project is licensed under the MIT License β see the LICENSE-CODE file for details.