The unglamorous back end of an investment platform
Investor onboarding, identity checks, contracts, a secondary market and wallet transfers, built as services that never lose track of who owns what.
On an investment platform the exciting part is a button that says “Invest”. Everything behind that button is paperwork, and the paperwork has to be right every time.
Onboarding is a state machine
An investor moves through identity checks with external providers, contract generation and broker approval. Each step can pass, fail, or wait on a human. I built this in Go with GraphQL services, and treated it as what it is: a state machine with an audit trail, not a wizard with a progress bar.
A market needs a referee
The secondary market lets investors trade with each other. That means order matching, then moving money between wallets, then tracking the token that represents the holding through to settlement. Each of those can fail independently, so each is recorded and recoverable. “The money moved but the token didn’t” is not a state you want to discover in production.
Events, not polling
Document updates and notifications go through Pub/Sub. Services announce what happened; the ones that care react. It keeps onboarding from knowing anything about email, and email from knowing anything about contracts.
Three environments, one definition
Development, test and production are provisioned on Google Cloud with Terraform, and deployments to Cloud Run are automated with GitHub Actions. When an auditor asks “is test the same as production?”, the honest answer should be “read the repository”.
The front end still matters
The React and Next.js screens for submitting and tracking investments got their own round of optimisation. A slow confirmation page on a money product reads as “something went wrong”, even when nothing did.
Lessons
- Model the process before the API. The states are the product.
- Make every money movement recoverable, and prove it by breaking it on purpose.
- Infrastructure as code is compliance documentation you don’t have to write twice.