Vuorokone plans cleaning visits for Kotova Oy and covers sick cleaners' visits the same day. The demo runs entirely on one computer. The real app keeps the same code and database rules, and moves them online with real email, push alerts and backups.
The code and the database rules stay the same. What changes is where each part runs, whose data is in it, and the services around it.
| Part | Demo today | Real app |
|---|---|---|
| Users | Test accounts that share one development password | Kotova staff, each invited by email; nobody else can make an account |
| Address | localhost:5174 | Its own domain over HTTPS |
| Serving the app | Vite dev server with hot reload | Built files on a static host with a CDN |
| Backend | Supabase in Docker on the laptop | Hosted Supabase Free, in an EU region |
| Data | Sample data: 20 cleaners, 16 customers, 22 photos; reset at any time | Kotova's customers and schedule, brought in by CSV import |
| Mailpit catches every email; nothing leaves the computer | A free transactional email service as custom SMTP | |
| Google and X | Buttons only | Switched on in Supabase Auth |
| Sign-in function | Local edge runtime | Deployed, accepting passkeys and QR codes only from the app's own addresses |
| Alerts | Screens refresh every 30–60 seconds | Web push for offers, published changes and sick reports, with email as fallback |
| Offline | Needs the connection | The cleaner's day view works offline |
| Backups | None needed | Nightly, encrypted, EU-hosted (place still to choose) |
| Privacy | Not needed for sample data | Privacy notice, GDPR export and erase, retention clean-up |
| Cost | 0 € | 0 €, on free tiers with no card on file |
Amber text marks what is planned in the roadmap but not built yet.
The assignment's picture shows a typical web system built to be scalable, reliable and efficient. A request travels from left to right, and slow work is moved aside so the user never waits for it.
People using the system through a browser or app. Everything else exists to answer them quickly and correctly.
The internet's phone book: turns a name such as app.example.com into the servers' address, and can send users to the nearest region.
One front door that spreads requests over many servers, skips servers that are down, and lets servers be added without users noticing.
Handle HTTP: serve pages and files, handle HTTPS, and pass the real work on. Kept stateless so any copy can answer any request.
The business logic: check who you are, apply the rules, read and write data. Also stateless, so they scale by adding copies.
The lasting record of truth. Usually the hardest part to scale, so the cache and background work protect it.
A fast in-memory store, such as Redis, for answers read often. Cuts database load and response time; must be refreshed when data changes.
A to-do list between services. The app server drops a job in and replies at once; the job waits safely until a worker takes it.
Background processes that take jobs from the queue, such as emails, reports or image processing, and can update the cache when done.
Cheap, lasting storage for files such as photos, for example S3. Files stay out of the database and are served by link.
Vuorokone uses a managed backend, Supabase, instead of running its own servers. Most boxes from the model are still there, but some are merged, because one company with about 20 cleaners does not need ten separate services.
| Model | In Vuorokone | Why this way |
|---|---|---|
| Users | Office staff on the desktop layout; cleaners on the phone layout. One codebase picks the layout by role. | Cleaners need today and this week; the office needs the planning board. |
| DNS | The app's domain points to the static host; the API has its own Supabase address. | The two halves can move or scale on their own. |
| Load balancer | The Supabase API gateway: one HTTPS entry that checks the API key and routes /auth, /rest, /functions and /storage. | Run by the platform; no servers to manage. |
| Web servers | A static host with a CDN serving the built React app. No server rendering. | Static files are cheap, fast and fit a free plan. |
| Application servers | The REST API (PostgREST) with database functions, plus edge functions for sign-in and, later, push. | Rules live next to the data, so no client can skip them. |
| Database | PostgreSQL with row-level security on every table, built from 10 migrations. | One source of truth; each person sees only their own company. |
| Cache | The browser's query cache (TanStack Query) and the CDN. Photo links are reused for 50 minutes. | No Redis needed at this size; the cache sits where the reads happen. |
| Message queue | The customer outbox table: a published change drafts one notice per visit, and the office sends it and marks it sent. | A table-backed queue cannot lose a notice and needs no extra service. |
| Worker services | pg_cron jobs in the database: create visits nightly at 01:15 and clear old sign-in attempts hourly. | Simple scheduled work; nothing extra to deploy or watch. |
| Object storage | A private avatars bucket: JPEG only, 1 MiB per file, opened through signed links. | Photos stay out of the database, and only colleagues can see them. |
The app is static files on a CDN, so more users cost almost nothing. The backend is stateless behind the gateway, and team-wide reads are batched into one request. The database is the limit, and can move to a larger plan.
Rules are enforced in the database, so a bug in the app cannot give a visit to someone without the skill or with a clash. The outbox keeps every notice until it is handled. 256 database tests and 23 browser tests, run in Chromium and Firefox, cover the main paths.
Free plans with no card on file. Live screens refresh only while they are open. Photos are shrunk in the browser before upload, so storage and transfer stay small.
Row-level security on every table, invitation-only accounts, a private photo bucket with signed links, rate-limited sign-in, and passkeys and QR codes accepted only from the app's own addresses.
The demo refreshes on a timer: simple and enough for one office. The real app adds push alerts; with many companies, a realtime channel would cut needless requests.
The outbox table and pg_cron are enough today. Sending messages automatically, or heavy reports, would add a real queue and worker functions.
Strong guarantees and one place for the rules, but SQL is harder to change than app code. Database tests keep it safe to change.
Fine for one company in Finland. Many customers would need read replicas, connection pooling, backups in a second place and a shared cache.
Still to decide with Kotova: whose name the hosting accounts are in, where the nightly backups live, and which email service's free tier to use.