Marchés-Maroc

October 2026 – Present

Tender intelligence for companies bidding on Moroccan contracts, live at marches-maroc.com: its own hourly data feed, a feed ranked for each company, bid tables ranked under the decree, AI that reads tender files and cites the page, invoices paid by Moroccan card or bank transfer, and 15 paid add-ons. From brief to live in 25 days.

Client projectLiveB2B SaaSNext.jsData pipelineDocument AIMobile-firstBilling
01

Executive summary

B2B SaaS · Data platform · AI

From brief to a live, paying platform in 25 days.

A tender-intelligence SaaS for Moroccan companies, rebuilt from zero and already selling.

The problem

A 2015 desktop-only site, three saved searches, data typed in by hand, and a free official portal competing for the same companies.

What we built

Its own hourly data feed, a feed ranked for each company, AI on tender files, invoices and payments, a back-office and 15 paid add-ons.

The result

Live on marches-maroc.com, with companies already subscribed and paying. One product on phone, tablet and desktop, in French and Arabic.

Timeline

  1. 1Brief6 October 2026.
  2. 2DiscoveryThe old site, the official portal, the market.
  3. 3Preview linkIn week one.
  4. 4New brand24 October: Marchés-Maroc.
  5. 5LiveWith paying subscribers.
days from brief to live site
25
open tenders tracked on 30 October 2026
4,107
gap with the official portal's own count
0.05%
paid add-ons on one base platform
15

Why it matters to a founder

No vendor lock-in

Each outside service sits behind one adapter, so changing it never means a rebuild.

Data the business owns

An hourly feed from the official portal, checked every night.

Revenue that grows by add-ons

15 modules sold on top of the base, without a new release.

Built to run without you watching

Tested on 3 devices, scheduled jobs, alerts on data gaps.

The public home page with live counts, and the member's ranked feed on a phone.
02

Product overview

Full rebuild

A 2015 desktop site, rebuilt as a modern tender platform.

Same business, same customers. A product they can now use anywhere, and the owner can grow.

Marchés-Maroc makes one promise to Moroccan companies: never miss a contract you can win. The 2015 site kept it poorly: desktop only, three saved searches, data typed in by hand. We rebuilt it from zero: its own data feed, a feed ranked for each company, AI on tender files, online billing, a back-office and 15 paid add-ons.

AreaBeforeAfterSkills shown
SearchForm posted, no link to shareTypo-tolerant search, filters in the URLSearch engine
Your activityThree saved profiles, P1 to P3Unlimited searches, a ranked feedMatching
AlertsE-mail onlyE-mail, push, WhatsApp; 7 h and instantNotifications
PhoneA 2015 desktop siteDesigned for phone, tablet, desktopMobile-first UI
DataTyped in by the teamCollected from the official portal hourlyScraping, pipelines
ResultsRaw bid tablesWinner, gap to estimate, legal rankingDomain logic
Tender filesDownload and read aloneAI reads them and cites the pageLLM integration
BuyingSales call, no online paymentPlans, invoices, card or transferBilling
Running itOld back end, not reusable17-area back-office, roles, audit logAdmin dashboard
ArabicFrench onlyFrench and Arabic, right to lefti18n, RTL

Four portals, one app

Members
  • Ranked feed « Pour vous »
  • Search and alerts
  • Tender page, bid tables
  • Pipeline and calendar
  • Team, plan, modules
Back-office
  • Data collection
  • Entry queue with AI
  • Members and CRM
  • Invoices and plans
  • Statistics, AI cost
Public site
  • Tender and buyer pages
  • Price calculator
  • The decree, by article
  • Plans and modules
  • Free sign-up
Partners
  • Private buyers publish
  • Suppliers answer
  • Advertisers
  • API clients
  • Referrers
The member's feed: only tenders that fit, closing soonest first. Desktop and phone.
03

Discovery

Market research · Product strategy

Before any code, we found what is worth paying for.

The official portal is free. So the product had to earn its price.

Every public tender in Morocco is already published for free on marchespublics.gov.ma. A paid platform only lasts if it does more. We toured the old member area screen by screen, studied the government portal as a product, and profiled 50 competitors. The answer was a 47-feature catalogue, and every feature was later tied to a screen and a test.

From research to a build plan

  1. 1Old site22 member sections.
  2. 2Official portal28 modules toured.
  3. 3Market50 competitors.
  4. 4Catalogue47 features, 8 dropped.
  5. 5PlanA base platform plus modules.
