Overview
Coop-on replaces drink tokens at festivals and events with a digital wallet. Visitors top up their wallet with real money and pay at the stands from it; organisers see in real time where the money goes. For Web Services, I built the back end: the REST API that acts as the bank of the event.
What I built
- Endpoints for users, organisers, vendors, events, wallets and transactions, documented with Swagger.
- Authentication with JWT and argon2-hashed passwords, plus role-based access for admins, organisers, vendors and visitors.
- Topping up through Stripe: the API opens a Stripe Checkout session, and a webhook credits the wallet once the payment has gone through.
- A MySQL database with Drizzle ORM. Every user has one wallet per event, and every transaction links the wallet that paid, the vendor that got paid and the event it happened at.
- End-to-end tests with Jest and Supertest, each suite running against its own temporary test database.
- A Docker image and a live deployment on Render.
What I learned
How to design an API that someone else can build a front end on: thinking in resources, choosing clear endpoints (the part I struggled with most at the start), validating every input and testing complete flows instead of single functions. In hindsight I made the scope bigger than the course needed, but it left me with a solid base to keep building on.