Grabit
A grocery marketplace with ten roles, payments that are safe to retry, live chat and real-time rider tracking.
Live2026
Next.js 16 · Redux Toolkit · NestJS · Prisma 7 · Stripe · Leaflet

Overview
- What it is
- A multi-role grocery marketplace: storefront, vendor and admin tools, and rider delivery tracking.
- Why it exists
- To build commerce end to end at a realistic scale of roles, money handling and real-time logistics.
- The problem
- Commerce breaks at the edges: a double-clicked Pay button, a retried request, a delivery nobody can see. Each needs an engineered answer.
- Who uses it
- Customers, vendors, riders, support and admin staff — ten roles with their own permissions.
Given / Find
Given
- a)Ten roles, from customer and vendor to rider and admin
- b)Card payments where a retry must never become a second charge
- c)Deliveries customers want to follow live
Find
- a)One modular backend that keeps role permissions explicit
- b)Payment endpoints that are idempotent by design
- c)Live chat and rider location without page reloads
Approach
A modular NestJS application (33 modules) on Prisma and PostgreSQL. Payment requests carry an idempotency key that an interceptor records and replays. Socket.IO gateways carry chat, notifications and rider GPS; Leaflet draws the route. The storefront is Next.js 16 with Redux Toolkit, GSAP and Lenis across 118 pages.
My role
Full-stack developer · every commit in both repositories
- FrontendOwned118 Next.js 16 pages: storefront, dashboards, tracking.
- BackendOwned33 NestJS modules, payment safety, real-time gateways.
- Data modelOwned26 Prisma schema files.
Stack
- Frontend
- Next.js 16Redux ToolkitGSAPLenisLeafletTailwind CSS
- Backend
- NestJSSocket.IO gatewaysIdempotency interceptorPDF invoices
- Database
- PostgreSQLPrisma 7 (26 schema files)
- Auth & security
- JWT with refresh rotationTOTP two-factorTen-role RBAC
- Third-party services
- Stripe + webhooks
- Infrastructure
- Docker ComposeCoolify · VPS PaaS
Key features
F.01
Idempotent payments
Every payment request carries an idempotency key. Repeats get the stored response back instead of creating another charge.
F.02
Rider tracking
Riders stream GPS positions over Socket.IO; customers watch the delivery move on a Leaflet map.
F.03
Live chat and notifications
Customers and support talk in real time through the same gateway layer.
F.04
Ten-role operations
Vendors, riders, support and admins each get their own tools, enforced by role guards on the API.
F.05
Invoices and refunds
Orders produce PDF invoices; refunds, payouts and coupons each live in their own module.
Architecture
Browser · Next.js 16
Redux Toolkit · GSAP + Lenis · Leaflet map
REST (Idempotency-Key on payments) · WebSocketNestJS · one modular application
33 modulesidempotency interceptorgateways: chat, notifications, rider tracking
Prisma 7PostgreSQL
26 schema files
Called by the API
Stripe
checkout + webhooks
invoice generation
Challenges
Problem 01
Given
A double-click or a network retry can send the same payment request twice.
Approach
An idempotency interceptor reads the Idempotency-Key header, stores the first response, and returns that stored response for every repeat.
Result
A retried request returns the original result instead of charging the customer a second time.Problem 02
Given
Product lookups over a large sorted catalogue should not scan every row.
Approach
An interpolation-search service estimates where a key should sit from the value range, probing fewer positions than binary search on evenly spread keys.
Result
O(log log n) average lookups on uniform keys, with O(n) as the documented worst case.
Results
Outcome
What I learned
- Idempotency belongs in the payment API contract, not only in the button.
- Real-time features need the same permission checks as REST endpoints.