UK Box Office data is the most detailed and searchable source for box office data in the UK. The backend runs Flask built with Python, the frontend is built with Next.js in Typescript, using chart.js for visualisation, and shadcn/ui for components.
Warning
Due to my time, this application was archived on 5 April 2024, and is no longer deployed or in active development.
This codespace will run the services needed for the application; the backend, frontend, and database.
Run backend:
cd src/backend; flask run
- Change the Port Visibility to
Public
Run frontend:
cd src/frontend; npm start
- With Docker:
docker-compose up
Seeding data requires you to have a archive.csv
of box office data in src/backend/data/
.
You can find the entire dataset to use here.
It will take a long time to seed the data, so you should try the --year
flag to only seed a single year.
- Make database migrations, inside
src/backend
flask db upgrade
- Seed films:
flask seed-films
- Seed box office:
flask seed-box-office
- Additionally takes
--year
option for a specific year:--year 2007
- Additionally takes
- Seed Admissions:
flask seed-admissions
(requiresadmissions.csv
)
src/backend/
- Flask appsrc/backend/ukbo/api
- API endpointssrc/backend/ukbo/services
- Servicessrc/backend/ukbo/etl
- ETL Pipelines / CLI Taskssrc/frontend/
- Next.js app
These run weekly on a Wednesday, if they fail you can run them manually:
- Fetch new box office data
flask weekly-etl
- Build a new box office forecast
flask forecast
- Fetch new box office data from a specific link (works as a backup):
flask backup-etl {link to file} "01 January 2007"
- Delete and rollback the last week of data:
flask rollback-etl
- Delete and rollback a specific year of data:
flask rollback-year --year 2007
- Update admissions manually:
flask update-admissions --year 2020 --month 1 --admissions 100