How the marketplace is put together, drawn for the customer. It is three parts — the web client (the public site and the admin), the mobile client (the app) and the server — and every drawing below keeps their colours: blue for the web client, plum for the mobile client, brass for the server; people and outside services are outlined.
The system in its world
The marketplace is three parts that people never see as three: a website, an app and the server behind both. Buyers and sellers use the site or the app and get the same things on both; only staff use the admin, and the hub’s inspector sees nothing in it except their own workspace. Payments — Stripe Connect — authentication, shipping and letters come from outside services, each behind an interface of ours, so one can be swapped without touching the rest.
Web client — the public site and the admin
Mobile client — the app
Server — the API and the worker
People and outside services
Arrow: what it carries
Dashed: installs and updates of the app
Its parts
The site, the admin and the app each live in their own repository and talk to one server. The server answers requests in the API and does everything slower in the worker, so a payment or a letter never makes a person wait. The only thing shared between the parts is the contract — a typed client built from the API itself and published by the server, which each client updates on purpose.
Web client — the public site and the admin
Mobile client — the app
Server — the API and the worker
People and outside services
Dashed frame: the shared contract, a package each client pins
Dashed arrow: the client package reaching each client
Dotted: card details, which never pass through us
Arrow: what it carries
Modules
The product is fourteen modules, each owning one area — listings, offers, orders, payments and so on — and asking another module for what it needs instead of reaching into its data. The chain left to right is the life of an item: listed, checked, found, bought, shipped, paid for. All fourteen are in the first release; on the server they are the same fourteen, one to one.
Dots under a module: Site · App · Admin, in their part’s colour
Ring: only partly there — request and status, or preferences
Grey: not there
Arrow: what one module hands to another
Dotted: a lighter link, named below
Dotted links: Catalogue → Messaging, a conversation about a listing · Notifications → Accounts, messages to users · Administration → Payments, settings.
All fourteen are in the first release. Staged next, in no module’s first release: SMS notifications and counteroffers.
How data moves
An item is entered once and then only ever changes state — checked, published, reserved, paid, shipped, delivered — and each change is written to the database with who made it. Money is counted only on the server, in whole units of a currency, and card details never reach us. Photos and documents live in a file store, not in the database; private ones can be opened only by short-lived links.
Web client — the public site and the admin
Mobile client — the app
Server — the API and the worker
Grey band: the payment provider takes part
Arrow: what it carries
Dashed: a side branch, when a dispute is opened
Where it runs
Everything runs on AWS in Frankfurt, so the data stays in the EU. The database, queues and file store are AWS-managed services; the production database is kept in two zones. How each application is hosted is for DevOps to set, and each of the four ships on its own; the phone app reaches people through the App Store and Google Play.
Web client — the public site and the admin
Mobile client — the app
Server — the API and the worker
People and outside services
Dashed frame: AWS in Frankfurt; inside it, the applications, hosted as DevOps sets
Arrow: what it carries
One request
A buyer’s offer, accepted. One tap on the site becomes a short chain: the site’s server side, the API, the database, and a message that reaches the seller’s phone within moments. Nothing waits on a letter or a push: the worker sends them after the answer has already gone back. The seller’s reply takes the same road in the other direction.
Web client — the public site and the admin
Mobile client — the app
Server — the API and the worker
People and outside services
1A numbered step, explained below
Arrow: what it carries
Dashed: the answer going back
The buyer makes the offer.On a listing page the buyer enters a price and sends it — the public site, web client.
The site passes it on.The site’s own server side adds the buyer’s sign-in, kept in a cookie the page cannot read, and calls the API with the typed client.
The server checks and saves.The API checks that the buyer is signed in, the listing is still for sale and the price is allowed; it saves the offer with its expiry time and, in the same step, writes down “an offer was made”, so it cannot be lost. The answer goes back to the buyer at once.
The worker picks it up.It starts the offer’s expiry timer and puts a push and a letter for the seller in its queue.
The seller is told.The push goes through Apple’s or Google’s service, and a letter by email.
The seller opens it.Tapping the push opens the app on that offer — the app’s addresses are the site’s addresses — and the app loads it from the API with its token.
The seller accepts.The app sends “accept”; the API checks the offer is still waiting, has not expired and belongs to this seller’s listing, marks it accepted and saves it.
The buyer is told.The worker sends the buyer a push and a letter; opening it leads to the site’s checkout at the offered price, within a time limit.
From here the buyer pays — see How data moves, from step 4 on.