"It ain't much, but it's honest work"
AI interviewer that generates coding questions, executes Python code in isolated E2B sandboxes, and provides automated feedback.
- AI-Generated Questions - LLM generates coding challenges
- Safe Code Execution - E2B sandboxes isolate user code
- Automated Scoring - LLM evaluates correctness and code quality
- Modern UI - Dark mode, Monaco editor, real-time feedback
Backend:
- FastAPI - Modern Python web framework
- LangChain - LLM orchestration
- E2B Code Interpreter - Secure sandboxed execution
- Pydantic - Data validation
Frontend:
- Next.js 14 - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- Monaco Editor - Code editing
- React Hot Toast - Notifications
- Python 3.11+
- Node.js 18+
- OpenAI API key
- E2B API key
# Copy environment template
cp .env.example .env
# Add your API keys to .env
OPENAI_API_KEY=your_openai_api_key
E2B_API_KEY=your_e2b_api_keyBackend:
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000Frontend:
cd frontend
npm install
npm run devAccess the application at http://localhost:3000
# Build and start all services
docker-compose up --build
# Run in background
docker-compose up -d --build
# Stop services
docker-compose downSee DEPLOYMENT.md for detailed instructions.
githire-e2b-cookbook/
├── backend/
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── services/ # Business logic (E2B, LLM)
│ │ ├── models/ # Pydantic schemas
│ │ ├── utils/ # Logging, helpers
│ │ └── main.py # FastAPI application
│ ├── Dockerfile
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── app/ # Next.js pages
│ │ └── components/ # React components
│ ├── Dockerfile
│ └── package.json
├── docker-compose.yml
├── DEPLOYMENT.md # Docker deployment guide
├── E2B.md # E2B technical documentation
└── .env.example
POST /api/start- Start new interview sessionPOST /api/submit- Submit code for evaluationGET /api/session/{id}- Get session dataGET /health- Health checkGET /docs- API documentation (Swagger)
E2B runs user code in isolated Docker containers:
- Each execution gets a fresh container
- No access to host system or secrets
- Automatic cleanup after execution
- 30s timeout and output limits
Environment variables (.env):
# Required
OPENAI_API_KEY= # OpenAI API key
E2B_API_KEY= # E2B API key
# Optional
LLM_MODEL=gpt-4o-mini # OpenAI model (default: gpt-4o-mini)
ENVIRONMENT=development # Environment mode
LOG_LEVEL=INFO # Logging level
FRONTEND_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:8000Backend:
# Run with auto-reload
uvicorn app.main:app --reload --port 8000
# Format code
black app/Frontend:
# Development server
npm run dev
# Build for production
npm run build
# Start production server
npm startRecommended for production:
- Use Docker deployment
- Set
ENVIRONMENT=production - Configure
LOG_LEVEL=WARNING - Implement rate limiting
- Add session persistence (Redis)
- Set up monitoring and alerts
MIT