StyloTech product · Ref. SP-02

Lokal

Everything local in Mauritius, in one place.

Platforms

Web · iOS · Android

On the web
  • Lokal’s home page on the web: “Everything local in Mauritius, in one place”, a search for a brochette, a plumber or a cake, suggestions including “Villa with a pool”, and a way in for people who own a business or a rental.
    Home
  • The businesses page on the web: a switch between all businesses and by category, one search bar for a product or business, a location and a category, 30 local businesses found, and the “Near me”, “Can serve me now” and “Trending” filters.
    Businesses
  • The web profile of Boutik Ramdhun, a groceries and convenience shop in Triolet: marked open, as confirmed by the business two hours earlier, its tags, the start of its product catalogue and buttons to message, save or share it.
    Business profile
  • Lokal’s page for villa and apartment owners: free to list, guests pay Lokal upfront, 7% only on paid bookings, and a worked example of a four-night stay showing what the guest pays and what the owner receives.
    For owners
  • The seller dashboard on the web for Chez Hurdoyal: the listing active, a reminder that the subscription is due, the availability controls — open, closed, closing soon, temporarily closed, delivery available — the switch for online orders, and open orders and unread messages.
    Seller dashboard
On iOS and Android
  • Lokal’s Explore screen in the app: “Everything you need in Mauritius”, buttons for businesses and deals, a search for a product or service and a town, the “Near me”, “Can serve me now” and “Trending” filters, and the start of a guide to businesses, products and services, and stays.
    Explore
  • Businesses near you on a map of the whole of Mauritius, pins clustered where they are close together, with the “Can serve me now”, “Trending” and category filters and a button to see them as a list.
    Map
  • The profile of Pharmacie Li, a health and wellness business in Phoenix: delivery available, confirmed by the business ten hours earlier and open until 17:30, rated 3.0 from 12 reviews, with its tags and a button to message the business.
    Business profile
  • The app’s screen for villa and apartment owners: free to list, guests pay Lokal upfront, 93% paid to the owner on the 1st of the month after the stay, and a worked example of a four-night stay with Lokal’s 7% commission.
    For owners
Screens from the React web client in a desktop browser and from the Flutter app on an Android emulator, both run against a local Supabase built from the project’s migrations and demo seed. Invented businesses, invented sellers — never production data.

In Mauritius, “who has this, and are they open?” is usually answered by a phone call, a social page nobody has updated, or a drive to go and see. Small businesses have the stock and the hours; what they lack is a place to say so where people actually search. Lokal is that place — and, since version 2.0, it is also where villa and apartment owners rent out their homes, with Lokal holding the guest’s payment until the stay is done.

StyloTech’s role

Lokal is StyloTech’s own product. We define, design, build, run and support it — the React web client, the Flutter app for iOS and Android, the Supabase schema and its row-level security, the Edge Functions, the stays payments and payouts, and the deployment.

Lokal earns two ways and keeps them apart. Businesses pay one flat monthly plan and Lokal takes no commission on their orders — their customers pay them directly. Holiday stays are free to list, and Lokal keeps 7% of each paid booking. Both are enforced in Postgres rather than in the screens, so the web and both apps answer to the same rules.

Product sitelokal.stylotech.mu
Project type
  • Website
  • Mobile app
  • E-commerce
Platforms
  • Web
  • iOS
  • Android
Built with
Web client
  • React 19
  • TypeScript
  • Vite
  • Tailwind CSS
  • TanStack Query
  • Zustand
  • Leaflet
Mobile client
  • Flutter
  • Cubit
  • go_router
  • get_it
  • flutter_map
  • geolocator
Backend
  • Supabase
  • PostgreSQL
  • Row Level Security
  • Edge Functions
  • pg_cron
Infrastructure
  • Supabase Realtime
  • Firebase Cloud Messaging
  • OpenStreetMap
  • iCal
  • Sentry
  • nginx
Quality & delivery
  • Vitest
  • pgTAP
  • Deno test
  • Playwright
  • oxlint
  • GitHub Actions
  • Codemagic
What StyloTech delivered
  • Product strategy
  • UI/UX design
  • Design system
  • Technical architecture
  • Frontend development
  • Backend development
  • Mobile development
  • Database design
  • Integrations
  • Testing & QA
  • Deployment
  • Maintenance

What it does

Each part was built for a real job on the day, not for a feature list. The product’s own site walks through them in full.

01

Search by what you need

A search for “brochette” or “mechanic” matches what businesses sell, not only what they are called — weighted in Postgres across names, tags, descriptions and products, and kept current by triggers.

02

Who can serve you now

Open, closing soon, busy, delivery available. A status the seller sets expires after 12 hours and falls back to their opening hours and special days, always read in Mauritius time, and the label says when the hours next change.

03

Holiday stays, booked through Lokal

Villas, apartments, bungalows, campements and guesthouses. The guest requests dates, the host accepts, the guest pays Lokal within 48 hours, and only then is the exact address released. Calendars sync both ways with Airbnb and Booking.com over iCal.

04

Hosts paid every month

Lokal keeps 7% of each paid booking and pays the host the rest by bank transfer early in the month after the stay. Cancellation policies, refunds to the guest’s bank account and disputes within 48 hours of check-out are all handled by the database.

05

Profiles, catalogues and deals

Photos, opening hours, contact links and a catalogue with options, stock counts and fixed or “from” prices. A seller can set a limited-time deal price, and the order is charged at that price by the server, never by the client.

06

Order in the app or on WhatsApp

A cart, a checkout and an order followed from pending to completed, with the buyer paying the seller directly. Where the seller prefers it, the same basket is sent as a ready-written WhatsApp message instead.

07

Alerts that bring people back

