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.