Urgent.News

What's breaking now, across thousands of outlets.

Tech

Farmora: my Next.js shop stalled up to 6s a page, so I made it local-first

What Farmora is Farmora ("From Local Farms to Your Door") is a farm-to-door marketplace. Farmers list what they've harvested and customers buy straight from them. Every order is delivered within three days, with a live tracker. Behind the shop there's an admin side where the platform keeps a 10% commission on each sale. Live demo: https://farmora-smoky.vercel.app Code:…

Farmora is a farm-to-door marketplace that connects local farmers with customers who want to purchase fresh produce directly from them. The platform was built by Fehan999 using Next.js 14.2 with the App Router and React 18, alongside Tailwind CSS 3, Firebase, Supabase Storage, Pexels CDN, Vercel, and Playwright. The farm angle of the site showcases each product's origin farm, giving customers a sense of where their food comes from.

To ensure the page loads quickly even when the backend is experiencing issues, Fehan999 implemented a local-first approach. Instead of waiting for a delayed response from the backend, getProducts() merged three sources - seed data, a cached Firestore snapshot in localStorage, and any changes made in the browser. This allowed the page to respond immediately, displaying the most recent data available. If the cached data was more than a minute old, the system would initiate a refresh without disrupting the user experience.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Deploy a Hono backend on AWS Lambda without an adapter layer

A Hono app may already have a normal HTTP server, routes, middleware, and database calls. Moving that app to Lambda used to mean adapting the request lifecycle or adding a bridge layer.

  • Deploy Hono backend on AWS Lambda Web Functions without adapter layer.
  • Node.js HTTP server listens on port, using AWSLAMBDAHTTPENDPOINT.
  • Evaluate app's startup behavior, authentication, regions, and cost impact before deployment.

More from Wednesday 14 October →