Skip to content
Casper Havelykke
All projects

Pejling

A drink counter for a night out. You tap every time you have a drink, and the app shows how many standard drinks are still active in your body. Published on the App Store.

Three screens from Pejling, the home screen with the owl and 1.6 active drinks, the history for September, and the home screen at 9.4 drinks telling you to go home

Pejling is a React Native app built with Expo, and it’s pure frontend. Everything stays on the phone, with no account, no tracking and no ads. I designed and built it and got it through App Store review on my own, using AI as a tool along the way.

The home screen with the owl, 1.6 active drinks and buttons for beer, wine, cocktail and shot The list of tonight's four drinks with times and an undo button on each The calendar for September with drinks per night and details for the 19th The home screen at 9.4 active drinks, with a dark red background and the owl telling you to go home
The home screen, tonight's drinks, the history and the home screen when it's time to go home.

How it calculates

  • One standard drink is 12 g of alcohol. Blood alcohol is estimated with Widmark’s formula from weight and sex, and the body burns about 0.15 per mille an hour. Active drinks are the blood alcohol converted back into drinks.
  • A night closes by itself once the body has been at zero for more than three hours, and it’s saved to the history.
  • Weight and sex are stored with every entry, so past nights don’t change when you edit your settings.

The app is indicative only. It doesn’t measure blood alcohol and can’t be used to judge whether you can drive.

How it’s built

  • The calculation lives in plain TypeScript without UI and is covered by tests.
  • An owl comments on the night, and the colours change as more drinks become active.
  • Data is stored in SQLite on the phone. During development the app can also run in the browser, and then it uses localStorage instead.
  • A calendar shows past nights, and the colour shows each night’s highest number of active drinks.