Skip to main content

Prerequisites

Before setting up FootyCollect locally, ensure you have the following installed:
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

1

Clone the repository

Clone the FootyCollect repository and navigate to the project directory:
2

Create a virtual environment

Create and activate a Python virtual environment:
3

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)
4

Configure environment variables

Set up your environment configuration:
Edit .env and configure at minimum:
  • DJANGO_SECRET_KEY - Generate with Django utilities
  • DATABASE_URL - Your PostgreSQL connection string
  • REDIS_URL - Your Redis connection string
For local development, set DJANGO_DEBUG=True. Never use this in production!
See Environment Variables for a complete reference.
5

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
6

Create a superuser

Create an admin account to access Django admin:
Follow the prompts to set username, email, and password.
7

Collect static files

Gather static files (CSS, JavaScript, images) for serving:
8

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:
You can adjust intervals later in Django Admin under django_celery_beat → Periodic tasks.
For a complete development environment with all services (Django, PostgreSQL, Redis, Celery, Mailpit), consider using Docker Setup instead.

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

This will delete all data!

API Documentation

When running the development server, interactive API documentation is available: The API uses OpenAPI 3.0 specification generated by drf-spectacular.

Email Testing

For local development, Django is configured to print emails to the console by default. For a visual email testing interface, use Docker Setup which includes Mailpit at http://localhost:8025.

Troubleshooting

Database Connection Errors

Ensure PostgreSQL is running:

Redis Connection Errors

Ensure Redis is running:

Module Import Errors

Ensure your virtual environment is activated and dependencies are installed:

Next Steps

Docker Setup

Use Docker Compose for a complete development environment

Environment Variables

Complete reference for all configuration options

Development Guide

Learn about the architecture and development workflow

API Reference

Explore the REST API endpoints