sections of the old member area inventoried
22
friction points written up, in 5 groups
28
competitor profiles, each with sources
50
features, each with a screen and a test
47
What we found
  • Listings became free: the official portal sends its own alerts, so a list of tenders alone is hard to sell.
  • The money moved to intelligence and bid preparation, and the AI players only cover the official portal.
  • Nobody offered a real phone product, and WhatsApp alerts were kept for top plans.
  • The decision: a base that finds and follows tenders, plus modules sold one by one, so revenue can grow without a rebuild.
Built with
  • Playwright crawler
  • Feature catalogue
  • Traffic study
  • Clickable prototype
The result: one base platform and its add-on modules, live on marches-maroc.com. On the phone, onboarding by activity code.
04

Architecture

Full-stack

One app, four portals, nothing locked to a vendor.

Members, staff, visitors and partners all use one Next.js application.

Payments, WhatsApp, e-mail and AI each sit behind their own adapter, with a sandbox by default. For the owner, that means no lock-in: changing the AI model is a settings change, and changing a provider touches one file, not the whole app.

The system, layer by layer

Who uses it
  • Member companiesphone, tablet, desktop
  • Staffadmin, adviser, operator
  • Visitors, Googleand AI answer engines
  • Partnersprivate buyers, API
Web app · Next.js on Vercel
  • Public pagesSEO, read live from the database
  • Member appa layout per device
  • Business logicrules checked on the server
  • Back-office17 areas, 3 staff roles
Data pipeline · one stream
  • Collectors9, run by Vercel Cron
  • Job queuein Postgres, J+1 to J+30
AI layer · every call costed
  • AI GatewayGemini, Claude, zod output
  • Documentsread with page citations
Data
  • PostgreSQL on Neon · Drizzleone database, every change versioned
  • French full textunaccent + trigram for typos
  • Module tableseach module owns its own
External services · behind adapters
  • Clerkaccounts, sessions
  • Resend10 e-mails
  • WhatsAppCloud API
  • Web PushPWA alerts
  • CMIMoroccan cards
Architecture principle

Sign-in by Clerk; roles, plans and modules checked on the server for every action.

Skills used in this project

  • Full-stack web app
  • Next.js, React, TypeScript
  • PostgreSQL, Drizzle
  • Web scraping, pipelines
  • Auth and user roles
  • Billing and invoices
  • LLM integration
  • Structured AI output
  • Full-text search
  • E-mail, push, WhatsApp
  • Admin dashboard
  • Mobile-first UI
  • Arabic, right to left
  • SEO, structured data
  • Automated testing
05

Data pipeline

Web scraping · Scheduled jobs

A data feed the business owns, refreshed every hour.

The product is only as good as its data, so it depends on nobody for it.

Every public tender in Morocco is published on marchespublics.gov.ma, which offers no API. Our collectors read it the way a careful visitor would, one request at a time: new tenders every hour, then details, lots and documents, and after the deadline the bid table and the winner. Every night our count is checked against the portal's own.

One tender, from portal to member

  1. 1New tenderFound within the hour.
  2. 2DetailsLots, documents, codes.
  3. 3Bid tableChecked at J+1, 3, 7, 14 and 30.
  4. 4Nightly checkOur count against the portal's.
  5. 5AlertWhen the gap passes 1%.
gap with the portal's count at delivery
0.05%
of closed tenders with their bid table
81.8%
collectors, from tenders to exclusions
9
request every 2.5 s, a single stream
1
Back-office › Collecte: 3,959 tenders on our side, 3,957 on the portal. On the phone, purchase orders near the member.
For technical readers
  • The portal's form postbacks are rebuilt over plain HTTPS with a cookie jar; 9 MB result pages are scanned, never fully parsed.
  • Parsers find fields by their labels and are unit-tested on 16 real portal pages. A missing label raises an alert.
  • Later work (bid tables, award notices) waits in a job queue in Postgres, with 5 retries and a cursor so any run can resume.
  • When the source changes: the portal redesigned its pages in October; parsers were rewritten, every tender published meanwhile was recovered, and purchase orders now take 63 requests instead of 312.
Built with
  • Node HTTPS client
  • Vercel Cron
  • PostgreSQL job queue
  • Vitest
06

Search and alerts

Search · Matching · Notifications

The right tenders find the company, with the reasons why.

No more daily searching. Members open one feed, ranked for them.

A company describes itself once: activities, regions, qualifications and the size of contract it can take. From then on every open tender is ranked for it, with the reasons it matches, the ones closing soonest first. Search forgives typos and speaks Morocco's qualification codes. Alerts arrive by e-mail, phone notification or WhatsApp.

