finds.dev← search

// the find

leerob/nextjs-vercel-firebase

★ 280 · TypeScript · updated Jul 2023

Next.js App Router + Firebase

A minimal Next.js App Router starter that wires up Firestore through API routes and deploys to Vercel. It's a reference template from Lee Robinson (Vercel DX), not a production-ready app. Useful if you want to see the correct way to initialize Firebase Admin SDK in a serverless environment without instantiating it on every cold start.

Comes from someone who actually works on Next.js, so the App Router patterns are correct and up to date for mid-2023. The Firebase Admin SDK initialization pattern (checking if an app is already initialized before calling initializeApp) is the right approach for serverless and avoids the duplicate-app error. Env var setup is straightforward and the .env.example makes it clear what credentials are needed.

Last updated July 2023 — three major Next.js versions ago. The App Router has changed enough that some patterns here may be stale. There is almost no actual code: no auth, no data modeling, no error handling, just a skeleton. Anyone using this as a starting point is doing 95% of the work themselves. No tests, no type-safe Firestore wrappers, no mention of security rules — someone will ship this to prod with open Firestore rules.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →