Backend service for the Camber Bikes Bike Fitting Application, providing RESTful API endpoints and RunPod serverless functions for bike fitting calculations and data processing.
Built for the "Silicon Valley IT Talent Program 2024" by Team "Camber Bikes".
Before you begin, ensure you have installed:
- Python 3.11 or higher
- Docker & Docker Compose
Launch the database and S3 storage using Docker:
docker-compose up -d
This will start:
- PostgreSQL database on port 5432
- MinIO S3-compatible storage on port 9000
- MinIO Console on port 9001
Navigate to the serverless directory and start the RunPod serverless function in debug mode:
cd serverless
python -m venv .venv # Create venv
source .venv/bin/activate # Activate venv
pip install -r requirements.txt # Install Requirements
python main.py --rp_debugger --rp_serve_api --rp_api_port 6969 # Launch Serverless
Serverless endpoints will be available at:
- HTTP: http://localhost:6969
Start the FastAPI development server with hot reload:
python -m venv .venv # Create venv
source .venv/bin/activate # Activate venv
pip install -r requirements.txt # Install Requirements
fastapi dev --reload # Launch Fastapi
The API will be available at http://localhost:8000
- FastAPI: Modern web framework for building APIs
- SQLAlchemy: SQL toolkit and ORM
- httpx: http requests
- Pydantic: Data validation using Python type annotations
- RunPod: Serverless GPU compute for bike fitting calculations
- PostgreSQL: Primary database
- MinIO: S3-compatible object storage for DEV
- Docker: Containerization and local development
Once the server is running, access the interactive API documentation at:
- Swagger UI: http://localhost:8000/docs
Create a .env
file in the root directory by copying the .env.example
file
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes using Conventional Commits (
git commit -m 'feat(scope): what did you change'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the AGPLv3 License - see the LICENSE file for details.
Built with ❤️ by Camber Bikes