VeloDev
arrow_backBack to Portfolio
Case Study

Coșul Local App

Marketplace Delivery PWA

Coșul Local is an offline-ready Progressive Web Application (PWA) connecting Romanian consumers directly with regional food producers. It streamlines local food hubs supply chains by offering a high-performance marketplace interface, dynamic client order tracking, and delivery log management.

RoleLead Frontend Engineer
TimelineOctober 2025
CategoryPWA / E-commerce
DeploymentVercel / Supabase SSR
Technology Stack
Next.js 16React 19TypeScriptSupabase SSRZustandshadcn/uiTailwind CSSZodreact-hook-form
Lighthouse audit — production
98
Perf
100
A11y
100
Best Pr.
100
SEO
LCP (Speed)0.8s
INP (Response)45ms

Source: Lighthouse, production.

https://cosul-local.ro/consumer/dashboard
WORKSPACE SCREENS
Click on tabs to switch views. Click on the image to open full size.
Consumer Dashboard
zoom_inZoom Screenshot

infoConsumer Dashboard

Main workspace greeting users, displaying key statistics cards (pending, confirmed, delivered orders) and order list filters.


Engineering snapshot

Challenge, ownership, decisions, result

Challenge

Local food producers needed ordering, live tracking and delivery management, for customers who shop from a phone on a weak rural connection — without the cost of a marketplace platform.

What I owned
  • The whole frontend: marketplace, cart, checkout, order tracking and the delivery log views.
  • Data access through Supabase SSR, including session handling on the server.
  • Offline behaviour and the PWA layer.
  • Performance budget and the Core Web Vitals the app is held to.
Result
  • check_smallLive at cosul-local.ro, used by real producers and customers.
  • check_smallLighthouse 98 performance / 100 accessibility / 100 best practices / 100 SEO, with 0.8s LCP and 45ms INP.
  • check_smallShopping keeps working through a dropped connection instead of losing the basket.
Key engineering decisions
01

Treat the cart as local state that survives the network

The cart lives in a Zustand store synchronized to localStorage rather than on the server. A customer who loses signal mid-shop keeps their basket, and the server only sees it at checkout.

02

Render on the server by default, hydrate only what interacts

Catalog and product pages are server-rendered through the Supabase SSR client with cookie-based session verification; only the cart and filters ship as client components. That is where the 0.8s LCP comes from.

03

Validate at the boundary with Zod

Every user-supplied payload passes a strict schema before it reaches Supabase, so a bad form submission fails as a readable error instead of as corrupted order data.

04

One codebase for customers and drivers

Driver routing and delivery logs reuse the same components and data layer as the customer portal, scoped by role, instead of a second application to keep in sync.


Key Capabilities & Features

Coșul Local integrates client-server synchronization, offline cart storage, and responsive views to deliver a unified local food hub app.

query_stats

Consumer Statistics Overview

Responsive welcome headers displaying 4 themed cards representing total, pending, confirmed, and delivered order counts mapped instantly to database states.

filter_list

Interactive Order Filters

Client-side filter toggles allowing users to instantly group orders by status (All, Pending, Confirmed, Delivered, Cancelled) with live indicators showing order counts per status.

shopping_cart

Zustand Offline-Ready Cart

A light weight state store managing product quantities and delivery schedules locally, ensuring users don't lose their cart items when moving offline.

person

Dual Roles Management

Decoupled authenticated workspaces separating Consumer profiles from Producer inventory managers, featuring custom theme templates and tailored actions.

Next.js & Supabase Integration

Technical Architecture

Coșul Local leverages Next.js 16 App Router along with Server Actions to manage server mutations securely. Database tables are hosted in a localized Supabase server (run via Docker locally) using auto-generated TypeScript schemas.

devicesFrontend Layer

  • App Router Layouts: Nested routes dynamically differentiating public `/piata` catalog from `(dashboard)/consumer` profiles.
  • Zustand store: Manages shopping cart updates and synchronizes with localStorage.
  • shadcn/ui & Tailwind: Modular design tokens ensuring quick style changes and mobile-first responsiveness.

boltServer Logic (Actions)

  • Secure Server Actions: Functions executing database writes (e.g. `consumer-orders.ts` or profile updates) with integrated validation.
  • Path Revalidations: Triggers Next.js `revalidatePath` on order submission/cancellation to ensure instant client sync.
  • Zod Validation: Strict schemas validating user settings and category updates.

cloud_queueSupabase Backend

  • Supabase SSR client: Manages cookie-based session verification for server-side fetches.
  • PostgreSQL Database: Hosts relational tables (profiles, products, orders, delivery_locations).
  • Supabase Storage: Buckets housing uploaded farm product images securely.

Project Screen Library

Click on any of the screenshots below to open them in the lightbox viewer.

Consumer Dashboard
zoom_in
Marketplace Catalog
zoom_in
Product Details View
zoom_in
Product Added to Cart
zoom_in
Producers Directory
zoom_in
Producer Profile Details
zoom_in
Producer Workspace
zoom_in
Mobile iPhone View
zoom_in