From profile to alert

  1. 1Profile4 steps, with a live count.
  2. 2MatchWith its reasons.
  3. 3FeedClosing soonest first.
  4. 4DigestEvery morning at 7 h.
  5. 5Instant alertFor strong matches.
qualifications and 28 classes in the filter
414
activity codes explained in plain words
74
channels: e-mail, push and WhatsApp
3
instant e-mail per 12 h at most
1
Search with its filters in the link: save it, share it, get alerted. On the phone, the alert settings.
For technical readers
  • French full-text search (Postgres, accents ignored) plus trigram matching for typos; each filter count ignores its own filter.
  • Matching is rules, not a black box: activity, region, qualification, amount, followed buyer; up to 4 reasons shown.
  • Quiet hours hold alerts; reminders 7 and 2 days before a deadline and the day before a site visit.
  • Built not to spam: only tenders from the last 2 days alert, grouped, one e-mail every 12 h at most.
Built with
  • Postgres full text
  • Resend
  • Web Push
  • WhatsApp Cloud API
07

Bid tables

Domain logic · Regulation · Data visualisation

Read a tender in 30 seconds, rank it like the law.

Who bid last time, how much, and who wins under the decree, on one screen.

The tender page puts first what decides a bid: deadline, guarantee, owner's estimate, qualifications, documents and this buyer's history. Once bids are opened, the bid table shows every offer, its gap to the estimate and the winner, ranked by article 44 of decree 2-22-431, with the formula taken from the article itself.

From tender to decision

  1. 1FactsDeadline, estimate.
  2. 2Buyer historyIts usual winners.
  3. 3Bid tableEvery offer.
  4. 4Decree ruleArticle 44.
  5. 5PipelineGo, file, won.
above the estimate: offer set aside as excessive
20%
below for supplies (20% for works): too low
25%
checks per tender to catch its bid table
5
sign-ups needed for the free calculator
0
The bid table: every offer, its gap to the estimate, the winner under article 44. On the phone, the free price calculator.
Rank the offers like article 44 · move them
Contract type
Owner's estimate (E)
1,000,000 MAD
Mean of kept offers (M)
965,000 MAD
Reference price P = (E + M) / 2
982,500 MAD
Winner
Offer A · 980,000 MAD
Illustrative offers. Move one, or switch the contract type, and the reference price and winner follow the article 44 rule. Cases the decree treats differently (studies, guarding and cleaning, unit prices, ties) are left out.
For technical readers
  • Rule: drop offers too high or too low against the estimate E, then P = (E + M) / 2, where M is the mean of the rest; the best offer is the closest below P.
  • Cases the decree treats differently (studies, guarding and cleaning, unit prices, ties) are named in the screen, not guessed.
  • Pipeline board and a calendar of deadlines, site visits and openings, with a private ICS feed.
  • Checked against the law: every rule was verified against the decree, article by article, before launch.
Built with
  • TypeScript rules
  • Unit-tested cases
  • ICS calendar feed
  • Excel export
08

Document AI

LLM integration · Structured output

AI that reads tender files and shows its source.

The AI proposes. The member checks the file and the page behind every answer.

Before deciding to bid, someone has to read a ZIP full of PDFs. The documents module opens it in the browser; the AI lists the requirements, the pieces to provide and the key dates, each with its file and page, then gives a Go or No-Go against the company's profile. The regulation assistant answers from the decree's own articles, and says so when they don't cover the question.

From a tender file to a decision
  1. 1
    UploadA ZIP or a PDF of the tender file.
    Code checks
  2. 2
    ReadOpened in the browser.
    Code checks
  3. 3
    ExtractRequirements, pieces to provide and key dates, into a strict schema.
    AI proposes
  4. 4
    CiteEvery line carries its file and page; a requirement without them is rejected.
    Code checks
  5. 5
    Go / No-GoWeighed against the company's profile, with the sources one click away.
    AI proposes
AI models behind one adapter
4
decree articles searched before the AI writes
170
models read each scanned page, then compared
2
questions a day per company, so AI costs stay capped
60
Documents: requirements, pieces and dates, each line citing its file and page. On the phone, the regulation assistant.
For technical readers
  • Every call goes through Vercel AI Gateway with a zod schema: a requirement without a file and page is rejected.
  • The regulation assistant finds the articles first; the model only rephrases them and must answer « je ne trouve pas » otherwise.
  • Scanned price indices (185 symbols × 6 months) are read by Gemini and Claude; cells where they differ are shown side by side for a person.
  • Every call is logged with its model, tokens and cost, per company, in Back-office › Statistiques.
