Kamioun Marketplace

Refactoring Kamioun: A Complete Frontend Overhaul for FMCG Marketplace

React NativeExpoTypeScriptMedusaJSZustandReact QueryMarketplace
Visit Project

Challenge

When I joined Kamioun, the mobile app had become a legacy monolith — a single React Native CLI codebase passed between multiple developers over time, each leaving their own patterns and shortcuts. There was no clear architecture, no defined ownership of modules, and almost no documentation. Business logic, API calls, and UI rendering were all intertwined in the same components. Debugging a single screen could take hours because side effects were scattered across the codebase.

The app had become slow, buggy, and fragile, and even small changes risked breaking something elsewhere. On the backend, Magento was overcomplicated and brittle, slowing down iteration and often breaking synchronization with the app. All this directly impacted the end users — thousands of corner-shop retailers in Tunisia — who needed a fast, simple tool to order products between serving customers, but were stuck with an unreliable app.

Process

We decided not to patch the existing system but to rebuild it from scratch with a clean, scalable foundation. The first architectural decision was to split the monolith into two separate apps:
A Retailer app for placing and tracking orders. A Driver app for managing deliveries. Both were migrated to Expo, which immediately improved build consistency and enabled Over-The-Air updates via EAS — a huge benefit for quick iterations in the field.
To prevent repeating past mistakes, I introduced a domain-driven architecture where each domain (catalog, auth, cart, orders, delivery) contained its own components, hooks, and data logic. This modular design isolated features and made the codebase predictable and easy to extend.

The outdated Redux implementation was replaced with Zustand for state management and React Query for server-side data synchronization and caching. This combination brought reactivity and performance, while reducing boilerplate.
Simultaneously, the backend was migrated from Magento to MedusaJS, providing a more flexible and developer-friendly foundation. I built a custom API client that abstracted authentication, pagination, and error handling, ensuring the frontend stayed backend-agnostic and easier to maintain.
All logic was rewritten in TypeScript, enforcing strict typing and catching errors early. On the design and UX side, we rebuilt the interface from scratch — focusing on speed, clarity, and minimalism. For low-literacy users with unstable internet, we prioritized large visuals, clear price visibility, and quick reordering.

Results

The transformation was both technical and experiential. The new Expo apps load significantly faster, feel smoother on entry-level Android devices, and experience far fewer crashes. Developer onboarding time dropped dramatically thanks to the new modular architecture and strict TypeScript typing. OTA updates now allow us to deploy fixes instantly without waiting for store approval.

Most importantly, Kamioun’s users — small shop owners — can now browse larger catalogs, compare prices, and place orders in seconds. What started as a fragile monolithic app has evolved into one of Tunisia’s most reliable and refined B2B e-commerce platforms, powered by a modern React + Medusa stack built to last.