Overview
CheckThat AI can be set up for local development using automated scripts or manual configuration. The platform runs two services:- Frontend: React + TypeScript + Vite (Port 5173)
- Backend: FastAPI + Python (Port 8000)
Prerequisites
Before starting, ensure you have the following installed:Node.js
Version 18 or higher required
Python
Version 3.8 or higher required
Git
For cloning the repository
API Keys
OpenAI, Anthropic, Gemini, or xAI
Option 1: Automated Setup (Recommended)
The project includes automation scripts that handle the entire setup process automatically.Configure Environment Variables
Set up your API keys before running the setup script:
You only need the API keys for the model providers you plan to use. At least one provider is required.
Run Automated Setup
Make the setup script executable and run it:The script will:
- ✅ Detect your operating system (Linux/macOS/Windows)
- ✅ Terminate conflicting processes on port 5173
- ✅ Install Node.js dependencies for the frontend
- ✅ Fix npm security vulnerabilities automatically
- ✅ Create Python virtual environment
- ✅ Install Python dependencies using
uv(faster) orpip - ✅ Handle cross-platform compatibility
You only need to run this script once for initial setup.
Start the Application
After setup completes, start both services:The application will start:
- Frontend:
http://localhost:5173 - Backend:
http://localhost:8000
The script displays process IDs for monitoring. Press
Ctrl+C to gracefully shut down both services.What the Scripts Do
setup-project.sh
Port Management
Port Management
Automatically detects and terminates conflicting processes on port 5173 using platform-specific commands:
- Linux/macOS: Uses
lsoforssto identify and kill processes - Windows: Uses
netstatandtaskkillcommands
Frontend Setup
Frontend Setup
- Clears npm cache to avoid conflicts
- Installs all Node.js dependencies in
src/app - Runs
npm audit fixto address security vulnerabilities - Replaces deprecated
@esbuild-kitpackages withtsx
Backend Setup
Backend Setup
- Installs
uvfor faster Python package management - Creates Python virtual environment in
.venv - Activates virtual environment (platform-specific paths)
- Installs Python dependencies from
requirements.txt - Falls back to standard
pipifuvfails
run-project.sh
Process Management
Process Management
- Checks for and terminates existing processes on port 5173
- Starts frontend with
npm run devin background - Starts backend with
fastapi dev main.py --host 0.0.0.0 --port 8000 - Stores process IDs for cleanup on exit
Graceful Shutdown
Graceful Shutdown
- Traps
Ctrl+Csignal for clean shutdown - Terminates both frontend and backend processes
- Ensures no orphaned processes remain
Option 2: Manual Setup
If you prefer manual setup or encounter issues with the automated scripts:Port Configuration
The application uses the following ports by default:| Service | Port | URL |
|---|---|---|
| Frontend | 5173 | http://localhost:5173 |
| Backend API | 8000 | http://localhost:8000 |
| API Docs | 8000 | http://localhost:8000/docs |
Troubleshooting
Permission Denied on Scripts
If you get a permission error when running the scripts:Windows Script Execution
On Windows, use Git Bash or WSL to run the shell scripts:Port Already in Use
The scripts automatically handle port conflicts, but if you still encounter issues:API Keys Not Working
Check Environment Variables
Check Environment Variables
Verify your API keys are set correctly:If empty, re-export them before running the scripts.
Verify API Key Format
Verify API Key Format
Ensure there are no extra spaces or quotes in your API keys:
- ✅ Correct:
export OPENAI_API_KEY=sk-proj-... - ❌ Wrong:
export OPENAI_API_KEY="sk-proj-..."(extra quotes)
Check API Key Validity
Check API Key Validity
Test your API key directly with a curl command or the provider’s dashboard to ensure it’s valid and has sufficient quota.
Frontend Build Errors
Clear Node Modules
Clear Node Modules
Update Node.js
Update Node.js
Update npm
Update npm
Backend Import Errors
Activate Virtual Environment
Activate Virtual Environment
Ensure the virtual environment is activated:
Reinstall Dependencies
Reinstall Dependencies
Check Python Version
Check Python Version
NLTK Data Missing
If you encounter NLTK data errors when using METEOR scoring:Development Workflow
Once set up, your typical development workflow:- Start Development: Run
./run-project.sh - Make Changes: Edit files in
src/app(frontend) orsrc/api(backend) - Hot Reload: Both services automatically reload on file changes
- Stop Services: Press
Ctrl+Cin the terminal
Next Steps
Environment Variables
Configure API keys and settings
Production Deployment
Deploy to production environments
API Reference
Explore the API endpoints
Model Configuration
Configure AI model providers