A production-ready API serving Stack Overflow code search with 18.5M+ records and full-text search capabilities.
- 82.9GB Database with 18.5M+ Stack Overflow solutions
- Full-Text Search using SQLite FTS5 optimization
- Rate Limiting with tiered access (Free: 100/day, Pro: 10k/day)
- Health Monitoring endpoints for production deployment
- Modern Frontend interface for interactive search
- Fast Search - Average query time under 100ms
- Backend: Python Flask
- Database: SQLite with FTS5 full-text search
- Web Server: Nginx
- Data Source: Stack Overflow dataset (PostgreSQL backend)
- Python 3.8+
- Nginx
- 100GB+ storage for database
- Clone the repository:
git clone https://github.com/Built-Simple/fixit-api.git
cd fixit-api- Install Python dependencies:
pip install -r requirements.txt- Configure Nginx:
sudo cp nginx-config/fixit /etc/nginx/sites-available/fixit
sudo ln -s /etc/nginx/sites-available/fixit /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl reload nginx- Run the API:
python3 working_api_with_rate_limiting.pyThe API will start on http://localhost:5001 and the frontend will be available at http://localhost/
GET /healthReturns database status and statistics:
{
"status": "healthy",
"database": "connected",
"live_stats": {
"database_size": "82.9GB",
"total_records": "18,563,455"
},
"rate_limiting": {
"enabled": true,
"tiers": {
"free": {
"daily_limit": 100,
"name": "Free Tier",
"price": 0
}
}
}
}POST /search
Content-Type: application/json
{
"query": "python error handling",
"limit": 10
}Returns matching Stack Overflow solutions:
{
"count": 10,
"query": "python error handling",
"search_time_ms": 87.3,
"total_records": "18.5M+",
"results": [
{
"id": 12345,
"title": "How to handle exceptions in Python",
"solution": "<p>Use try/except blocks...</p>",
"answer_score": 245,
"is_accepted": true,
"tags": "|python|error-handling|",
"similarity": 0.95
}
]
}The frontend provides a modern, dark-themed interface with:
- Live database statistics
- Real-time search
- Example queries
- Formatted code snippets
- Responsive design
Access at: http://localhost/
fixit-api/
├── working_api_with_rate_limiting.py # Main Flask API
├── fixit_frontend.html # Frontend interface
├── requirements.txt # Python dependencies
├── nginx-config/ # Nginx configuration
│ └── fixit # Nginx site config
├── archive/ # Historical versions
│ ├── old-apis-NOT-PRODUCTION/ # Previous API versions
│ └── backups-NOT-PRODUCTION/ # Backup files
└── README.md # This file
The API implements tiered rate limiting:
- Free Tier: 100 requests/day
- Pro Tier: 10,000 requests/day ($29/month)
Rate limits are tracked per API key and reset daily.
Production deployment includes:
- Container health monitoring
- Application health checks (every 5 minutes)
- Email alerts for failures
- Automatic restart on crashes
See README_PRODUCTION.md for production deployment details.
The database contains:
- 18,563,455 records from Stack Overflow
- Full-text search index using FTS5
- Optimized for sub-100ms query times
- 82.9GB total size
Database schema includes:
- Question titles
- Answer solutions
- Vote scores
- Tags
- Acceptance status
- Average search time: < 100ms
- Database size: 82.9GB
- Total records: 18.5M+
- Concurrent requests: Supports multiple simultaneous searches
- Cache: Rate limiting cache for fast API key validation
# Test API health
curl http://localhost:5001/health
# Test search
curl -X POST http://localhost:5001/search \
-H "Content-Type: application/json" \
-d '{"query":"python error","limit":5}'This is a production system. For changes:
- Test in a development environment
- Update documentation
- Submit pull requests with detailed descriptions
Copyright © 2025 Built Simple
- Data source: Stack Overflow
- Built with: Flask, SQLite FTS5, Nginx
- Frontend: Vanilla JavaScript with modern CSS
Production Status: ✅ Active Last Updated: December 5, 2025 Maintained by: Built Simple Team