Case study
Karta Tunisie
An online shop where buyers in Tunisia order game credits, gift cards and AI subscriptions, pay in dinars by bank transfer or in cash, and get their code by email once the payment is confirmed.
- Role
- Sole designer and developer
- Type
- Independent product
- Timeline
- 2026 – today
- Status
- Live
- Next.js
- TypeScript
- MySQL
- Drizzle ORM
- next-intl
- Tailwind CSS

Why I built it
Many people in Tunisia can’t pay foreign online stores with their bank card, which makes buying game credits or a ChatGPT subscription hard. Karta Tunisie sells these as codes and takes payment in dinars, by bank transfer or in cash.
I designed, built and launched it alone, in French, English and Arabic: the storefront, the order flow, the admin panel, the emails, and the deployment and backups on a VPS.
No card payments
- Buyers pay by bank transfer or in cash in Monastir, and staff check each payment before sending the code. D17 mobile payments are built but stay off until the merchant account is ready.
- Prices are in dinars, stored as whole millimes and shown the Tunisian way: “1.250 DT” is one dinar and 250 millimes, so the shop never uses a thousands separator.
- It runs on a small VPS shared with other sites, as a single Node.js process, with MySQL tuned for the memory it has.
How it works
Karta Tunisie is a Next.js app (App Router, TypeScript) with Drizzle ORM on MySQL, and next-intl for the three languages.
The order form is checked with zod and sent through a server action. The server rebuilds the order from the live catalog, saves it under a unique reference (trying again if a reference is taken) and sends the emails after the response. Buyers paying by transfer upload their receipt, which is checked by its file signature and size before it’s stored.
In the admin panel each staff role has its own permissions. A staff member pastes the gift card code, which goes to the buyer by email and is never written to the database.
Deploys run from a script: copy the code, install, build, migrate the database, swap in the new folder (keeping the old one) and restart the systemd service behind Nginx. A nightly database dump keeps 14 days of backups.
When a price changes
Admins change prices and stock while the shop is open, so the page a buyer has open can show an old price. If I trusted the price the form sends, a stale page or an edited request would set the total.
So the form sends the product, the amount and the price the buyer saw. The server looks up the live price and, if the two differ, stops the order and asks the buyer to reload. It’s one extra step when a price changes, and nobody pays an amount they didn’t see.
Testing
- 298 Vitest tests in 25 files cover pricing, money, building and checking orders, payments, receipts, order status rules, permissions and email templates. They are unit tests with no browser or database.
- Orders are limited to 3 per email every 10 minutes and 10 per IP address an hour. Five failed admin logins lock that IP address for 15 minutes.
- Every admin page and action checks the user’s permission, and an order’s status only changes if nobody else changed it first.
- Not done yet: there is no CI pipeline and no end-to-end tests.
Where it is now
Karta Tunisie is live in French, English and Arabic. Buyers browse the catalog, order and upload a payment receipt; staff confirm payments and send codes from the admin panel. The code is in a private repository.
(full-size image, opens in a new tab)More case studies
- Acta
Independent product
- OneForAll
Independent product
- MenuMate
Independent product
- Anywhere Jobs
Independent product
- PromptStream
Independent product