Prerequisites
Before starting, ensure you have the following installed:Java Development Kit
Version: JDK 21 or higherVerify:
java -versionApache Maven
Version: Maven 3.9 or higherVerify:
mvn -versionNode.js & npm
Version: Node.js 20+ and npm 10+Verify:
node -v && npm -vPython
Version: Python 3.8 or higherVerify:
python3 --versionOptional: Docker and Docker Compose for containerized deployment (recommended for production)
Installation Steps
Configure Environment Variables
Create environment configuration for the backend. The backend uses H2 in-memory database by default (perfect for development).Backend Configuration (optional - defaults work out of the box):Create a Frontend Configuration:Create AI Service Configuration:Create
.env file or set environment variables:.env.local:.env:Start the Backend
The backend must be started first as it provides the API for other services.Alternative: Run the JAR directlyVerify Backend is Running:The backend should start on port Access the API documentation at:
On Windows, use
mvnw.cmd instead of ./mvnw8080. Check the console for:Default Users
The backend initializes with two default accounts:Surgeon Account:
- Username:
surgeon_master - Password:
justina2024 - Role:
ROLE_SURGEON
- Username:
ia_justina - Password:
ia_secret_2024 - Role:
ROLE_IA
Start the Frontend
Open a new terminal window for the frontend.Alternative package managers:The frontend will start on You should see the Justina login page.
http://localhost:3000.Verify Frontend is Running:Open your browser and navigate to:Start the AI Service (Optional)
The AI service processes surgical data and provides analysis. It’s optional for basic testing but required for receiving AI feedback.Open a new terminal window:Verify AI Service is Running:You should see:
Alternative Mode: You can also run the AI service in manual mode using
python main.py to process surgeries by ID instead of listening to WebSocket notifications.First Simulation
Now that all services are running, let’s perform your first surgical simulation.Login to the Platform
Navigate to Click the Login button.
http://localhost:3000 in your browser.Use the default surgeon credentials:Access the Simulation Dashboard
After successful login, you’ll be redirected to the dashboard where you can:
- Start a new simulation
- View past surgeries
- Check your performance statistics
Start a Simulation
Click on “Start New Simulation” or the simulation module card.You’ll be taken to the 3D surgical environment powered by Babylon.js.What you’ll see:
- 3D surgical scene with instruments
- Interactive controls for manipulation
- Real-time telemetry connection status
The WebSocket connection is established automatically when the simulation loads. Check the browser console for connection logs.
Perform the Simulation
Interact with the surgical instruments using your mouse:Events tracked:
- Left Click + Drag: Move instruments in the XY plane
- Right Click + Drag: Rotate camera view
- Scroll: Zoom in/out
START: Simulation beginsMOVE: Instrument movementTUMOR_TOUCH: Contact with tumor (critical event)HEMORRHAGE: Hemorrhage occurrence (critical event)FINISH: Simulation completes
Complete the Simulation
Click the “Finish Surgery” button when done.The system will:This ID is stored in cookies and localStorage for later retrieval.
- Send a
FINISHevent via WebSocket - Close the WebSocket connection
- Save the surgery session to the database
- Return a surgery UUID
View AI Analysis
If the AI service is running, it will automatically:Access the analysis report through the dashboard or via API:
- Receive a WebSocket notification about the new surgery
- Fetch the trajectory data via REST API
- Process through the 5-step analysis pipeline
- Send the results back to the backend
Testing the API
Justina provides a complete REST API documented with OpenAPI/Swagger.Access Swagger UI
Navigate to:Authentication Flow
Fetch Surgery Data
Troubleshooting
Backend Won’t Start
Issue: Port 8080 already in useFrontend Connection Issues
Issue: Cannot connect to backend API Verify your.env.local configuration:
- Backend not running
- JWT token not found in cookies
- CORS issues (backend should allow frontend origin)
AI Service Issues
Issue: AI service can’t authenticate Verify credentials inia/.env:
Next Steps
Architecture Overview
Learn about the technical architecture and design patterns
API Reference
Explore all available endpoints and WebSocket protocols
Deployment Guide
Deploy Justina to production with Docker and PostgreSQL
Environment Variables
Configuration options for all components