This is the backend API for the KickForecast application, built with FastAPI. It provides a CMS for managing content and serves data to the frontend.
- Python 3.8+
- PostgreSQL
- Poetry
-
Clone the repository:
git clone <repository-url> cd kickforecast-backend
-
Install dependencies:
poetry install
-
Environment Variables: Copy the example environment file to create your local configuration:
cp .env.example .env
-
Update
.env: Open.envand configure the following variables:DATABASE_URL: Your PostgreSQL connection string (e.g.,postgresql://user:password@localhost/kickforecast).SECRET_KEY: A secure secret key for JWT tokens.ALGORITHM: Encryption algorithm (default: HS256).ACCESS_TOKEN_EXPIRE_MINUTES: Token expiration time.
-
Run Migrations: Apply the database schema using Alembic:
poetry run alembic upgrade head
-
Seed Database: Populate the database with initial data:
poetry run python seed.py
Start the development server:
poetry run uvicorn app.main:app --reloadThe API will be available at http://localhost:8000.
Interactive API documentation is available at http://localhost:8000/docs.