Built with
  • Vercel AI SDK, Gateway
  • Gemini 3.8 Flash
  • Claude Sonnet, Haiku
  • Zod schemas
09

Add-on modules

Product architecture · Public API

One base platform, 15 add-ons to sell on top.

Same customers, more to offer them, without a new release.

The base finds and follows tenders. Everything else is a module with its own pages, data and jobs, so the base never depends on it. A company without a module sees a preview filled with its own real numbers, which does the selling, and can request it, add it to its plan, or buy it for a single tender.

How a module reaches a member

  1. 1Locked previewFilled with the company's real counts.
  2. 2RequestOr upgrade the plan.
  3. 3Switched onBy the plan, or by staff.
  4. 4Panels appearOn the tender pages.
  5. 5Pay per fileFor one tender only.

The 15 modules

  • Competitor watch
  • Document reading
  • Document vault
  • Bid preparation
  • Guarantees, banks
  • Consortia
  • Africa tenders
  • Regulation assistant
  • Market reports
  • Training
  • Supplier directory
  • Advertising
  • Private buyers
  • Arabic interface
  • Data API
Market reports: the monthly barometer by sector, region and buyer. On the phone, competitor watch.
For technical readers
  • Each module is a manifest: pages, panels for named slots on the tender page, jobs run inside the existing crons, and permissions.
  • Access is one indexed lookup, checked on the server for every page and action, never only in the screen.
  • The Data API gives keys shown once and stored hashed, 60 calls a minute and 10,000 a day, with a clear 429 when over.
  • Why it matters: adding a module to a plan is a settings change; the team sells new products without a release.
Built with
  • Module registry
  • Per-module tables
  • REST API, hashed keys
  • Cron-run jobs
10

Billing and payments

Billing · Payments · Subscriptions

Getting paid the way Moroccan companies pay.

An invoice with VAT first, then a Moroccan card or a bank transfer.

Four plans from one seat to fifty, a free account without a card, and prices given on request, with a quote. Every purchase produces a numbered invoice with VAT, as a PDF. Members pay by Moroccan card through CMI or declare a transfer the team validates. Renewals, reminders and late payments run on their own every morning, so nobody chases invoices by hand. Companies already subscribe and pay through it.

From plan to renewal

  1. 1Choose a planOr a single module.
  2. 2InvoiceNumbered, with VAT, as a PDF.
  3. 3PayBy CMI card or bank transfer.
  4. 4AccessPlan and modules switched on.
  5. 5RenewalReminders, then a grace period.
plans, from 1 to 50 seats
4
VAT, read from settings, never hard-coded
20%
days of grace before access closes
15
free month for each referral that pays
1
Account › Abonnement: plan, seats, add-ons and every invoice. Desktop and phone.
For technical readers
  • CMI 3D Pay Hosting form with its ver3 hash and a signed callback; bank transfers validated in the back-office.
  • Upgrades charge the prorated difference; downgrades wait for the renewal date; payments are idempotent.
  • Daily job: renewal invoice 30 days ahead, reminder at 7 days, late notices at 3 and 10 days, then grace and expiry.
  • When it goes wrong: a pending payment opens a grace period with a banner, instead of cutting a paying team off.
Built with
  • CMI payment gateway
  • pdf-lib invoices
  • Vercel Cron
  • Resend reminders
11

Back-office

Admin dashboard · Roles · Data quality

A back-office the team runs the business from.

Data, members, sales and billing, each person seeing their part.

We built the back-office from scratch, so the team had its own tools from day one. Operators watch the data and add tenders the portal doesn't carry; advisers handle members, leads and invoices; administrators see everything. Every change is audited, and support can see the app as a member does, read-only.

Entry queue: a tender not on the portal

  1. 1Paste or PDFText or a scan.
  2. 2AI prefillFields proposed.
  3. 3CheckEach field, by a person.
  4. 4DuplicatesA 120-day lookup.
  5. 5PublishTo the feed and the alerts.
areas, shown by role
17
staff roles: admin, adviser, operator
3
of staff writes in the audit log
100%
read-only « see as the member »
1
Back-office › File de saisie: a tender pasted or scanned, prefilled by AI, checked by a person.
For technical readers
  • Duplicates are caught by reference and buyer, then by text similarity over 120 days.
  • Read-only impersonation is enforced on the server for every action, not by hiding buttons.
  • Team: invitations, role changes and suspension of a company; the team can never lose its last administrator.
Built with
  • Server actions
  • Audit log
  • Role permissions
  • AI prefill
12

Devices, Arabic and SEO

