Bro. Nungu

05 · Agricultural marketplace

Apex Grain Market

In production

Buy crops directly from verified farmers.

Category
Agricultural marketplace
Role
Full-stack engineering, with a co-developer
Built by
Empire Pro Dev
Apex Grain Market marketplace on desktop in English: crop search, department and price filters, a promoted-ad banner and a grid of sample crop listings with prices per ton or kilogram.
Apex Grain Market home page on a phone in Kiswahili: crop search, a promoted-ad banner, two-column sample crop listings, and the bottom navigation with the cart in the centre.

Screens

Apex Grain Market interface

  • Apex Grain Market marketplace on desktop in English: crop search, department and price filters, a promoted-ad banner and a grid of sample crop listings with prices per ton or kilogram.
  • Apex Grain Market home page on a phone in Kiswahili: crop search, a promoted-ad banner, two-column sample crop listings, and the bottom navigation with the cart in the centre.
  • Apex Grain Market product page on a phone in English for sample dry beans from Manyara: a photo gallery, category and sample badges, and the price per kilogram.
  • Apex Grain Market product page on desktop in Kiswahili for sample maize from Kilimanjaro: image gallery, price per kilogram, a sample-listing notice, rating and available quantity.
  • Apex Grain Market promotions page on desktop in Kiswahili: sample ad cards for farm harvests, bulk buying, maize and hand-picked tea, each with a call-to-action button.
  • Apex Grain Market marketplace on a tablet in English: search, a promoted-ad banner and a three-column grid of sample crop listings, with the bottom navigation bar.
  • Apex Grain Market About page on a tablet in Kiswahili: the story, mission and vision of the marketplace, with links to explore the market and contact support.
  • Apex Grain Market Create Account dialog on desktop in English, letting a new user sign up as a customer or as a farmer or vendor.

Overview

An agricultural e-commerce marketplace for Tanzania that connects buyers with verified farmers and vendors of grains, cereals and other crops. It covers listings, cart and checkout, shipping quotes, promoted ads, chat and announcements, and bulk SMS, in English and Kiswahili.

Product areas

  • Buyers
  • Verified vendors
  • Crop listings
  • Cart & checkout
  • Shipping quotes
  • Ads
  • Chat & announcements
  • Bulk SMS
  • Administration
  • English & Kiswahili

Technologies

  • Next.js
  • TypeScript
  • Prisma
  • PostgreSQL
  • NextAuth
  • next-intl

Case study

From problem to product

The complete engineering lifecycle behind Apex Grain Market.

  1. 01

    Problem

    Buyers of grains and cereals need a trustworthy way to find quality produce and deal directly with the farmers who grow it.

    • Buyers struggle to find reliable sources of quality produce
    • Farmers depend on middlemen to reach buyers
    • Many farmers are easier to reach by text message than through an app
  2. 02

    Idea

    Apex Grain Market: one marketplace where verified farmers list their crops and buyers order directly, with the chat, announcements and SMS reach that agricultural trade relies on.

    • Verified vendors and a moderated listing catalogue
    • Chat, support and announcements built into the marketplace
    • Bulk SMS, so announcements reach farmers without mobile data
  3. 03

    Approach

    Apex Grain Market was built with a co-developer, feature by feature: first the core buy-and-sell loop, then the communication, advertising and administration around it.

    • Kiswahili and English from the first screen, not added as a later translation
    • A fallback for every feature that depends on an outside service
    • Admin and staff tools built alongside the buyer experience
  4. 04

    Architecture

    Buyers, vendors, staff and administrators each work in their own area of one Next.js application, backed by PostgreSQL through Prisma. Announcements posted in chat can also go out as bulk SMS, with delivery reports tracked for each recipient.

    • Role-based areas for buyers, vendors, staff and administrators
    • Realtime chat over WebSockets, switching to polling automatically when a socket is unavailable
    • Email sent over SMTP, with an HTTPS email API as the fallback

    System architecture

    3 layers · 9 modules

    1. L01Experiences

      3 modules
      • Buyer marketplace
      • Vendor workspace
      • Admin console
    2. L02Services

      4 modules
      • Listings & categories
      • Orders & shipping quotes
      • Ads & engagement
      • Chat, announcements & SMS
    3. L03Data

      2 modules
      • PostgreSQL · Prisma
      • Uploaded media
    Conceptual architecture: layers and their responsibilities.
  5. 05

    Design

    The marketplace is mobile-first and installable, with a bottom navigation bar on phones and crop cards that show units, quality and discounts at a glance.

    • Crop units shown in the reader's own language
    • A floating chat button with swipe-to-reply
    • Custom error pages and loading states throughout
  6. 06

    Development

    The application is TypeScript on Next.js with Prisma and PostgreSQL, and NextAuth for accounts, email verification and password resets.

    • Ads with scheduled start and end dates, likes and comments
    • Shipping quotes on orders
    • Expense tracking for the business behind the marketplace
    • Notifications to admins and staff when listings, vendors, ads or expenses are created
  7. 07

    Data

    PostgreSQL holds users, vendors, listings, orders, ads and conversations, with a Prisma migration committed for every schema change.

    • Admin analytics across orders, listings and vendors
    • An SMS delivery report stored for each recipient
    • Uploaded images optimised before they are stored
  8. 08

    Testing

    Every deployment is checked against a short release list: the home page loads, sign-in and registration work, uploads persist and database writes succeed.

    • Bulk SMS tried on a single test number before any real announcement
    • The SMS test endpoint restricted to administrators and staff
    • Email delivery confirmed on the fallback path when SMTP times out
  9. 09

    Deployment

    Apex Grain Market is live on Vercel, with PostgreSQL behind Prisma and uploaded images served from Cloudflare storage. A Railway setup with a managed database and a persistent upload volume is kept ready as an alternative host.

    • Live at apexgrainmarket.vercel.app
    • Installable as an app on phones and desktops
    • One setting to choose between realtime sockets and polling
  10. 10

    Result & current state

    The marketplace is live with a clearly labelled sample catalogue, so buyers, vendors and partners can explore every screen, in English or Kiswahili, before real listings go up.

    • Complete: listings, cart, checkout, shipping quotes, ads, chat, announcements, bulk SMS and admin
    • Next: onboarding the first verified vendors and their real listings

What building it taught.

Challenges

  • Reaching farmers who are not always online
  • Realtime chat on a host that exposes only one public port
  • Email failing where SMTP ports are blocked

Solutions

  • Announcements that also go out as bulk SMS, with delivery reports
  • A polling fallback that switches on automatically
  • An HTTPS email API used whenever SMTP times out

Lessons

  • Design for the network your users actually have
  • Every outside dependency needs a plan for when it is down
  • Language support is cheapest when it starts on day one