Gainsley started from a simple annoyance: a calorie counter, a gym log and a group chat are three different apps, and the numbers never line up. Gainsley puts them in one place. What you eat, what you lift and who you train with live together, and your friends can see when you hit a PR.
It's on Google Play as an internal test, and there's a web version for the desk.
How it's built
- Phone app: Expo (React Native) with TypeScript and Zustand. Health Connect, the camera for barcodes, push notifications through Firebase, and a native home-screen widget.
- Web app: Vite + React with Tailwind and shadcn/ui, tested with Vitest and Playwright.
- Backend: two small Go services on Postgres.
apihandles everything except chat;chatis kept separate and only ever sees encrypted messages. - Sign-in goes through the same self-hosted Keycloak my other projects use.
End-to-end encrypted chats
Until November the chats used an encryption scheme I'd put together myself on top of TweetNaCl. It worked, but a self-made protocol isn't something I wanted people's messages to depend on, so I replaced it with MLS (the IETF standard behind Discord's call encryption and Google's RCS) through OpenMLS.
The cryptography is all OpenMLS's. What I wrote is the plumbing around it: a small Rust crate where each phone or browser is one MLS member, identity keys that sign each person's device list (so the server can't sneak in a device to read along), and a Go delivery service that orders messages but never sees their text. The same Rust core is compiled for Android and to WebAssembly for the browser.
Before shipping it I did a security review of my own, assuming a malicious server, and fixed what it turned up. An independent review comes next.
