Sh*t yourself rich!

SH*T YOURSELF RICH! SH*T YOURSELF RICH! SH*T YOURSELF RICH!

SH*T YOURSELF RICH! SH*T YOURSELF RICH! SH*T YOURSELF RICH!

SH*T YOURSELF RICH! SH*T YOURSELF RICH! SH*T YOURSELF RICH!

SH*T YOURSELF RICH! SH*T YOURSELF RICH! SH*T YOURSELF RICH!

About the project

Abstract

Sh*t yourself rich (or "Schijt je Rijk" in Dutch) started as a one-off. It was a ticketing site for a fundraiser I organised with my scouting group: a field is divided into a grid of numbered squares which people can buy up. On the day the event takes place, a cow is let loose on the field. Whoever owns the square it does its business on, wins the pot.

It has grown past that one edition since. I've spent some time improving the maintainability of the project and allowing organisers to run it themselves.

Buying a square

Squares have a set price and the pot grows with every one that's sold. The one thing that really has to hold, is that a square cannot be sold twice. Clicking one reserves it for a few minutes and the payment is tied to that reservation, so two people picking the same square in the same second can never both end up paying for it. It's basic ACID compliance, but really important here.

I don't like having to create accounts either. The platform only collects a name for identification and an email to send a confirmation & receipt to. Payments can be made using the Stripe integration, or cash by adding a new entry in the admin panel.

Stripe
AWS Lambda

Running the event

The event has a handful of states and the site behaves differently in each one. The sale opens and later closes, the cow goes onto the field, a winning square is declared. Payments are not possible in some states, and the board is displayed differently depending on the state too.

Organisers handle the entire process from an admin panel: change the state, search the purchases, correct a name, add a sale that was paid in cash. Prices, board size, rules, dates, texts and colours are editable there too, so next year's organisers can set up their own edition without me.

React
Cognito

Technologies

Other

Everything runs serverless on AWS. The event sells for a few weeks a year and sits idle the rest of the time, so it costs close to nothing when nobody is using it.

TypeScript

Used across frontend, backend and infrastructure

React

Public board and admin panel

Tailwind CSS

CSS framework for styling

Stripe

Payments and payment webhooks

AWS Lambda

Runs the API

API Gateway

Fronts the API, on the same origin as the site

DynamoDB

Database for purchases, squares and editions

Amazon S3

Static hosting, behind a CDN

Cognito

Admin authentication

Terraform

Infrastructure as code, four environments

GitHub Actions

Tests, infrastructure plans and deployments

Vitest

Unit, integration and component tests

And more...

FOOTER FOOTER FOOTER FOOTER

FOOTER FOOTER FOOTER FOOTER

FOOTER FOOTER FOOTER FOOTER

FOOTER FOOTER FOOTER FOOTER