Marchés-Maroc
October 2026 – PresentTender 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.
Executive summary
B2B SaaS · Data platform · AIFrom brief to a live, paying platform in 25 days.
A tender-intelligence SaaS for Moroccan companies, rebuilt from zero and already selling.
A 2015 desktop-only site, three saved searches, data typed in by hand, and a free official portal competing for the same companies.
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.
Live on marches-maroc.com, with companies already subscribed and paying. One product on phone, tablet and desktop, in French and Arabic.
Timeline
- 1Brief6 October 2026.
- 2DiscoveryThe old site, the official portal, the market.
- 3Preview linkIn week one.
- 4New brand24 October: Marchés-Maroc.
- 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
Each outside service sits behind one adapter, so changing it never means a rebuild.
An hourly feed from the official portal, checked every night.
15 modules sold on top of the base, without a new release.
Tested on 3 devices, scheduled jobs, alerts on data gaps.
Product overview
Full rebuildA 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.
| Area | Before | After | Skills shown |
|---|---|---|---|
| Search | Form posted, no link to share | Typo-tolerant search, filters in the URL | Search engine |
| Your activity | Three saved profiles, P1 to P3 | Unlimited searches, a ranked feed | Matching |
| Alerts | E-mail only | E-mail, push, WhatsApp; 7 h and instant | Notifications |
| Phone | A 2015 desktop site | Designed for phone, tablet, desktop | Mobile-first UI |
| Data | Typed in by the team | Collected from the official portal hourly | Scraping, pipelines |
| Results | Raw bid tables | Winner, gap to estimate, legal ranking | Domain logic |
| Tender files | Download and read alone | AI reads them and cites the page | LLM integration |
| Buying | Sales call, no online payment | Plans, invoices, card or transfer | Billing |
| Running it | Old back end, not reusable | 17-area back-office, roles, audit log | Admin dashboard |
| Arabic | French only | French and Arabic, right to left | i18n, RTL |
Four portals, one app
- Ranked feed « Pour vous »
- Search and alerts
- Tender page, bid tables
- Pipeline and calendar
- Team, plan, modules
- Data collection
- Entry queue with AI
- Members and CRM
- Invoices and plans
- Statistics, AI cost
- Tender and buyer pages
- Price calculator
- The decree, by article
- Plans and modules
- Free sign-up
- Private buyers publish
- Suppliers answer
- Advertisers
- API clients
- Referrers
Discovery
Market research · Product strategyBefore 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
- 1Old site22 member sections.
- 2Official portal28 modules toured.
- 3Market50 competitors.
- 4Catalogue47 features, 8 dropped.
- 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
- 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.
- Playwright crawler
- Feature catalogue
- Traffic study
- Clickable prototype
Architecture
Full-stackOne 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
- Member companiesphone, tablet, desktop
- Staffadmin, adviser, operator
- Visitors, Googleand AI answer engines
- Partnersprivate buyers, API
- Public pagesSEO, read live from the database
- Member appa layout per device
- Business logicrules checked on the server
- Back-office17 areas, 3 staff roles
- Collectors9, run by Vercel Cron
- Job queuein Postgres, J+1 to J+30
- AI GatewayGemini, Claude, zod output
- Documentsread with page citations
- PostgreSQL on Neon · Drizzleone database, every change versioned
- French full textunaccent + trigram for typos
- Module tableseach module owns its own
- Clerkaccounts, sessions
- Resend10 e-mails
- WhatsAppCloud API
- Web PushPWA alerts
- CMIMoroccan cards
Architecture principleSign-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
Data pipeline
Web scraping · Scheduled jobsA 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
- 1New tenderFound within the hour.
- 2DetailsLots, documents, codes.
- 3Bid tableChecked at J+1, 3, 7, 14 and 30.
- 4Nightly checkOur count against the portal's.
- 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
- 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.
- Node HTTPS client
- Vercel Cron
- PostgreSQL job queue
- Vitest
Search and alerts
Search · Matching · NotificationsThe 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
- 1Profile4 steps, with a live count.
- 2MatchWith its reasons.
- 3FeedClosing soonest first.
- 4DigestEvery morning at 7 h.
- 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
- 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.
- Postgres full text
- Resend
- Web Push
- WhatsApp Cloud API
Bid tables
Domain logic · Regulation · Data visualisationRead 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
- 1FactsDeadline, estimate.
- 2Buyer historyIts usual winners.
- 3Bid tableEvery offer.
- 4Decree ruleArticle 44.
- 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
- 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
- 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.
- TypeScript rules
- Unit-tested cases
- ICS calendar feed
- Excel export
Document AI
LLM integration · Structured outputAI 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.
- 1UploadA ZIP or a PDF of the tender file.Code checks
- 2ReadOpened in the browser.Code checks
- 3ExtractRequirements, pieces to provide and key dates, into a strict schema.AI proposes
- 4CiteEvery line carries its file and page; a requirement without them is rejected.Code checks
- 5Go / 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
- 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.
- Vercel AI SDK, Gateway
- Gemini 3.8 Flash
- Claude Sonnet, Haiku
- Zod schemas
Add-on modules
Product architecture · Public APIOne 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
- 1Locked previewFilled with the company's real counts.
- 2RequestOr upgrade the plan.
- 3Switched onBy the plan, or by staff.
- 4Panels appearOn the tender pages.
- 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
- 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.
- Module registry
- Per-module tables
- REST API, hashed keys
- Cron-run jobs
Billing and payments
Billing · Payments · SubscriptionsGetting 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
- 1Choose a planOr a single module.
- 2InvoiceNumbered, with VAT, as a PDF.
- 3PayBy CMI card or bank transfer.
- 4AccessPlan and modules switched on.
- 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
- 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.
- CMI payment gateway
- pdf-lib invoices
- Vercel Cron
- Resend reminders
Back-office
Admin dashboard · Roles · Data qualityA 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
- 1Paste or PDFText or a scan.
- 2AI prefillFields proposed.
- 3CheckEach field, by a person.
- 4DuplicatesA 120-day lookup.
- 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
- 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.
- Server actions
- Audit log
- Role permissions
- AI prefill
Devices, Arabic and SEO
Mobile-first UI · Arabic RTL · SEOEvery 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.
- 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
- 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.
- Tailwind CSS
- shadcn/ui
- i18n check script
- JSON-LD, sitemaps
Production readiness
Automated testing · OperationsBuilt 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
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.
Six protected cron jobs: hourly collection, the nightly sweep, the morning digest, instant alerts every 5 minutes, reminders and billing.
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.
WCAG 2.1 AA checks with axe-core on 17 screens and 3 devices, a keyboard path, and 24 visual baselines in Playwright.
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
- 1Feature branchOne change at a time.
- 2Code reviewBefore every merge.
- 3Typecheck + testsUnit and end-to-end.
- 4PreviewOn a test database.
- 5ProductionThe live site.
What we can build
About · StackFull-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.
Accounts, plans, payments, admin and AI features, live and tested.
Collect, clean and check data from sites without an API.
Extraction with sources, Q&A on your own texts, cost control.
Invoices, local gateways, renewals, CRM and admin.
A faster, phone-first product, even without the old code.
Add-ons, plans and an API, sold without a new release.
How we work
- 1DiscoveryWe study what exists and what is worth building.
- 2Fixed priceA clear scope, price and timeline.
- 3PreviewsA staging link you can try as we build.
- 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
- Next.jsone app, four portals
- Reacta layout per device
- TypeScriptrules and parsers
- Tailwind CSSlogical CSS for RTL
- shadcn/uidesign system
- PostgreSQLfull text, job queue
- Neonone database
- Drizzleversioned changes
- AI SDKAI Gateway, every call costed
- Geminidocuments, scanned pages
- ClaudeSonnet, Haiku
- Zodstrict output schemas
- Clerksign-in, roles
- CMIMoroccan cards
- Resend10 e-mails
- WhatsAppCloud API alerts
- 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.