Prerequisites
- Python 3.14+ (backend)
- Node.js 20+ (frontend)
- PostgreSQL database (Supabase free tier recommended)
- Neo4j database (Neo4j Aura free tier recommended)
- Anthropic API key
- GitHub OAuth App credentials
- GitHub Personal Access Token (classic, with
reposcope)
Backend Setup
Install Python dependencies
fastapi==0.129.0- Web frameworkuvicorn==0.41.0- ASGI serveranthropic==0.83.0- Claude AI SDKasyncpg==0.31.0- PostgreSQL async driverneo4j>=5.0- Neo4j graph database drivermem0ai>=0.1.98- Semantic memory layeralembic==1.18.4- Database migrationsmcp>=1.0.0- Model Context Protocol
Configure environment variables
Copy the example environment file and fill in required values:Edit
.env and set the required values. See Environment Variables for details.Set up GitHub OAuth App
- Go to github.com/settings/developers
- Click New OAuth App
- Fill in:
- Application name:
Nectr Local - Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:8000/auth/github/callback
- Application name:
- Copy the Client ID and Client Secret to your
.envfile
Create GitHub Personal Access Token
- Go to github.com/settings/tokens
- Click Generate new token (classic)
- Select scope: repo (full control of private repositories)
- Copy the token and set it as
GITHUB_PATin.env
Run database migrations
Alembic migrations run automatically on startup, but you can run them manually:
Frontend Setup
Install dependencies
[email protected]- React framework[email protected]- UI library@tanstack/react-query@^5.90.21- Data fetchingaxios@^1.13.6- HTTP clientrecharts@^3.7.0- Analytics chartstailwindcss@^4- Styling
Verify Installation
-
Backend health check:
Expected response:
-
Frontend: Navigate to
http://localhost:3001and click Sign in with GitHub - OAuth flow: You should be redirected to GitHub, then back to the dashboard
Development Workflow
Hot Reload
Both backend and frontend support hot reload:- Backend: Uvicorn auto-reloads on
.pyfile changes - Frontend: Next.js Turbopack reloads on
.tsx/.tsfile changes
Database Changes
When you modify SQLAlchemy models:Neo4j Schema Changes
Editapp/core/neo4j_schema.py to add new constraints or indexes. They will be applied on next server restart.
Debugging
- Backend logs: Check the terminal where
uvicornis running - Set log level: Change
LOG_LEVEL=DEBUGin.env - Frontend console: Open browser DevTools → Console
- Network requests: DevTools → Network tab (filter by “Fetch/XHR”)
Common Issues
Database connection failed
Database connection failed
- Verify
DATABASE_URLin.envis correct - Check that PostgreSQL is running and accessible
- For Supabase: use Session Mode connection string (port 5432)
Neo4j connection failed
Neo4j connection failed
- Verify
NEO4J_URI,NEO4J_USERNAME,NEO4J_PASSWORDin.env - Ensure Neo4j Aura database is running
- Check that your IP is whitelisted in Neo4j Aura console
GitHub OAuth fails
GitHub OAuth fails
- Verify
GITHUB_CLIENT_IDandGITHUB_CLIENT_SECRETin.env - Check that the OAuth callback URL in GitHub settings matches
http://localhost:8000/auth/github/callback - Ensure
BACKEND_URLandFRONTEND_URLin.envare correct
CORS errors in browser
CORS errors in browser
- Verify
FRONTEND_URLin backend.envmatches your frontend URL - Check that
NEXT_PUBLIC_API_URLin frontend.env.localmatches backend URL - Ensure cookies are enabled in your browser
Anthropic API errors
Anthropic API errors
- Verify
ANTHROPIC_API_KEYin.envis valid - Check your API key has sufficient credits at console.anthropic.com
- Ensure
ANTHROPIC_MODEL=claude-sonnet-4-5-20250929is set
Next Steps
Environment Variables
Complete reference of all environment variables
Architecture
Understand how Nectr is built
Deployment
Deploy to Railway and Vercel
Database Setup
PostgreSQL and Neo4j configuration