Rebuilding Pocket Portfolio: Next.js 14 + Firebase + Edge

posted 2 min read

Rebuilding Pocket Portfolio: Next.js 14 + Firebase + Edge

(The practical bits that made “never 0.00” possible)

Pocket Portfolio’s Beta just levelled up — rebuilt for speed, reliability, and developer joy.


Why Rebuild

Goal: make “never 0.00” pricing and fast dashboards boringly reliable.
The MVP served its purpose — now it’s about consistency at scale and developer ergonomics.


What Changed

1. Edge Route Handlers (Quotes + Health)

  • Runs close to the user (avg TTFB ~250 ms)
  • Regional caching with intelligent revalidation
  • No full cold starts under burst traffic

2. React Server Components (RSC)

  • Dashboard loads lean: minimal JS, fewer waterfalls
  • Streaming partial updates for faster perceived speed

3. Firebase v10 (Auth + DB)

  • Unified Auth and Firestore via modular SDK
  • Cloud Functions only where stateful
  • Simplified local emulation with .env.test parity

Results

Metric Old (MVP) New (Beta) Improvement
TTFB (EU) 610 ms 420 ms 31 % faster
Quote p95 820 ms <450 ms 45 % faster
Cold starts (health) Frequent Near-zero Eliminated
Dashboard JS bundle 312 KB 190 KB 39 % smaller

Guardrails

  • Canary flag for staged rollouts per region
  • Smoke endpoints for uptime checks
  • In-UI health badges for trust visibility

Try It

git clone https://github.com/pocket-portfolio/app
cd app
pnpm install
pnpm dev
````

Then test locally:

```bash
curl http://localhost:3000/api/health-price

Open your browser at http://localhost:3000 — you’ll see the RAG widget live.


Architecture Snapshot

User → Edge Route Handler → Regional Cache → Firebase (Auth + Firestore)
       → Cloud Functions (stateful logic) → Data Providers (Yahoo, IEX, AlphaVantage)

Open to PRs

Help polish the beta — these are top of backlog:

  • Edge error taxonomy (better retries and logs)
  • Redis TTL tuning for quotes and health
  • Test seeds for new providers
  • Improved CI performance dashboards

Fork, branch from dev/beta, and open a PR with feat: or fix: prefix.
We’ll review, benchmark, and deploy.


Join the Conversation


TL;DR

Edge + Firebase + RSC = reliable dashboards.
Pocket Portfolio Beta is now fast enough to disappear — and that’s the point.

1 Comment

1 vote

More Posts

Comparison: Universal Import vs. Plaid/Yodlee

Pocket Portfolio - Mar 12

How I Built a React Portfolio in 7 Days That Landed ₹1.2L in Freelance Work

Dharanidharan - Feb 9

The Interface of Uncertainty: Designing Human-in-the-Loop

Pocket Portfolio - Mar 10

The Future of Finance is Client-Side AI

Pocket Portfolio - Mar 24

Beyond Finance: Use Cases for Client-Side ETL

Pocket Portfolio - Mar 19
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!