Mobile-first UI · Arabic RTL · SEO

Every device, two languages, and found on Google.

Bid managers work on site as much as at a desk, and many find tenders through Google first.

Phone, tablet and desktop each get their own design instead of one layout stretched. The whole member app also runs in Arabic, right to left. And the public site, generated from the live database, gives every tender, buyer and winner its own page: visitors get the facts, while bids, contacts and AI tools wait behind a free sign-up.

Company recordWins, amounts and its gap to estimates.
PipelineTo study, in preparation, filed.
Arabic, right to leftThe whole member app, mirrored.
Public decree pagesOne page per article.
layouts per screen: phone, tablet, desktop
3
Arabic strings, 0 missing
1,933
decree articles, one public page each
170
AI crawlers named and allowed
13
For technical readers
  • The server picks the layout from a cookie, then the browser measures the real screen and switches if needed.
  • Arabic: logical CSS, mirrored icons, IBM Plex Sans Arabic; a check script lists any string left without a translation.
  • Public pages never select gated columns; a test reads the raw HTML for any bid or contact.
  • Sitemaps read live from the database, structured data on every page, llms.txt for AI answer engines.
Built with
  • Tailwind CSS
  • shadcn/ui
  • i18n check script
  • JSON-LD, sitemaps
13

Production readiness

Automated testing · Operations

Built to keep working long after launch day.

The parts nobody sees, and the reason the product keeps its promises.

unit tests on rules, formulas, parsers and billing
503
end-to-end tests, each on a phone, a tablet and a desktop
188
manual steps to deploy a change
0
scheduled jobs running the product
6
screens checked for accessibility
17
visual baselines, so a layout change is never a surprise
24
Tested before every release

Unit tests on rules, formulas, parsers and billing. End-to-end tests on a phone, a tablet and a desktop, from first click to the database. A change to one feature cannot quietly break search, alerts or payments.

Scheduled jobs

Six protected cron jobs: hourly collection, the nightly sweep, the morning digest, instant alerts every 5 minutes, reminders and billing.

E-mail and sign-in

Ten e-mails from one send point, on Resend. Sign-in by Clerk with our own screens, a 6-digit code to prove the address, and rate limits on every form.

Accessibility and visuals

WCAG 2.1 AA checks with axe-core on 17 screens and 3 devices, a keyboard path, and 24 visual baselines in Playwright.

Security

Permissions checked in every server action and route, entitlements on the server, API keys hashed, secrets only in the environment, gated data never on public pages.

Every change, from laptop to customers

  1. 1Feature branchOne change at a time.
  2. 2Code reviewBefore every merge.
  3. 3Typecheck + testsUnit and end-to-end.
  4. 4PreviewOn a test database.
  5. 5ProductionThe live site.
14

What we can build

About · Stack

Full-stack products with AI: researched, built, tested and kept running.

Marchés-Maroc is live at marches-maroc.com. Here is what it proves we can build for you.

An AI SaaS from scratch

Accounts, plans, payments, admin and AI features, live and tested.

Data platforms and scraping

Collect, clean and check data from sites without an API.

AI on documents

Extraction with sources, Q&A on your own texts, cost control.

Billing and back offices

Invoices, local gateways, renewals, CRM and admin.

Rebuild an old platform

A faster, phone-first product, even without the old code.

Products that grow by modules

Add-ons, plans and an API, sold without a new release.

How we work

  1. 1DiscoveryWe study what exists and what is worth building.
  2. 2Fixed priceA clear scope, price and timeline.
  3. 3PreviewsA staging link you can try as we build.
  4. 4DeliveryTested, documented, full source code.

What you get

  • Full source code, yours
  • Tests on every feature
  • Documentation and handover
  • A preview link from week one

Built with

App and UI
  • Next.jsone app, four portals
  • Reacta layout per device
  • TypeScriptrules and parsers
  • Tailwind CSSlogical CSS for RTL
  • shadcn/uidesign system
Data
  • PostgreSQLfull text, job queue
  • Neonone database
  • Drizzleversioned changes
AI
  • AI SDKAI Gateway, every call costed
  • Geminidocuments, scanned pages
  • ClaudeSonnet, Haiku
  • Zodstrict output schemas
Accounts and payments
  • Clerksign-in, roles
  • CMIMoroccan cards
  • Resend10 e-mails
  • WhatsAppCloud API alerts
Testing and hosting
  • Playwright3 devices
  • Vitest503 unit tests
  • Vercelhosting, Cron

Marchés-Maroc · marches-maroc.com · Figures counted from the codebase and the live site on 30 October 2026.