Customers can ask to be told when a product is back in stock or drops in price, and hear about deals from the businesses they saved — each one a push notification in their own language.

08

Reviews you can trust

Only a customer with a completed order can review, within 60 days, with up to four photos. Sellers reply; anyone can report a review, and an operator moderates it.

09

Verified, and checked by a person

Businesses can have their registration number checked for a verified badge. Subscriptions — one plan at Rs 490 a month, with 12 months for the price of 11 — are approved by an operator, and a nightly job unpublishes lapsed listings.

10

Insights for sellers

Profile visits, calls, WhatsApp taps and orders, saves and online orders, charted week by week in Mauritius time, so a seller can see whether being listed is working.

11

An operator console

Moderation, activations, verifications, review reports, hosts, stay payments, payouts and disputes, platform analytics, and a door-to-door team whose field visits are logged against each business.

12

Three languages, one product

English, French and Mauritian Kreol throughout the web and both apps, push notifications written in each recipient’s own language, light and dark themes, and a side rail for the iPhone’s unfolded landscape display.

One order, traced

A customer finds a shop on Lokal and orders from it. This is everything between pressing “Place order” and the seller’s phone lighting up.

Read from orders.service.ts, the place_order and resolve_order_lines functions, the orders insert policy, migration 036 and the push-dispatch Edge Function. Every name below appears in the source exactly as written.

  1. 01

    Checkout needs a signed-in buyer

    The checkout page sits behind the authentication guard, and the delivery details are validated by a Zod schema before anything is sent.

    • RequireAuth
    • checkoutSchema
    What it says when it refuses

    An anonymous visitor is sent to sign in first; a name under two characters or a phone number under six never leaves the form.

  2. 02

    The client previews; the database prices

    usePlaceOrder hands the basket to the orders service, which calls one function, place_order. The total on screen is only a preview — the function runs as the buyer, so every rule below still applies to it.

    • usePlaceOrder
    • placeOrder
    • place_order
  3. 03

    Every line is priced again on the server

    resolve_order_lines reads each product fresh: its price, the deal price if a deal is running right now, and the options the buyer picked.

    • resolve_order_lines
    • deal_is_active
    • product_not_orderable
    • options_changed
    What it says when it refuses

    A product that has sold out or stopped taking orders, or whose options changed since the page loaded, is refused with a message saying which.

  4. 04

    Two tables, one transaction

    The order is written as pending, in rupees, with payment marked direct — Lokal holds no money for orders. Each line keeps its own name, price and regular price, so a later change never rewrites a past order.

    • orders
    • order_items
    • payment_method: 'direct'
    • regular_unit_price
  5. 05

    Row-level security checks the buyer

    The insert policy requires that the buyer on the row is the signed-in user, and that the business is published.

    • buyer_id = auth.uid()
    • business_is_public
    What it says when it refuses

    Ordering as someone else, or from a listing that is not active, is refused by Postgres itself — whatever the client sends.

  6. 06

    …and then the business

    The same policy asks whether this business takes orders at all: its switch is on and its subscription is active.

    • business_accepts_orders
    • accepts_orders
    • subscription_status = 'active'
    What it says when it refuses

    A lapsed subscription, or a seller who has just switched orders off, refuses the insert — even from a browser tab opened before the change.

  7. 07

    Stock is taken under a lock

    A trigger on each line locks the product row, takes the quantity off its stock — or off the stock of the option picked — and records that it did, so a cancelled order puts it back.

    • order_items_take_stock
    • for update
    • insufficient_stock
    What it says when it refuses

    Two buyers racing for the last one cannot both have it; the second is told there is not enough left.

  8. 08

    The seller is told, in their language

    A trigger on the new order queues a notification for the seller, rendered from notification_copy in the language on their profile — English, French or Kreol — with English as the fallback.

    • queue_order_notification
    • notify_user
    • notification_copy
  9. 09

    Delivery that survives a failure

    The outbox row nudges the push-dispatch Edge Function at once, and a cron job drains anything left every minute. Each row is claimed once, sent to every one of the seller’s devices over FCM and retried up to five times.

    • notification_outbox
    • push-dispatch
    • push-dispatch-drain
  10. 10

    Both sides stay in step

    Orders are published over Realtime, so the seller’s list updates live. When the buyer uploads their proof of payment, its timestamp comes from the database clock, not from the phone.

    • supabase_realtime
    • orders_stamp_payment_proof

Engineering detail

Taken from the project source, not from marketing material.

Data model
Supabase Postgres: 47 tables, every one under row-level security with 106 policies between them (and 28 more on storage), 234 SQL functions, 89 triggers, 17 enums and 11 scheduled jobs, built up across 98 migrations
Authorisation
Enforced in the database, not the screens — a seller cannot publish their own listing, only an operator can confirm a guest’s payment for a stay, and a rental’s exact address stays private until that payment is confirmed; the service-role key never reaches a client
Web client
React 19 with strict TypeScript and Vite, TanStack Query, Zustand, React Hook Form and Zod; 18 feature modules split into domain, application, infrastructure and presentation layers; 88 lazy-loaded pages behind 6 route guards
Mobile client
Flutter with Cubits, go_router and get_it on the same Supabase project and the same copy — 307 hand-written Dart files across 21 features, with flutter_map, geolocator, Firebase Cloud Messaging and Sentry
Stays and payments
Quotes, availability and refunds computed by Postgres functions; iCal import and export through two Edge Functions; host payouts generated monthly by pg_cron, held while a dispute is open
Quality gates
801 Vitest tests on the web client, pgTAP tests of the row-level security, Deno tests of the Edge Functions and over 700 Flutter tests; every push to main is type-checked, linted, tested, built and released atomically, then smoke-tested against the live site

Everything local in Mauritius, in one place.

Lokal — StyloTech product — StyloTech