GithubHelp home page GithubHelp logo

andyrae / uk-box-office Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 0.0 4.66 MB

The most detailed and searchable source for box office data in the UK.

Home Page: https://boxofficedata.co.uk

License: MIT License

Python 47.06% HTML 0.04% JavaScript 0.34% CSS 0.24% Dockerfile 0.27% Mako 0.10% TypeScript 51.95%
flask nextjs typescript

uk-box-office's Introduction

UK Box Office

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.

Use the application.

Warning

Due to my time, this application was archived on 5 April 2024, and is no longer deployed or in active development.

Get Started

Codespaces

Open in GitHub Codespaces

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

Run Locally

  • With Docker: docker-compose up

Seeding Data

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
  • Seed Admissions: flask seed-admissions (requires admissions.csv)

Structure

  • src/backend/ - Flask app
  • src/backend/ukbo/api - API endpoints
  • src/backend/ukbo/services - Services
  • src/backend/ukbo/etl - ETL Pipelines / CLI Tasks
  • src/frontend/ - Next.js app

Tasks

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

Utilities

  • 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

uk-box-office's People

Contributors

andyrae avatar dependabot[bot] avatar

Stargazers

Bo avatar Mohammed Aziz avatar LaviKatiyar avatar Vladislav Sorokin avatar emre avatar Philip Van Krimpen avatar  avatar Wilson Mugabo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.