フロントページプロジェクトブログ概要
言語

2024

PedroSauer.com: Corraling a Global Organization

E-commerce, Video Streaming Platform, Association and Payment Management - all in one?

PedroSauer.com: Corraling a Global Organization

Overview

The Pedro Sauer Brazilian Jiu-Jitsu Association is a global martial arts brand of over 100 sports academies world-wide, spanning 5 continents (North America, South America, Europe, Australia, Asia), missing only Africa and Antarctica.

PedroSauer.com is the main interface by which all the association business members pay their membership fees, and all the myriad practitioners, customers, and clients purchase merchadise, consume online content, and sign up for regular physical events planned yearly.

Goals and Motivation

Most Sports or Martial Arts brands do not leverage the best web tools for their business, but very few sports businesses have the legitimate business need and scale for reliable business systems that the Pedro Sauer Brazilian Jiu-Jitsu Association operates at.

Utilizing tools like WordPress and plugins can only take you so far, and paying for a variety of separate 3rd party services connected via webhooks and Zapier can get expensive fast.

The goal was to revamp the entire website with modern web tech and create long-lasting custom solutions that specifically address the challenges of managing hundreds of business-to-business as well as business-to-consumer transactions.

The Tech Stack Used

The goal is to combine Shopify, A Reliable and Performant Video Hosting service like Vimeo, Teachable, and Bunny.net..., oAuth2, PostgreSQL, Stripe API, ReSend API, Next.js, Express.js, and Docker to deliver all the various business needs.

PostgreSQL

Stores all franchisees as well as customer data, tracks and manages payment data, user authorization data, membership data, online content data. PostgreSQL is invaluable for this business's usecase because of relationships that existed between their clients and customers.

Express.js

Powers the back-end, written in Typescript, the biggest reason for using Express.js is mostly just for developer experience - Javascript/Typescript on the front and backends allow for ease of building.

Next.js

SEO is specifically a gigantic concern for this website's client/frontend, every page needs to be crawlable and we want maximum visiblity to the public and on social medias to increase the Association's membership.

Notable Problems We Solved

Video Data Migration

The Association has over 24 Terabytes of video footage amassed over 20 years since 1995. To make matters worse, the data was distributed in substandard methods across a variety of 3rd party services and rather unprofessional methods of storage.

We had to write a bash script (several bash scripts) that would gain access to all of the video storage services, physical media, cloud services (Google Drive, Vimeo, Teachable.com, Spinning Disc HDD's) and then run those scripts on cloud VM's to leverage the fast transfer speeds.

The scripts implemented:

Duplicate detection:

  • Queried the Bunny.net API for existing videos by title/GUID before uploading
  • Checked a local *-progress.json file that tracked which files had already been processed
  • retry-failed.py reused existing Bunny video GUIDs to avoid creating duplicates

Background execution:

  • nohup — standard Unix tool to detach the process from the terminal so it survives logout (e.g., nohup python3 scripts/hdd-to-bunny.py > /dev/null 2>&1 &)
  • caffeinate -dims — spawned as a subprocess to prevent macOS from sleeping during multi-hour transfers (-d prevent display sleep, -i prevent idle sleep, -m prevent disk sleep, -s prevent system sleep)

Resumability:

  • Progress JSON files (gdrive-to-bunny-progress.json, hdd-to-bunny-progress.json, etc.) — tracked every uploaded file so the script could pick up where it left off after interruption
  • SIGTERM/SIGINT handlers — graceful shutdown that saved progress before exiting, so re-running the script would resume rather than restart
もっとプロジェクトを見る