- Python 3.11+
- Node.js 18+
- Poetry (recommended) or pip
- SQLite3
-
Clone and navigate to the project
cd llm-sql-auditor -
Set up environment
cp .env.example .env # Edit .env and add OPENAI_API_KEY if you want LLM features -
Install Python dependencies
poetry install # OR pip install -r requirements.txt -
Seed the demo database
./scripts/seed_demo.sh
-
Start the application
Option A: Use the dev script
./scripts/dev_up.sh
Option B: Manual start
# Terminal 1: Backend poetry run uvicorn backend.app:app --reload --port 8000 # Terminal 2: Frontend cd frontend npm install npm run dev
-
Access the application
- Frontend: Available on the configured port (default: 5173)
- API: Available on the configured port (default: 8000)
- API Docs: Available at
/docsendpoint
docker-compose up --build# Run all tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=backend --cov-report=html- Open the frontend application in your browser
- Paste schema DDL
- Enter SQL queries (separate with
---) - Click "Analyze Queries"
curl -X POST <API_URL>/api/audit \
-H "Content-Type: application/json" \
-d '{
"schema": "CREATE TABLE users (id INTEGER, email TEXT);",
"queries": ["SELECT * FROM users;"],
"dialect": "postgres"
}'- Port already in use: Change ports in
docker-compose.ymlor use different ports - Database not found: Run
./scripts/seed_demo.sh - LLM features not working: Ensure
OPENAI_API_KEYis set in.env - Frontend not connecting: Check that backend is running on port 8000