Diamond Stone Platform: Master Plan
Date: 2026-11-11. Revision 13. Status: draft for owner review.
Changes in this revision: sign-in by phone number, code and passkey; automatic email and
WhatsApp messages; website chat; a helpdesk; notifications (docs/MODULES.md sections 8 to
11). Revision 12: logistics with driver and carrier views, a combined email and
WhatsApp inbox, channel publishing, company and user setup, roles and controls, a
workflow standard and stone-trading rules, all detailed in docs/MODULES.md; every screen
and card in docs/SCREENS.md; a phone test matrix; stock costed by lot; new risks and
decisions.
This plan covers what is built, on what, and in what order. Three companions go deeper:
docs/DESIGN.md (how it looks and behaves), docs/SCREENS.md (every screen and card) and
docs/MODULES.md (how the main parts work). The 26 documents in docs/planning/ and the earlier
30-module proposal are background only; where they disagree with this file, this file wins.
1. What we are building
Diamond Stone buys marble from suppliers and sells it to project buyers, contractors, designers and importers. It does not quarry or fabricate. One system, three parts:
- Public website: catalogue and lead tools that bring enquiries in.
- Client portal: the customer's view of quotes, orders, shipments, invoices and documents.
- Staff app: runs the company from a phone.
Rules:
- The customer comes first. Customer-facing work is built before internal tooling, and every stage is judged by what the customer sees.
- The staff app is phone only, tuned to two phones. Every screen is designed and tested on the Samsung Galaxy S25 and Galaxy A55 5G (section 7). The staff app has no desktop layout; on a computer its layout appears in a centred column. The website and the client portal also have tablet and desk layouts (
docs/SITE-DESIGN.mdsection 14). - One login, one database, one customer record, one design kit.
- Nobody types the same thing twice. A business event posts its own accounting entry.
- A person approves anything that moves money, issues a price, or publishes.
- Nothing is built until someone will use it that month.
2. Customer experience
Promises (targets for the owner to set)
| Promise | Proposed target |
|---|---|
| First reply to an enquiry | 15 minutes in working hours, by a named person |
| Standard quote | 1 working day |
| Sample dispatched | 2 working days |
| Status updates | At every stage, without the customer asking |
| Matching | The range approved before the quote is accepted; the layout of the job, or photographs of the actual pieces, approved before loading (docs/MATCHING.md) |
| Documents | Always available in the portal, never re-requested |
| Problems | Acknowledged the same day |
The system times each promise and shows the owner where it was missed.
The journey
| Step | What the customer experiences | What the system does |
|---|---|---|
| Discover | Browses every stone freely; uses the lead tools | Records the source |
| Enquire | WhatsApp, a short form or a tool result; instant acknowledgement naming their contact | Creates the enquiry, starts the reply timer, alerts sales |
| Sample | Requests samples; sees dispatch and tracking; each sample has a QR code | QR opens that stone with "quote this" |
| Quote | Opens a link, no password; clear options and total; asks questions in the same thread; approves the range, then accepts with one tap, confirmed by a code or passkey, and attaches a purchase order | Versions the quote; acceptance creates the order |
| Pay | Sees the proforma and bank details; uploads proof; gets a receipt | Finance verifies; entry posts itself |
| Source | Sees "material reserved", then the layout of their job, or photographs of the actual pieces, to approve before loading | Purchase order to supplier; the layout or the photographs of the pieces attached |
| Ship | A stage track with dates; invoice, packing list, certificate of origin and bill of lading to download | Shipment milestones push updates |
| Receive | Confirms delivery; can report a problem with photos | Opens a claim with the order attached |
| After | Statement, reorder from a past order, care guide, one-question feedback | Feedback and repeat orders feed the dashboard |
Portal rules
- No passwords and no email sign-in: phone number, then a one-time code by WhatsApp (text message as fallback), then a passkey.
- One screen per order, with a stage track and a button to message the named contact.
- English and Arabic; the customer chooses once.
- The customer is never asked to retype something the company already has.
- No tricks: no forced marketing consent, no hidden costs, no false urgency.
Channels
WhatsApp is the main channel in Oman, with email for documents. Messages are sent through the official WhatsApp Business platform. The existing setup points at an unofficial gateway, which risks the number being blocked (decision 6).
Measures
First-reply time, quote turnaround, quotes won, on-time delivery, claims per order, repeat orders, and the one-question score after delivery.
3. Lead magnets
Drawn from the earlier website audit and its seven proposed "sales magnets", cut to what
a trader can deliver well. Superseded by docs/MARKETING.md section 5, which keeps
these eight, adds six (a project sample box, a submittal pack, a tender rate, a talk
for design firms, a prequalification pack, a trade account) and ranks all fourteen by
the strength of their evidence.
Gating rule: everything about the stones is free to browse. Contact details are asked for only when the customer receives something made for them, and marketing consent is a separate, optional tick.
Build first
| # | Magnet | For | What they get | What we ask |
|---|---|---|---|---|
| 1 | Fast reply | Everyone | A named person on WhatsApp within the promised time | Phone number |
| 2 | Sample box | Designers, owners, contractors | Up to five samples, tracked, each with a QR code back to its stone | Name, phone, delivery address |
| 3 | Specifier pack | Architects, consultants, contractors | One download per stone: datasheet, test values, certificates, origin statement, high-resolution texture image | Work email, project name |
| 4 | Quantity and budget estimator | Contractors, owners | Area in, quantity with wastage and a price band out; save or send as a quote request | Contact, only to save or send |
| 5 | Container calculator | Importers | Square metres per container by thickness and weight limit, with an indicative price at port | Contact, only to save or send |
Build next
| # | Magnet | For | What they get |
|---|---|---|---|
| 6 | Available now list | Traders, contractors | Stock and lots ready to ship, as a live link per customer that expires (docs/MODULES.md section 1), sent by WhatsApp or email |
| 7 | Find the Omani match | Specifiers | Send a photo or a stone name; receive the closest alternatives. Staff answer at first |
| 8 | Shortlist | Designers | Save stones to a list and share it by link with a client |
Left out
The room visualiser in augmented reality, the BIM and 3D texture generator, the offcut marketplace and the maintenance-contract "stone passport". They are heavy to build or belong to a fabricator, not a trader. A care guide sent after delivery covers the last one.
How each magnet works inside
Every magnet creates an enquiry in Sell with its source, starts the reply timer, raises a Halo ring for sales, and sends the customer an acknowledgement. Sample QR scans and pack downloads are added to the customer's timeline so sales can see interest building.
The specifier pack depends on real test reports and certificates for each stone (decision 9). Without them it ships with the datasheet and texture only.
4. New build
Everything is built new. The current code is not extended.
| Current part | What happens to it |
|---|---|
apps/public, apps/store, apps/admin, apps/api |
Moved to legacy/ when the build starts; switched off as each replacement goes live |
| Page text, stone names, images | Carried over as content, not code |
| Sales flow (lead, quote, order, proforma) | Reference for the new Sell area |
Old Google Cloud project diamondstone |
Not reused; switched off, then deleted |
Domain diamondstonex.com on Cloudflare |
Kept; new addresses point at the new build |
Why: the current build stores records as JSON text in a file inside the container, the API trusts a header saying who the user is, and the staff app was drawn for desktop.
5. Structure
Nine areas on one foundation. Details of how the main ones work are in docs/MODULES.md.
| Area | First release | Later |
|---|---|---|
| Sell | Enquiries, customers, samples, quotes, orders, proforma | Tender tracking, commissions |
| Catalogue | Stones with finishes, sizes, thicknesses and alternate names; price lists; supplier availability; stock by lot with photos, gross and net measure, holds with expiry | Stock counts on the phone |
| Buy | Suppliers, supplier quotes, purchase orders against customer orders, packing-list import, inspection with photos, goods receipt, supplier claims with deadlines | Supplier bids, scorecards |
| Deliver | Shipments by road and sea, a map, driver job links, carrier view, container tracking, export document set with a consistency check, delivery proof, claims | Live tracking through the driver app and carriers' own trackers; vessel position |
| Money | Ledger, receivables, payables, bank matching, VAT, fixed assets, stock valuation, landed cost and margin per order, statements, month-end close | Budgets, cash forecast, e-invoicing provider link |
| People | Staff records, document expiry alerts, attendance, leave, payroll, WPS salary file, end-of-service, expense claims | Recruitment, appraisal |
| Reach | Website pages with preview and publish, the lead magnets, one catalogue feeding site and datasheets, media library, lead sources, channel publishing ("change it once") | Campaigns to people who opted in, brochure builder |
| Inbox | Email, WhatsApp and website chat in one place, per customer, linked to quotes and orders, with reply timers; cases (the helpdesk); a help centre; automatic messages with a switch for each | Instagram and Facebook messages |
| Control | Approvals with limits, owner dashboard with the customer measures, certificate register, audit trail, settings | Scheduled reports |
Foundation: login and roles, parties (customers, suppliers, staff), files, messages, English and Arabic, offline drafts, notifications, numbering, audit log.
Deliberately out
Quarry, block, production, royalty and weighbridge features; blocks as a product (docs/MATCHING.md); a desktop layout for the staff app; AI voice
agents and PBX; cold-calling campaigns; Gmail signature sync; and the unrelated school,
childcare, hospitality and signage modules.
6. Technology
| Layer | Choice | Why |
|---|---|---|
| Screens | SvelteKit (Svelte 5) built to static files, installable; phone layout only for the staff app, with tablet and desk layouts for the website and portal | One codebase, installs from the browser |
| Shared UI | packages/ui: tokens, shell, elements |
One kit; the staff app uses the shell, the website and portal use their own editorial look (docs/SITE-DESIGN.md) |
| Rules core | One Rust library: money, VAT, posting rules, payroll, costing, quantity and container maths | Same answers on server, phone and website tools |
| Server | Rust API (axum + sqlx) | One language for the rules and the books |
| On the phone | The same Rust core as WASM, plus image resize and QR decoding | Offline totals match the server; small uploads |
| Database | PostgreSQL on Cloud SQL, real tables, migrations | Durable, auditable |
| Files | Cloud Storage | Private documents and public media kept apart |
| Hosting, apps | Cloudflare, served from its Muscat location | Fast in Oman, no servers to run |
| Hosting, API | One Cloud Run service, reached only through Cloudflare | Next to the database |
| Decisions by AI | Jev behind one adapter, with a rule or person as fallback | See section 10 |
| Driver app | A small Android app wrapping the same screens, for background location during a job | The only way to follow a truck continuously from a phone |
| Maps | Open map data hosted on our own Cloudflare account | No per-view fees and no licence question for tracking |
| The official WhatsApp Business platform | The only route that does not risk the company's number | |
| Google Workspace connected as an internal app, on named shared mailboxes | Avoids outside-app review; reads only what it is allowed | |
| Channel publishing | Our server passes approved content to a rebuilt connector service | Keys stay on the server; nothing is published that a person did not approve |
| Tracking sea freight | One container-tracking service | Cheaper than connecting to each shipping line |
Repo layout:
apps/site public website and lead tools
apps/portal client portal
apps/staff staff app
apps/api Rust API
crates/core Rust rules (also built to WASM)
packages/ui tokens, shell, elements
legacy/ the current apps, until switched off
Sign-in: a code to the phone proves it once; after that the fingerprint signs in, through a
passkey. Everyone registers the same way: phone number, then a one-time code, then a
passkey (WebAuthn/FIDO2) from then on. No Google sign-in, no email sign-in, no passwords. Details in docs/MODULES.md section 8.
Offline is limited to four jobs: submit an expense, record a supplier inspection, record a delivery, clock in. Each saves as an encrypted draft. Everything else needs a connection.
What an installed web app can do on the target phones is set out in section 7.
7. Target phones
The staff app is designed, tuned and tested on two phones: the Samsung Galaxy S25 and the Samsung Galaxy A55 5G. The client portal and public site are tuned on the same two but must still work on whatever phone a customer has, including iPhones.
The two phones
| Galaxy S25 | Galaxy A55 5G | |
|---|---|---|
| Screen | 6.2 in, 1080 x 2340 | 6.6 in, 1080 x 2340 |
| Width a web page gets | 360 px | 384 px likely; one database says 412. To be measured |
| Height a web page gets | 780 px | 832 px likely |
| Pixel density | 3x | About 2.8x |
| Refresh rate | 1 to 120 Hz, adaptive | 60 or 120 Hz |
| Brightness outdoors | Up to about 2,600 nits | About 1,000 nits |
| Processor speed | Fast | About a third of the S25 |
| Graphics speed | Fast | About a seventh of the S25 |
| Browser test score (Speedometer 3) | About 30 | About 6 |
| Fingerprint | Ultrasonic | Optical, a little slower |
| Software | Android 17, One UI 9 | Android 16 or 17, by region |
The A55 is the slower phone by a wide margin. Everything is tuned on the A55; if it is smooth there, it is smooth on the S25.
Design numbers
| Item | Number |
|---|---|
| Design widths | 360 px (S25) and 384 px (A55) |
| Must not break between | 320 and 430 px, because Samsung's "Screen zoom" setting changes the width |
| Usable height, installed app | About 700 to 755 px on the S25, about 750 to 810 px on the A55 |
| Smallest height to survive | 640 px (S25 in a browser tab with the three-button bar) |
| Height with keyboard open | Under 400 px; forms keep their action visible |
| Images | Supplied at 3x |
| Heights in code | Always relative to the visible screen, never fixed |
| Side margin | 16 px |
Layout rules from Samsung's own behaviour
- Edge panel handle. Samsung puts a handle on the upper right edge that can cover controls. Nothing tappable sits in that strip; the top bar's right side holds only the sync badge.
- Navigation bar. Some people use gestures, some the three buttons. The bottom bar sits above whichever is present, using the phone's reported safe area rather than a fixed gap.
- Reach. One UI itself puts reading at the top and actions at the bottom, which matches Halo above and the bottom bar below.
- Keyboard. The Samsung keyboard's height is adjustable by the user, so the layout follows the visible area rather than assuming a size.
- Dark mode. Samsung's browser can force its own dark colours on a site. The app ships a real dark theme and declares it, so the browser leaves it alone.
- Fonts. Web pages on Samsung phones fall back to Roboto, not Samsung's own font. The app ships Rajdhani and IBM Plex Sans Arabic so it looks the same everywhere.
- Corners and camera hole. 16 to 24 px is kept clear of the screen corners; the Halo sits below the status bar.
Performance budget (measured on the A55)
| Item | Budget |
|---|---|
| First screen usable on mobile data | 2.5 seconds |
| Response to a touch | 100 ms |
| Animation | 60 frames a second at minimum; 120 where the phone provides it |
| First download of the staff app shell | About 150 KB compressed |
| Rust/WASM | Loaded in the background while the first screen shows; heavy work off the main thread |
| Effects | Glass by quality level (see below); no large animated shadows |
Animation timing is measured in real time, not in frames, so it runs at the same speed on a 60 Hz and a 120 Hz screen.
Adaptive quality: test each phone, fall back automatically
Glass effects (blur and light bending behind the floating controls) are the heaviest thing a web page can ask of a phone's graphics chip. Rather than ban them or assume they work, the app measures each device and chooses a level.
Quality levels
| Level | What the floating controls look like | Expected on |
|---|---|---|
| 3. Full glass | Blur, light bending at the edges, moving highlights | Galaxy S25 |
| 2. Glass | Blur and a tint; no bending | Galaxy A55 5G, if it passes |
| 1. Frosted | A pre-made frosted surface that does not sample what is behind it | Slower or power-saving phones |
| 0. Solid | Opaque surfaces | Any phone that asks for reduced transparency, or fails level 1 |
Layout, sizes, icons and behaviour are identical at every level. Only the surface changes. Glass is used only on the floating layer (bottom bar, sheet tops, Halo), never on content.
The test
- First launch: a one-second test draws the real bottom bar over moving content and times every frame. The result sets the starting level.
- In use: the app keeps watching frame times during scrolling and transitions. If frames are dropped repeatedly, it steps down one level for that session and remembers it.
- Never up on its own: it steps up only after a fresh test, run after an app or browser update, or when the user asks.
- Respects the phone: power saving mode, a low battery, or the system's reduced-transparency or reduced-motion settings lower the level at once.
- The person decides last: a setting lets each user choose a level, including "always solid".
Seeing it per user
Each device reports its level and frame rate (no personal content). The Control area shows a small table: person, phone, browser, level, frames per second, last tested. That tells us when a phone is struggling before the person complains.
Where Rust and WASM help, and where they cannot
| Job | Done by |
|---|---|
| Blur and bending of what is behind a control | The browser's own graphics pipeline. WASM cannot do this: it runs on the processor and cannot read the page's pixels |
| The light-bending and highlight maps for each control shape | Rust/WASM, computed once per shape and cached |
| Spring movement and timing | Rust/WASM or plain CSS, whichever measures faster |
| The performance test and frame watching | A small script using the browser's timing tools |
So WASM makes the glass accurate (correct optics for each shape), and the level system keeps it fast. The research confirmed that the bending effect exists only in Chrome-family browsers, so iPhones stop at level 2, and that nobody has published a test of it on Android phones, so it is verified on the real S25 before it is relied on. A published measurement on a cheaper Samsung found that removing blur roughly halved worst-case frame time, which is why the A55 is expected to carry one small glass surface at most.
Browsers
Samsung phones come with two browsers, and the app must work in both.
| Chrome | Samsung Internet | |
|---|---|---|
| Install to home screen | Yes | No, in practice: blocked on Android 14 and later by a known fault (docs/INSTALL.md) |
| Notifications | Yes | Yes |
| Sending queued work in the background | Yes | Yes |
| Built-in QR and barcode reading | Yes | Yes |
| Passkey with fingerprint | Yes | Yes |
| Bluetooth devices | Yes | Yes |
| NFC tags | Yes | No |
| App icon badge count | No | No |
- Staff install the app from Chrome, so there is one installed version to support.
- Customers on Samsung phones will mostly arrive in Samsung Internet, so the portal and site are tested there too.
- Oldest versions supported: Chrome 135 and Samsung Internet 29.
- The install button is a convenience; a short "install from the browser menu" guide is always available. A person who opens the install page in Samsung Internet, or inside WhatsApp, is sent to Chrome. The whole process, for staff, customers and drivers, is in
docs/INSTALL.md.
What changes because staff are on Android
Compared with the earlier iPhone-based assumptions:
| Before | Now, on the two Samsung phones |
|---|---|
| No install prompt | Install prompt available |
| Notifications only after install, with limits | Normal notifications |
| Queued work sent only when the app is opened | Sent in the background, though Samsung may delay it for apps it has put to sleep |
| QR reading needed its own decoder | The phone's built-in reader is used; the WASM decoder remains as a fallback |
| No Bluetooth | Label printers over Bluetooth become possible later |
Samsung puts unused apps to sleep, so the app still saves its state at every step and never depends on background timing.
iPhones
Customers will open the portal and site on iPhones. Those two parts keep to features every phone supports, and are spot-checked on one iPhone each stage. The staff app is not tuned for iPhone in this build; it will run, without the Android extras above.
To measure on the real phones first
Day one of Stage 0, on both phones, in both browsers, in a tab and installed:
- The actual page width and height (the A55's width is the main unknown).
- The safe-area gaps at top and bottom, with gestures and with three buttons.
- Whether animation runs at 120 Hz, and which glass quality level each phone holds at full frame rate.
- Camera capture and QR reading.
- Which passkey provider the phone offers.
These five results replace the "likely" figures above.
Other phones: what customers use
Staff phones are the two Samsungs. Customers and the public use whatever they have, so the portal and public site are checked more widely. Figures are from October 2026.
| Oman | UAE | Saudi Arabia | India | World | |
|---|---|---|---|---|---|
| Android / iPhone | 81 / 19 | 81 / 19 | 58 / 42 | 95 / 5 | 72 / 28 |
| Most common makers | Apple, Samsung, Xiaomi | Samsung, Apple, Xiaomi | Apple, Samsung, Honor | vivo, OPPO, Xiaomi | Apple, Samsung, Xiaomi |
| Chrome / Safari | 78 / 16 | 76 / 15 | 54 / 39 | 91 / 3 | 70 / 22 |
Page widths that matter, in order: 375 to 393 px (most iPhones, Samsung at 384, Xiaomi at 393), 360 px, 402 to 414 px, 420 to 440 px (large iPhones), and under 344 px (enlarged display settings and folding-phone covers). The 384 px bucket is the third most common in Oman and worldwide, which supports the A55 figure.
Layout rules that make one design hold everywhere:
- One layout from 344 to 440 px wide, with no jumps. Below 344 px, side margins tighten and the staff app's Omnibar labels drop to icons.
- Above 480 px (tablets, opened folding phones, computers) the staff app's phone layout sits in a centred column; the website and portal change to their tablet and desk layouts (
docs/SITE-DESIGN.mdsection 14). - Heights from 568 to 960 px. Below 600 px the top bar scrolls away.
- About one person in four has enlarged the text on their phone. Everything survives 200%.
- Links opened inside WhatsApp, Instagram or Facebook show in a cut-down browser with its own bars and no saved sign-in. Entry pages are tested there, with an "open in browser" route for sign-in.
Test matrix
| # | Every release |
|---|---|
| 1 | Galaxy S25, Chrome and installed |
| 2 | Galaxy A55 5G, Chrome, installed, and Samsung Internet |
| 3 | A standard iPhone, Safari and added to the Home Screen |
| 4 | Small iPhone size (375 x 667) and 320 px wide, simulated |
| 5 | Large iPhone sizes (430 and 440 px wide), simulated |
| 6 | A low-cost Android (360 x 800), on a slowed connection |
| 7 | Public and portal links opened from WhatsApp, on Android and iPhone |
| 8 | Xiaomi-class size (393 x 873), simulated |
| # | Each stage |
|---|---|
| 9 | A folding phone: cover screen and opened |
| 10 | Largest text and display size on Android and iPhone; 200% text |
| 11 | Instagram and Facebook built-in browsers; a Huawei phone if one can be borrowed |
| 12 | Sideways, keyboard open, a computer browser, and a full Arabic pass |
Phones to have in hand: the S25 and A55 already owned, one standard iPhone, and one low-cost Android. Borrow a small or large iPhone and a folding phone each stage.
After launch the app records page size, text scale, browser and speed in broad buckets, with no personal detail, and the matrix is re-ranked each quarter from what customers actually use.
8. Design
All design decisions live in docs/DESIGN.md; a live sketch is in
docs/ui-shell-mockup.html. In summary:
- Basis. The ideas behind Apple's Liquid Glass, applied as layout and behaviour rules: content underneath, a thin floating layer of controls above, capsule shapes, one tinted action per screen, things opening from their source. Glass is only on the floating layer and adapts to each phone (section 7).
- Evidence. Six research passes. The main lessons: simple and familiar beats clever; visuals work with a few words, not instead of them; navigation must stay visible; polish buys patience, not usability.
- Shell. One shell on every staff app screen: Halo rings at the top for what needs attention, with a drawer that drops from each ring; the stream in the middle; the Omnibar at the bottom, showing where you are, Add, Scan and Search. With a record open, the Omnibar becomes that record's one named action. The website and portal have no Halo, Stream or Omnibar: the portal has a line of words with counts, and both have a bar with the word "WhatsApp" at the left and the page's action at the right (
docs/SITE-DESIGN.md). - Cards and screens. Every card is designed from what the person needs to know, with the customer and the stone leading and record numbers last (
docs/SCREENS.md). - Type and layout. Rajdhani for all text, Orbitron for the wordmark only, IBM Plex Sans Arabic; accent teal
#006F73; a fixed scale with a 16 px body; one money format; sizes checked in real millimetres at normal viewing distance on both phones. - Visual-first. A table of which visual to use for each kind of information, chart rules, and stone-specific visuals: the real photograph as hero, a property scale for datasheets, a container fill drawing.
- Icons and motion. One icon set with a word beside each icon until it passes a recognition test; five timing tokens; nothing moves at rest.
- Quality bar. Thirty-two checks every screen must pass, and a testing method with staff and customers.
9. Screens in the first release
| Part | Screens |
|---|---|
| Public site | Home, Collections, Stone page, Projects, About, Contact, Sample request, Specifier pack, Estimator, Container calculator |
| Client portal | My orders, Quote, Order with stage track, Range approval, Layout approval, Invoices and statement, Documents, Help |
| Sell | Enquiries, Customers, Samples, Quote builder, Quotes, Orders |
| Catalogue | Stones, Price lists, Supplier availability, Stock and lots |
| Buy | Suppliers, Supplier quotes, Purchase orders, Inspections, Goods receipt |
| Deliver | Shipments, Export documents, Delivery proof, Claims |
| Money | Invoices, Payments in, Bills, Payments out, Bank matching, Journal, Chart of accounts, Fixed assets, VAT return, Statements, Month-end close |
| People | Staff, Attendance, Leave, Payroll run, Expense claims, Document expiry |
| Reach | Pages, Lead tools, Media, Publish, Lead sources |
| Control | Approvals, Dashboard, Certificates, Audit log, Users and roles, Settings |
About 60 screens, most of them the same list-and-record pattern.
10. Automation
Postings without typing (the full table is written in the Money stage):
| Event | Entry |
|---|---|
| Advance received and verified | Bank up, customer advance (liability) up |
| Goods delivered or shipped | Revenue recognised, advance cleared, receivable for the balance, cost to cost of sales |
| Supplier goods received or shipped direct | Stock or cost of sales up, payable up |
| Freight, customs and handling bills | Added to the order's landed cost |
| Payroll approved | Wages, social protection and end-of-service accruals |
| Month end | Depreciation, accruals, exchange differences |
Customer updates without typing: each stage change on an order sends the customer a WhatsApp or email message from an approved template and updates the portal.
The full plan for AI in every module is docs/AI.md. Jev makes typed choices only; it
does not write or read documents, has no image product ready for production, and is weak
on sums, dates and Arabic. Drafting uses a language model, reading paper uses a document
reader, and sums are done by code.
Where Jev is used (a typed decision, never free text):
- Route a new enquiry to the right person and priority.
- Suggest the category and account for a receipt or supplier bill.
- Flag a bill that does not match its order and receipt.
- Check an inspection photo set is complete and readable.
- Suggest which customer a bank line belongs to.
Each suggestion shows its confidence; below a set level it goes to a person. Jev never posts, approves or sends. It is an early-access outside service, so it sits behind one adapter and the system works without it.
11. Accounting: IFRS for SMEs
Built to the third edition, effective 1 January 2027. Oman permits it for unlisted companies (Financial Services Authority Decision 2/2025).
- Double-entry ledger in whole baisa. No edits or deletes; corrections are reversals.
- Periods open, then closed; reopening needs two people.
- Dimensions on each line: department, customer order, shipment.
- Currencies: books in OMR. Customers, suppliers and freight are often in US dollars: each record stays in its own currency with its rate locked, and the customer sees only their own. Full plan in
docs/CURRENCY.md. - Stock: costed by specific lot, with landed cost spread over the lot; goods shipped direct from supplier to customer go straight to cost of sales; stock held at the lower of cost and selling value. (Changed from weighted average: stone lots are not interchangeable. The accountant confirms.)
- Revenue: advances are a liability until control passes to the customer.
- Margin per order from sale price, purchase cost and landed cost.
- Fixed assets, leases, end-of-service benefit accrual, provisions.
- Statements: financial position, income, cash flows, changes in equity, trial balance, notes support.
- Oman VAT at 5 %, exports zero-rated, VAT return pack, gapless invoice numbers, tax invoice within 15 days, 10-year records.
- E-invoicing: mandatory from 1 April 2027 above OMR 5 million of annual supplies, otherwise 1 October 2027 (Tax Authority Decision 189/2026), through an accredited provider. Invoices are structured from day one.
- Before it becomes the books of record: opening balances loaded and three closed months run in parallel.
The software makes compliant books possible. The policies and sign-off belong to the company's accountant and auditor.
Detail is in docs/ACCOUNTS.md: how each event in the app posts to the ledger, the
chart of accounts, the 22 accounting screens, the month-end close, the management, IFRS
for SMEs, audit and tax reports, the Oman legal requirements and dates, the 20-schedule
audit pack, and the controls an auditor relies on. Two corrections from that research:
the third edition keeps the incurred-loss model for receivables (no expected credit loss),
and the income tax return is due four months after year end with audited accounts.
How each kind of user reaches every place is in docs/JOURNEYS.md. Every screen and
setting, with the gaps found, is in docs/INVENTORY.md. Logo, colours, typefaces and
wording are in docs/BRAND.md; each role's screens, and the owner's, are in
docs/ROLES.md; element sizes and pixel density are in docs/DESIGN.md section 4. Back-to-back orders (ordered at the factory, delivered straight to the
customer) and what customers may see of the origin, the truck and the driver are in
docs/MODULES.md section 12. The three customer-facing parts each have their own document:
docs/PORTAL.md (client portal), docs/WEBSITE.md (public website, with search, answer
and AI visibility) and docs/STORE.md (samples store). How each person flows through
their work, and the gaps that showed, are in docs/FLOWS.md with diagrams in
docs/user-flows.html. Social channels: written, approved and scheduled in this app, sent by the separate
channel service, with results and replies coming back (docs/SOCIAL.md). Where content comes from: photographs and facts captured during normal work, checked,
masked and offered as drafts (docs/CONTENT.md, map in docs/content-map.html). Each role's work by day, week and month is in docs/ROLES.md section 13. Photo requests to customers, and customers who are traders, are in docs/CONTENT.md section 14. The Halo is one band at the very top of every signed-in staff app screen; it opens downward for one ring and pulls down to show everything (docs/DESIGN.md section 7). HR in full (contracts, permits, all leave kinds, hours, pay rules, renewals, Omanisation, with sixteen points for a PRO) is in docs/HR.md. The inbox is one row per person and one timeline for everything said with them; the team answers by WhatsApp or email from the same screen (docs/MODULES.md section 3). How the interface is coded (layers, glass at four levels, the movement vocabulary and springs, and why each feels as it does) is in docs/FRONTEND.md and docs/ui-build.html, including an audit of what the build plan was missing: a level for bright sun, reach, the phone's text size, screen readers, Arabic, and what a web app cannot do on each phone. The public website, reviewed (what the first plan missed; what each kind of buyer wants; ten ways people arrive and the one path to becoming a customer; the priced sample as the product listed in search; beyond the site; and running it all as records from the staff app) is in docs/WEBSITE.md sections 13 to 21, drawn in docs/website-map.html. Marketing and lead magnets (who names the stone and who buys it; fourteen magnets ranked by evidence; channels in order for one person; forty firms; the Gulf's year; consent, bribery and claims rules; measuring from sample to order) are in docs/MARKETING.md, drawn in docs/marketing-map.html. Other stone companies' websites (37 read page by page; best in class and what each lacks; where ours stands feature by feature; sixteen gaps and what was done; faults to guard against) are in docs/COMPETITORS.md. How the website and portal move (measured against 19 premium sites; one curve, short rises, fades; a live sheet) is in docs/SITE-MOTION.md and docs/site-motion.html. The website's own look (editorial, not app-like: photographs to the edges, type and space instead of boxes, one quiet action; a wide-screen layout proposed; who keeps each part current) is in docs/SITE-DESIGN.md, drawn in docs/website-design.html. The catalogue (one record per stone feeding every place; seven kinds of name and how far each may travel; variants; readiness per place; adding, changing and withdrawing; how a customer keeps the name they used, with the mapping to our stone on staff screens only and no public page per market name: Revision 2) is in docs/CATALOGUE.md, drawn in docs/catalogue-map.html. The home page and landing pages (eleven parts in the order a stranger asks; fourteen blocks filled from records; pages by use, market, audience and campaign, each needing something of its own) are in docs/LANDING.md. Articles, facts and history (a library where no claim passes without a sourced fact; what may and may not be said about Omani stone; two sourced timelines) are in docs/EDITORIAL.md. Getting the app onto a phone (staff install from Chrome before signing in; customers are offered it once after a useful moment and never need it; drivers install nothing; updates; what goes wrong) is in docs/INSTALL.md. The Halo and the Omnibar, replanned (what each does, how a person adds, removes and reorders rings, putting work off and handing it over, nine Omnibar modes, their parts, and 44 problems with answers) are in docs/SHELL.md, drawn in docs/shell-map.html. US dollars and other currencies through every module are in docs/CURRENCY.md. Components and motion: the 96 components of the shared interface, each with named parts, a few kinds, switchable features and all its states, are in docs/COMPONENTS.md; the evaluation of the motion plan and its completed specification are in docs/MOTION.md; both are drawn with live samples in docs/component-map.html. Every technology, what it does, what it gains and what it connects to is in docs/STACK.md, drawn in docs/stack-map.html. Documents and terms (every paper made from the record and fixed once issued, default terms as versions attached by rule, recorded acceptance, the PDF maker, sharing, the verification code, bank-detail fraud, readiness for e-invoicing in 2027) are in docs/DOCUMENTS.md. Where AI helps, module by module, is in docs/AI.md. How the system itself works (its parts, the path every change
takes, fourteen system flows, record stages, every automatic step, every outside service,
what runs on a clock and what it never does alone) is drawn in docs/system-flows.html. docs/BRAND.md also lists where this plan disagrees with
decisions recorded in the earlier repository.
12. Risks
| # | Risk | What we do |
|---|---|---|
| 1 | Scope is still large for a small build team: about 60 screens plus full books and payroll | Strict stage order; each stage in daily use before the next starts |
| 2 | The promises in section 2 are missed by people, not software | Timers and amber rings make misses visible; the owner sets targets the team can keep |
| 3 | Staff do not adopt it | Owner uses it first; one role at a time; a named helper |
| 4 | Books are wrong | Accountant signs the posting table; automated tests on the Rust rules; three months in parallel |
| 5 | Payroll is wrong or late (WPS: within 3 days of period end) | Parallel payroll month; two-person release; rates held as dated settings |
| 6 | Phone-only is too tight for finance | Phone patterns in docs/DESIGN.md; test with the accountant; a wider layout only if that fails |
| 7 | Where the data is hosted: VAT records are reported to be required inside Oman, the data law restricts transfers abroad, and Google has no Oman region | Legal advice before real data; the first project holds test data only |
| 8 | Personal data law: explicit consent, breach notice in 72 hours, a data protection officer | Consent records on every lead tool, a breach procedure, a named officer |
| 9 | WhatsApp number blocked through an unofficial gateway | Use the official WhatsApp Business platform |
| 10 | Specifier pack has no test reports to put in it | Collect reports per stone before the site stage; ship without them if needed |
| 11 | Jev is early-access and outside Oman | Behind an adapter; no personal data sent until risk 7 is answered |
| 12 | Lost or shared phone | Encrypted drafts; no payroll or bank data offline; auto-lock; remote sign-out |
| 13 | Small team, weak separation of duties | Maker and approver must differ; otherwise the owner reviews; tamper-evident audit log |
| 14 | Break-in through the web | Built to OWASP ASVS level 2; independent security review before real data |
| 15 | Data loss | Point-in-time recovery, separate daily backups, a restore drill each quarter |
| 16 | Cloud accounts depend on one person: the Google project sits under a temporary account, and the Cloudflare account has a single administrator, no two-step sign-in reported, and a global key in use | Second owner on both; two-step sign-in; narrow tokens; the live project in an organisation Diamond Stone controls |
| 17 | A Cloudflare outage or wrong rule takes every address down | Rules kept in the repo; changes tried on dev addresses first |
| 18 | Another Diamond Stone staging system already exists (section 14) and may overlap | Owner confirms what it is before work starts |
| 19 | Moving existing data | Import tools with a review step; opening balances signed by the accountant |
| 23 | The app looks over-designed or unfamiliar | Novelty only in photography, colour and type; conventional navigation, forms and tables; the glance test on every key screen |
| 24 | Pictures are misread: unlabelled icons, charts that mislead | A word beside every icon until it passes the recognition test; chart rules in docs/DESIGN.md; exact figures always beside charts |
| 25 | Arabic screens show the wrong digits or break number alignment | Western digits forced everywhere; digits always from one font; Arabic screens in the automatic screenshot checks |
| 26 | Design drifts as screens are built at different times | One shared component library; the 32-point quality bar on every screen; no one-off styles |
| 27 | Exposed keys and open services in related projects. Private keys are stored in files in vai-ideastatica\shared_comms\vai_email; the Helmdor messaging endpoints appear to accept sends without sign-in; the connector service is on a public address with built-in default keys; the old demo's portal endpoint returns driver phone numbers to anyone who knows a customer's email |
Rotate and move the keys; put sign-in on those endpoints; take the connector service off the public address until rebuilt; switch off the old demo. None of these are reused as they are |
| 28 | The WhatsApp number is restricted or banned | Official platform only; opt-in records; no bulk sending; watch the quality rating |
| 29 | WhatsApp costs grow now that ordinary replies are charged beyond 1,000 a month | A usage counter; check Oman's rate each quarter |
| 30 | A platform refuses or delays access (LinkedIn, Meta review, Google Business Profile) | Apply early; every channel has a by-hand fallback |
| 31 | Drivers do not tap their milestones, or Samsung stops the driver app in the background | Staff can enter updates; reminders go to the dispatcher; the app is tested on real Samsungs; carriers' own trackers where shared |
| 32 | Tracking people without proper consent | Consent on first use; location only during an active job; the customer sees the truck, not the driver's number; a retention period |
| 33 | A portal page opened from a link in a message is treated as proof of identity | Viewing only; a fresh code or passkey for accepting, statements, and changes; acceptance recorded with the quote's exact version |
| 34 | Too much rests on the owner's review | Outside accountant with read-only access each quarter; a confidential way for staff to raise a concern |
| 35 | Everyone ends up an administrator because refusals are unclear | Refusals say what is missing and who can grant it; quick, time-limited cover |
| 36 | Setup choices that cannot be changed later (currency, financial year, books start date, costing method, opening balances) | Confirmed with the accountant before the first entry; the setup screen warns that they lock |
| 37 | Photos that do not match the stone, or labels that fail in heat and dust | A fixed photo routine with a colour card; trial two label types on real stock for a month before buying a printer |
| 38 | A phone number is hijacked and used to receive a sign-in code | Codes only for first sign-in and recovery; the passkey is the everyday method; a new device alerts the old one; money actions ask for the fingerprint again |
| 39 | Staff phones cannot hold a passkey | Tested on the real phones in Stage 0; fallback is a code plus a PIN, with tighter limits on what that session may do |
| 40 | Automatic messages annoy customers or break WhatsApp's rules | Approved templates; consent recorded; a cap per customer; quiet hours; every automation is a visible switch; no bulk sending |
| 41 | Website chat goes unanswered and makes the company look absent | A stated reply promise; on-duty routing; hand-over to WhatsApp or a callback when missed; "Leave a message" out of hours |
| 42 | Notifications show private details on a lock screen, or are so many they get ignored | Who and what kind only, never amounts; one per event to one person; the rest in a daily digest |
| 21 | Tuning to two Samsung phones makes it worse on others | Fluid layout from 320 to 430 px; portal and site keep to features every phone has and are checked on an iPhone each stage |
| 22 | Glass effects make the app slow or hard to read | Quality levels with a per-device test and automatic step-down (section 7); a contrast floor at every level; "always solid" setting |
| 20 | Animation slows people down or stutters on the slower phone | Five timing tokens only, nothing over 450 ms in a work flow, the performance rule in the design document |
13. Google Cloud setup
A new project under admin_temp@basegws.venturealliance.om. That account's sign-in on
this machine has expired; the other login folders found hold different accounts.
| Project | When | Holds |
|---|---|---|
dst-platform-dev |
Now | Test data only |
dst-platform-prod |
Before the first go-live | Real data, created after risks 7 and 16 are answered |
| Item | Choice |
|---|---|
| Region | me-central1 (Doha), the closest generally available region |
| Billing | Named billing account, with a monthly budget and alerts at 50, 90 and 100 % |
| Owners | admin_temp plus one more named person |
| Deploys | From GitHub using identity federation; no downloadable keys |
| Secrets | Secret Manager only |
| Service | Use |
|---|---|
| Cloud Run | api only; scales to zero when idle |
| Cloud SQL (PostgreSQL) | The database; smallest size to start; point-in-time recovery on |
| Cloud Storage | Private documents, website media, backups |
| Artifact Registry, Secret Manager | Images and secrets |
| Cloud Tasks and Scheduler | Reminders, promise timers, month-end jobs |
| Logging and Monitoring | Error alerts, uptime checks |
Cost is an estimate only: a few tens of rials a month for the test project, mostly the database. The budget alert is the safeguard.
Scripts: infra/gcp/new-project.ps1 (creates the project; database only with
-WithDatabase) and infra/gcp/disable-demo.ps1 (switches off the old demo).
14. Cloudflare setup
What the account shows (read on 2026-11-11)
| Finding | Meaning |
|---|---|
diamondstonex.com is one of 19 domains in one personal Cloudflare account, Free plan |
Shared with unrelated domains |
| One member, Super Administrator; two-step sign-in not reported as enabled; a global API key is set on this machine | A single point of failure and a wide-open key (risk 16) |
| "Always use HTTPS" is off; minimum TLS is 1.0 | Two settings to tighten |
No www record |
Visitors typing www get nothing |
| The main address points at a Google-hosted service | The current site also lives in Google Cloud; find which service before switching anything off |
mvp., store., admin., api. point at the old demo; api. and admin. return errors |
To be removed |
staging., staging-app., staging-client., staging-vendor., staging-api. point at another server |
A separate Diamond Stone staging system this plan has not seen (decision 4) |
pbx., waha., calldemo. and five Workers named for Diamond Stone |
Earlier experiments; review and remove what is unused |
| Cloudflare answers from Muscat | Anything served directly by Cloudflare is very fast in Oman |
What Cloudflare does in the new build
| Job | How |
|---|---|
| Serve the public site, portal and staff app | Static files on Cloudflare, one project each |
| Front door for the API | A small Worker passes api. to Cloud Run; Cloud Run accepts requests only from it |
| Protection | Firewall rules, rate limits on sign-in and forms, a bot check on the lead tools |
| Private test sites | Cloudflare Access in front of every dev address |
| Caching | Website media and static files only; API responses never |
Addresses
| Address | Use | When |
|---|---|---|
dev-site., dev-portal., dev-app., dev-api. |
Test build, behind Access | Stage 0 |
diamondstonex.com and www |
New public site | Stage 2 |
portal. |
Client portal | Stage 1 |
app. |
Staff app | Stage 1 |
api. |
New API | Stage 1 |
Order of work
- Two-step sign-in and a second administrator.
- Turn on "Always use HTTPS", raise minimum TLS to 1.2, add the
wwwredirect. - Replace the global key with narrow tokens.
- Create the app projects and the API Worker on
devaddresses. - Remove old records and Workers once the owner confirms they are unused.
15. Build stages
Each stage ends with something in real use. No dates are promised; sizes are relative.
| Stage | Content | Size | Done when |
|---|---|---|---|
| 0. Foundation | Measurements on the two target phones, cloud project and Cloudflare dev addresses, repo layout, database, Rust API skeleton, login and roles, packages/ui built to docs/DESIGN.md (shell, elements, icons, motion, the per-device quality test), files, messages, audit log, EN/AR |
Large | Staff install the app, sign in and pass the Stage 0 test |
| 1. Customer journey | Sign-in with code and passkey; company and user setup, roles and limits; notifications; the first automatic messages (enquiry received, order updates); Sell and the client portal together: enquiry, sample, quote, acceptance, proforma, payment proof, order stage track; the inbox for email and WhatsApp; customer updates, promise timers | Large | A real customer accepts a quote and follows their order from a WhatsApp link |
| 2. Public site and lead magnets | New site, catalogue with lots and photos, magnets 1 to 5, website chat, help centre, lead sources, search engines, Google Business Profile | Medium | An enquiry from each magnet reaches sales with its timer running |
| 3. Money core | Ledger, invoices, payments, bills, bank matching, VAT, statements, close | Large | A month closes and the trial balance agrees with the current books |
| 4. Buy and Deliver | Cases (the helpdesk) with claims; supplier orders, packing-list import, sorting and layout with the customer's approval before loading, landed cost by lot, supplier claims; shipments with a map, driver job links, carrier view, container tracking, documents, delivery proof, claims | Large | An order ships with its layout, or the photographs of its pieces, approved and every cost on it |
| 5. People | Staff records, attendance, leave, payroll, WPS file, expenses | Medium | One payroll month runs in parallel and matches |
| 6. Reach extras | Magnets 6 to 8, publishing to Instagram, Facebook, LinkedIn and YouTube, by-hand channel tasks, brochure and datasheet builder | Medium | |
| 7. Live tracking | The Android driver app, carriers' tracker feeds, vessel position | Medium | Marketing changes a stone once and every output updates |
The accountant's decisions are needed early even though Money is Stage 3, because the chart of accounts shapes the invoices customers see in Stage 1.
16. Decisions needed
| # | Decision | Who |
|---|---|---|
| 1 | Sign in as admin_temp; confirm project dst-platform-dev, billing account, monthly budget, second owner |
Owner |
| 2 | Approve the Cloudflare fixes in section 14, steps 1 to 3 | Owner |
| 3 | Which account owns the old diamondstone project, and which service runs the current main site |
Owner |
| 4 | What the existing staging. system is, and whether it stays |
Owner |
| 5 | The customer promise targets in section 2 | Owner |
| 6 | Move to the official WhatsApp Business platform | Owner |
| 7 | Confirm Rust for the server | Owner |
| 8 | Staff roles and headcount, who does the tests, and confirmation that staff use the Galaxy S25 and A55 5G | Owner |
| 9 | Test reports and certificates per stone for the specifier pack | Owner |
| 10 | Where real data may be hosted, in whose organisation, and whether any may go to Jev | Owner, with legal advice |
| 11 | E-invoicing band, revenue timing, chart of accounts, opening balance date | Accountant |
| 12 | Approval limits per role; data protection officer | Owner |
| 13 | The nine design choices listed in docs/DESIGN.md section 18 |
Owner |
| 14 | Rotate the exposed keys and close the open services (risk 27) | Owner |
| 15 | A dedicated WhatsApp number on the official platform, and which shared email addresses to connect | Owner |
| 16 | Stock costed by specific lot | Accountant |
| 17 | The gross and net allowance rule, the split-bundle charge, and whether the discount limit is a percentage off list or a floor on margin | Owner |
| 18 | Approval limits per role and per kind of document | Owner |
| 19 | Apply now for Google Business Profile, Meta and LinkedIn access | Owner |
| 20 | Whether carriers will share their truck trackers, and whether drivers will install an app | Owner, with carriers |
| 21 | Whether proof of delivery by code and signature is enough in law, and consent wording for drivers | Legal adviser |
| 22 | Who is the second administrator and who is the outside accountant | Owner |
| 23 | A text-message provider for fallback sign-in codes, and its cost | Owner |
| 24 | Working hours, who is on duty for chat, and the reply promise for website chat | Owner |
| 25 | Which automatic messages to switch on first, and the wording of each | Owner |