CodeScribeAI is a local-first coding assistant with:
- FastAPI backend
- React + Vite frontend
- GitHub repository analysis
- Ollama-powered AI responses
- Backend:
main.py(FastAPI) - Frontend:
frontend/(React, Vite) - Session store: SQLite (
sessions.db) - Optional async workers: Celery + Redis
- Python 3.10+
- Node.js 18+
- Ollama installed and running
- (Optional) Redis for async chat endpoints
- Copy
.env.exampleto.env - Fill real credentials and secrets
cp .env.example .envRequired keys:
APP_ENV=development
SECRET_KEY=replace-with-a-long-random-string
FRONTEND_URL=http://localhost:5173
SESSION_TTL_SECONDS=3600
SESSION_STORE_TYPE=sqlite # or "redis"
SESSIONS_DB_PATH=sessions.db
REDIS_URL=redis://localhost:6379/0
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
GITHUB_TOKEN=your_github_token
OLLAMA_URL=http://127.0.0.1:11434
OLLAMA_MODEL=phi3:mini
OLLAMA_FALLBACK_MODELS=Optional async keys:
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0# from repo root
python -m venv venv
# Windows PowerShell
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt# after installing requirements
pre-commit install
pre-commit run --all-files(If you're using a different shell, use the same commands with the appropriate activation step.)
cd frontend
npm installollama serve
ollama pull phi3:mini# from repo root
.\venv\Scripts\Activate.ps1
uvicorn main:app --reload --host 127.0.0.1 --port 8000cd frontend
npm run devOpen: http://localhost:5173
Only needed if you use async task endpoints.
# requires Redis running
.\venv\Scripts\Activate.ps1
celery -A main:celery_app worker --loglevel=info --pool=solopython -m unittest discover -s tests -vcd frontend
npm run lintGET /healthGET /api/ai-statusPOST /api/chatPOST /api/chat-async(optional, Celery)GET /repos/{username}GET /repos/{owner}/{repo}/files?recursive=trueGET /repos/{owner}/{repo}/file-content?path=...
- Never commit
.env. - Rotate any leaked credentials immediately.
- For non-development environments:
- set a strong
SECRET_KEY - use secure deployment secrets management
- set a strong
See PRODUCTION_READINESS.md for checklist and current status.