Follow these steps to get the Mock Trial Simulator running:
- Go to https://deepgram.com
- Sign up for a free account
- Navigate to API Keys section
- Create a new API key
- Copy the key
- Go to https://openjustice.ai
- Sign up for API access
- Get your API key
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .envEdit .env file:
DEEPGRAM_API_KEY=your_actual_deepgram_key
OPENJUSTICE_API_KEY=your_actual_openjustice_key
Start the backend:
python main.pyYou should see: "Application startup complete" on http://0.0.0.0:8000
Open a new terminal:
cd frontend
npm install
cp .env.local.example .env.localThe .env.local should already have:
NEXT_PUBLIC_BACKEND_URL=http://localhost:8000
NEXT_PUBLIC_WS_URL=ws://localhost:8000
Start the frontend:
npm run devYou should see: "Ready on http://localhost:3000"
- Open http://localhost:3000 in your browser
- Select at least one role (Judge, Prosecutor, or Defense)
- Choose a jurisdiction (e.g., United States)
- Select legal areas (e.g., Criminal Law)
- Enter a case description like:
The defendant is charged with theft. On January 15, 2024, they allegedly stole merchandise worth $500 from a retail store. Security footage shows a person matching the defendant's description. - Click "Start Trial"
- Allow microphone access when prompted
- Unmute the microphone (click the button)
- Start speaking to interact with the agents
cd backend
pip install -r requirements.txt --upgrade- Use Chrome or Edge browser
- Check browser permissions
- Ensure you're on localhost or HTTPS
- Check if port 8000 is available
- Verify Python version:
python --version(should be 3.10+) - Check
.envfile exists with API keys
- Check if port 3000 is available
- Verify Node version:
node --version(should be 18+) - Delete
node_modulesand runnpm installagain
For testing purposes, the application will work with simulated responses even if:
- OpenJustice API key is not provided (uses mock data)
- Deepgram key is invalid (will show errors but can test UI)
However, for full functionality, you need valid API keys.
- Customize agent prompts in
backend/services/agent_manager.py - Adjust UI styling in frontend components
- Add more legal areas or jurisdictions
- Implement additional features like:
- Session history
- Export transcripts
- Multiple witnesses
- Evidence management