A Django-based web application for managing your football memorabilia collection. It integrates with the Football Kit Archive via FKAPI to search and add kits by club, season, and competition—making FKAPI central to discovering and cataloguing items in your collection.
License: MIT
- Live Demo
- Overview
- Architecture
- Quick Start
- Development
- API Documentation
- Testing
- Deployment
- Documentation
Try FootyCollect without installing anything: https://footycollect-demo.sunr4y.dev/
| Feature | Description |
|---|---|
| Registration | Disabled. Use the demo account: sign in with the pre-configured demo user (auto-login or use the demo credentials shown on the site). |
| Safe to experiment | Create, edit, and delete items and photos as you like—the database is restored from a snapshot every 3 hours, so no changes are permanent. |
FootyCollect is a comprehensive platform for football memorabilia collectors to catalog, organize, and manage their collections. The application supports various item types including jerseys, shorts, outerwear, and tracksuits.
FKAPI and the Football Kit Archive. FootyCollect uses FKAPI (Football Kit Archive API) as the main source for kit metadata when adding items: you search by club, season, and competition, then create items with pre-filled data (colors, design, competitions, logos). Without FKAPI running, you can still use the app for manual entry and photo management; with FKAPI, you get that search-and-add flow and bulk imports from the archive (e.g. populate_user_collection). Deploy or run fkapi alongside FootyCollect if you want these features.
Search and add items from the Football Kit Archive
| Feature | Description |
|---|---|
| Multi-Item Type Support | Manage jerseys, shorts, outerwear, and tracksuits |
| FKAPI Integration | Search and add kits from the Football Kit Archive via fkapi; optional but core to the intended workflow |
| Photo Management | Upload and organize photos for each item |
| Advanced Search | Filter and search your collection |
| User Profiles | Personal collections with privacy controls |
| RESTful API | Complete API for programmatic access |
FootyCollect follows a clean architecture pattern with clear separation of concerns:
The application uses a service layer to encapsulate business logic, keeping views thin and models focused on data representation. Services handle:
- Item creation and management
- Photo processing and optimization
- External API integration
- Collection operations
See Service Layer and Database Schema for details.
Item types (Jersey, Shorts, Outerwear, Tracksuit) use Django's Multi-Table Inheritance pattern:
BaseItem: Common fields and behavior for all items- Specific models: Item-type-specific fields and logic
- One-to-one relationship between
BaseItemand specific item models
See Architecture Decision Records for design rationale.
| Layer | Technology |
|---|---|
| Backend | Django 5.0+ with Django REST Framework |
| Database | PostgreSQL |
| Cache | Redis |
| Task Queue | Celery |
| Frontend | Django Templates with Cotton Components, Bootstrap 5, Alpine.js, HTMX |
| API Documentation | drf-spectacular (OpenAPI/Swagger) |
| Requirement | Version | Notes |
|---|---|---|
| Python | 3.11+ | Required |
| PostgreSQL | 14+ | Required |
| Redis | 6+ | Required |
| fkapi | Latest | Optional — required if you want to use automatic kit addition (lookup and add kits from the Football Kit Archive). See fkapi |
-
Clone the repository:
git clone https://github.com/sunr4y/FootyCollect.git cd FootyCollect/footycollect -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements/local.txt
-
Set up environment variables:
# If using Docker: copy and edit .envs/.local/.django and .envs/.local/.postgres # Otherwise: cp deploy/env.example .env and edit .env
-
Run migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Collect static files:
python manage.py collectstatic --noinput
-
Start the development server:
python manage.py runserver
The application will be available at http://127.0.0.1:8000
For a complete development environment with all services:
docker compose -f docker-compose.local.yml upThis starts:
| Service | Description |
|---|---|
| Django application | Main web server |
| PostgreSQL database | Data persistence |
| Redis cache | Caching layer |
| Celery worker | Background task processing |
| Celery beat | Scheduled tasks scheduler |
| Mailpit | Email testing (development) |
footycollect/
├── config/ # Django settings and configuration
│ ├── settings/ # Environment-specific settings
│ └── checks.py # Production validation checks
├── footycollect/ # Main application code (tests in footycollect/*/tests/)
│ ├── api/ # API client for external services
│ ├── collection/ # Collection app (items, photos, etc.)
│ ├── core/ # Core models (clubs, seasons, etc.)
│ └── users/ # User management
├── deploy/ # Production deployment files
└── docs/ # Architecture and Sphinx documentation
- Linting: Ruff for code formatting and linting
- Type Checking: mypy for static type analysis
- Testing: pytest with coverage reporting
Run quality checks:
source venv/bin/activate # or: . venv/bin/activate | Windows: venv\Scripts\activate
# Format code
ruff format .
# Lint code
ruff check .
# Type checking
mypy footycollect
# Run tests
pytestCreate migrations:
python manage.py makemigrationsApply migrations:
python manage.py migrateStart Celery worker:
celery -A config.celery_app worker -l infoStart Celery beat (periodic tasks):
celery -A config.celery_app beatSet default periodic task frequencies (orphaned-photos cleanup, etc.):
python manage.py setup_beat_scheduleAdjust intervals later in Django Admin: django_celery_beat → Periodic tasks.
For an overview of the API and other project docs, see the hosted documentation: https://docs.footycollect.sunr4y.dev/.
Interactive API documentation is available at:
- Swagger UI:
/api/docs/(development only) - OpenAPI Schema:
/api/schema/
The API uses OpenAPI 3.0 specification generated by drf-spectacular. All endpoints are documented with request/response schemas, authentication requirements, and examples.
| Endpoint | Description |
|---|---|
/api/ |
Internal server APIs (DRF) |
/fkapi/ |
External API proxy endpoints |
See Deployment Guide for environment and endpoint details.
# Run all tests (coverage via pytest-cov in pytest.ini)
pytest
# View HTML coverage after a run
open htmlcov/index.html
# Run specific test file
pytest footycollect/collection/tests/test_models.pyTests are organized by app and functionality:
| Test File | Purpose |
|---|---|
test_models.py |
Model tests |
test_views.py |
View tests |
test_services.py |
Service layer tests |
test_forms.py |
Form validation tests |
FootyCollect can be deployed to any VPS or cloud platform. See the Deployment Guide for detailed instructions.
- Set
DEBUG=Falsein production settings - Configure
ALLOWED_HOSTS - Set secure
SECRET_KEY - Configure database connection
- Set up Redis for caching
- Configure static file serving
- Set up SSL/TLS certificates
- Configure email backend
- Set up monitoring (Sentry)
- Run production checks:
python manage.py check --deploy
Required production environment variables:
| Variable | Description |
|---|---|
DJANGO_SECRET_KEY |
Django secret key |
DATABASE_URL |
PostgreSQL connection string |
REDIS_URL |
Redis connection string |
DJANGO_ALLOWED_HOSTS |
Comma-separated list of allowed hosts |
FKA_API_IP |
Football Kit Archive API IP |
API_KEY |
API key for external services |
See deploy/env.example for a complete list.
- Hosted documentation: https://docs.footycollect.sunr4y.dev/
- Service Layer
- Database Schema
- Multi-Table Inheritance
- Service Layer Pattern (ADR)
- Deployment Guide
ADRs document key architectural decisions:
Sphinx documentation can be built and served:
docker compose -f docker-compose.docs.yml upDocumentation will be available at http://127.0.0.1:9000
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
MIT License - see LICENSE file for details.
For issues and questions:
- GitHub Issues: https://github.com/sunr4y/FootyCollect/issues
- Documentation: Hosted docs or the
docs/directory

