惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Help Net Security
MyScale Blog
MyScale Blog
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
Vercel News
Vercel News
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
G
Google Developers Blog
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
云风的 BLOG
云风的 BLOG

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I Built a Hyperlocal Coupon Platform with Next.js Fir...
Sakthivel Murugan · 2026-06-27 · via DEV Community

Sakthivel Murugan

The Problem

Small local shops in Tier-2/3 Indian cities (think Tirunelveli, Tenkasi, Dindigul) have zero digital presence. No website, no app, no way to offer digital coupons. National platforms like Nearbuy and MagicPin don't serve these towns.

I'm a developer at Blumensoft Technologies, and we built goCoupon — a hyperlocal coupon platform where local shops can create digital coupon codes, and shoppers can claim them for free.

Tech Stack

Layer Technology
Frontend *Next.js *
Database Firebase Firestore
Auth Firebase Auth
Hosting Google Cloud Run, Firebase App Hosting
Mobile App Flutter
Styling Tailwind CSS

Why Next.js 14?

1. SEO is Everything for Us

We need Google to index pages like /offers/tirunelveli and /restaurants-near-me. Next.js gives us:

  • Server-Side Rendering (SSR) — Google sees fully rendered HTML
  • Incremental Static Regeneration (ISR) — Pages rebuild every hour without redeploying
  • Dynamic metadata — Each city page gets unique title, description, and structured data
// Every city page gets unique SEO metadata
export async function generateMetadata({ params }: Props): Promise<Metadata> {
  const city = getSEOCity(params.city);
  return {
    title: `Best Offers in ${city.name} Today | Deals & Coupons`,
    description: `Find ${city.name} offers...`,
  };
}

2. App Router + React Server Components

Server Components let us fetch Firestore data without sending the Firebase SDK to the browser. Less JavaScript = faster pages = better Core Web Vitals.

3. Built-in Sitemap & Robots

Next.js generates sitemap.xml and robots.txt dynamically:

// sitemap.ts — auto-generates XML sitemap
export default async function sitemap() {
  const cities = await getActiveTerritories();
  return cities.map(city => ({
    url: `https://gocoupon.in/offers/${city}`,
    lastModified: new Date(),
    changeFrequency: 'daily',
  }));
}

The SEO Strategy That Worked

We created 16 SEO landing pages targeting real search queries:

Page Target Keyword Monthly Searches
/today-offers today offers near me 25,000+
/free-coupons free coupon code 30,000+
/restaurants-near-me restaurant offers near me 15,000+
/salons-near-me salon offers near me 8,000+
/best-deals best deals today 10,000+

Each page has:

  • ✅ JSON-LD structured data (BreadcrumbList, FAQPage)
  • ✅ Unique H1 with target keyword
  • ✅ FAQ section (targets Google featured snippets)
  • ✅ Internal linking to city pages

Firebase Architecture

Firestore Structure:
├── businesses/
│   ├── {businessId}
│   │   ├── name, category, city
│   │   └── offers/ (subcollection)
│   │       └── {offerId}
│   │           ├── title, discount, validFrom, validThrough
│   │           └── couponCodes/ (subcollection)
│   │               └── {codeId} — unique per user

Key design decision: Every coupon code is unique and non-shareable. When a user claims a coupon, we generate a unique code tied to their user ID. This prevents abuse and gives businesses real tracking.

The IST Timezone Trap 🕐

Our Cloud Run server runs on UTC. But our users are in IST (UTC+5:30). An offer expiring "today" (June 26 IST) was showing as expired at 6:30 PM IST because the server compared against UTC midnight.

Fix:

export function isExpiredIST(validThrough: string): boolean {
  const nowIST = new Date(Date.now() + 5.5 * 60 * 60 * 1000);
  const endIST = new Date(validThrough + 'T23:59:59+05:30');
  return nowIST > endIST;
}

Results So Far

  • 🏙️ Live across 38 districts in Tamil Nadu
  • 📄 20+ indexed pages on Google (from ~5 before)
  • 🎟️ Unique coupon codes — no sharing, no abuse
  • 📱 Flutter mobile app for Android & iOS

Try It

👉 gocoupon.in — Browse offers near you

If you're building for local/hyperlocal markets, I'd love to hear your approach. Drop a comment!


I'm Sakthivel, developer at Blumensoft Technologies, Tirunelveli. We build digital products for small-town India.