Prerequisites
Before setting up FootyCollect locally, ensure you have the following installed:| Requirement | Version | Notes |
|---|---|---|
| Python | 3.11+ | Required |
| PostgreSQL | 14+ | Required for database |
| Redis | 6+ | Required for caching and Celery |
| fkapi | Latest | Optional - required for Football Kit Archive integration (GitHub) |
FootyCollect integrates with the Football Kit Archive via FKAPI to search and add kits by club, season, and competition. While FKAPI is optional, it’s central to the intended workflow for discovering and cataloguing items.
Installation Steps
Install dependencies
Install the required Python packages for local development:This installs:
- Django 5.0.8 with REST Framework
- PostgreSQL adapter (psycopg)
- Redis client
- Celery for background tasks
- Development tools (pytest, mypy, ruff)
- And more (see requirements/base.txt)
Configure environment variables
Set up your environment configuration:Edit
.env and configure at minimum:DJANGO_SECRET_KEY- Generate with Django utilitiesDATABASE_URL- Your PostgreSQL connection stringREDIS_URL- Your Redis connection string
Run database migrations
Apply database migrations to set up the schema:This creates all necessary tables for:
- User management
- Collection items (jerseys, shorts, outerwear, tracksuits)
- Photos and media
- Clubs, seasons, and competitions
Create a superuser
Create an admin account to access Django admin:Follow the prompts to set username, email, and password.
Start the development server
Launch the Django development server:The application will be available at: http://127.0.0.1:8000Access the admin interface at: http://127.0.0.1:8000/admin/
Running Background Workers
FootyCollect uses Celery for background tasks like image processing and periodic cleanup.Start Celery Worker
In a separate terminal (with your virtual environment activated):Start Celery Beat (Scheduled Tasks)
For periodic tasks like orphaned photo cleanup:Configure Periodic Tasks
Set up default periodic task frequencies:Project Structure
Understanding the codebase organization:Code Quality Tools
FootyCollect uses several tools to maintain code quality:Formatting and Linting
Type Checking
Running Tests
Database Management
Creating Migrations
After modifying models:Applying Migrations
Resetting the Database
API Documentation
When running the development server, interactive API documentation is available:- Swagger UI: http://127.0.0.1:8000/api/docs/ (development only)
- OpenAPI Schema: http://127.0.0.1:8000/api/schema/