Automated Action 0cd6e6441d Setup FastAPI REST API for Sports Betting Verification
- Set up FastAPI application structure
- Implemented SQLite database integration with SQLAlchemy
- Added Alembic migrations for database versioning
- Created bet model and API endpoints for CRUD operations
- Added comprehensive README with setup and usage instructions
- Added health check endpoint and CORS support
2025-06-07 13:06:19 +00:00
2025-06-07 13:00:25 +00:00

Sports Betting Verification API

A FastAPI-based REST API for verifying sports betting information. This application provides endpoints to manage and verify sports bets.

Features

  • RESTful API with FastAPI
  • SQLite database integration with SQLAlchemy ORM
  • Database migrations with Alembic
  • CORS support for all origins
  • Health check endpoint
  • OpenAPI documentation
  • Input validation with Pydantic

Getting Started

Prerequisites

  • Python 3.8 or higher
  • pip (Python package installer)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd sportsbettingverificationapi
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Run database migrations:

    alembic upgrade head
    
  4. Start the API server:

    uvicorn main:app --reload
    

The API will be available at http://localhost:8000

API Documentation

Once the application is running, you can access the automatically generated API documentation:

API Endpoints

  • GET /: Root endpoint with API information
  • GET /health: Health check endpoint
  • GET /api/v1/bets: List all bets
  • POST /api/v1/bets: Create a new bet
  • GET /api/v1/bets/{id}: Get details of a specific bet
  • PUT /api/v1/bets/{id}: Update a bet
  • DELETE /api/v1/bets/{id}: Delete a bet

Project Structure

.
├── alembic.ini              # Alembic configuration
├── app/                     # Application code
│   ├── api/                 # API endpoints
│   │   └── api_v1/          # API version 1
│   │       ├── api.py       # API router
│   │       └── endpoints/   # API endpoint modules
│   ├── core/                # Core functionality
│   │   └── config.py        # Application configuration
│   ├── crud/                # CRUD operations
│   ├── db/                  # Database setup
│   │   ├── base.py          # SQLAlchemy models registry
│   │   ├── base_class.py    # SQLAlchemy base class
│   │   ├── deps.py          # Dependencies for database
│   │   └── session.py       # Database session
│   ├── models/              # SQLAlchemy models
│   ├── schemas/             # Pydantic schemas
│   └── utils/               # Utility functions
├── migrations/              # Alembic migration scripts
│   └── versions/            # Migration versions
├── main.py                  # Application entry point
└── requirements.txt         # Python dependencies

Database

The application uses SQLite for data storage. The database file is located at /app/storage/db/db.sqlite.

Environment Variables

The application supports the following environment variables:

  • API_V1_STR: API version 1 prefix (default: "/api/v1")
  • PROJECT_NAME: Project name (default: "Sports Betting Verification API")
  • PROJECT_DESCRIPTION: Project description
  • CORS_ORIGINS: Comma-separated list of allowed CORS origins (default: all origins are allowed)

Development

Running Tests

pytest

Linting

ruff check .

Auto-fix Linting Issues

ruff check --fix .

License

[Specify license information]

Description
Project: Sports Betting Verification API
Readme 42 KiB
Languages
Python 96.9%
Mako 3.1%