- 📌 About
- 🚀 Features
- 🛠️ Prerequisites
- 🏁 Getting Started
- 🐳 Dockerized Deployment
- 📚 API Reference
- 🔒 CORS & HTTPS
BetterSurf is a FastAPI-based service that aggregates and compares internet-provider offers from multiple vendors.
It exposes both REST and WebSocket endpoints and comes fully Dockerized for easy deployment.
- 🔄 HTTP & WebSocket endpoints for real-time offer streaming
- 🛡️ Health-check & graceful shutdown
- 🔌 Circuit-breaker integration per provider
- ☁️ CORS middleware preconfigured
- 📜 Auto-generated OpenAPI docs (
/docs&/redoc) - 🐳 Docker & Docker-Compose setup ready for production
- ⚙️ Env-based settings with secure credential management
- Python 3.12
- Docker & Docker-Compose (if using containers)
ngrokor equivalent (for HTTPS tunneling)
git clone https://github.com/jaylann/gendev.git
cd bettersurfWe use uv for ultra-fast installs. Fallback to pip if you prefer:
# Using uv
uv pip install --system -r requirements.txt
# Or with pip
pip install --no-cache-dir -r requirements.txt-
Copy
.env.exampleto.env -
Fill in your API keys and credentials:
# .env VERBYNDICH_API_KEY=YOUR_API_KEY_HERE SERVUSSPEED_USERNAME=YOUR_USERNAME_HERE SERVUSSPEED_PASSWORD=YOUR_PASSWORD_HERE PINGPERFECT_CLIENT_ID=YOUR_CLIENT_ID_HERE PINGPERFECT_SECRET=YOUR_SECRET_HERE WEBWUNDER_API_KEY=YOUR_API_KEY_HERE BYTEME_API_KEY=YOUR_API_KEY_HERE
-
(Optional) Override any service endpoints if needed as well as cache ttl.
uvicorn main:app --reload --host 0.0.0.0 --port 8000- Docs: http://localhost:8000/docs
- Redoc: http://localhost:8000/redoc
Build and run with Docker Compose:
docker-compose up --build -d- The FastAPI app listens on
8000internally. - Nginx proxies HTTP (
/) and WebSocket (/ws/) traffic on port80. - Built-in health-check ensures the app is ready before Nginx routes traffic.
Refer to the OpenAPI docs for full schema.
By default, CORS is wide open for development:
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["GET","POST","OPTIONS"],
allow_headers=["*"],
)
⚠️ Production: Restrictallow_originsandallow_methodsto your front-end domains.
To expose your local server over HTTPS for testing:
-
Install ngrok.
-
Start your FastAPI app on port 8000.
-
In a new terminal, run:
ngrok http 8000
-
Copy the generated
https://…ngrok.ioURL and use it to call your API endpoints securely.
Made with ❤️ by Justin Lanfermann