AI-driven US tech company earnings analysis platform with Chinese summaries.
Production: https://earnlytics-ebon.vercel.app
Last Updated: 2026-02-27
| Phase | Status | Completion | Key Achievements |
|---|---|---|---|
| Plan 1: MVP | ✅ Complete | 100% | 10 pages, Vercel deployed |
| Plan 2: AI Automation | ✅ Complete | 100% | DeepSeek AI, 23 earnings analyzed, GitHub Actions |
| Plan 3: Scale | ✅ Complete | 100% | 30 companies, 109 earnings, 100% AI coverage, email subscription |
| RAG AI Assistant | ✅ Complete | 100% | Vector search, multi-turn dialogue, dynamic suggestions |
| Portfolio Optimization | ✅ Complete | 100% | Real-time prices, glassmorphism design, auto-refresh |
- Companies: 30 (Tier 1/2/3) - scripts support tier2/tier3 insertion
- Earnings: 109 records - scripts for backfilling and seeding
- AI Analyses: 100% coverage - analyze-batch.ts script available
- Document Embeddings: Vector data populated - 1024-dim Cohere embeddings
- Chat Conversations: Ready for AI assistant - multi-turn dialogue support
- Subscribers: Ready (API + UI complete) - send-digests.ts script exists
earnlytics/
├── AGENTS.md # AI assistant knowledge base (updated 2026-02-11)
├── README.md # This file
├── .gitignore # Root gitignore (minimal)
├── doc/ # Chinese documentation
│ ├── 计划/ # Execution plans (Plan 1-5)
│ ├── 策略/ # Strategy docs
│ ├── 技术/ # Technical docs
│ └── 项目状态报告-20260210.md # Current status report
├── earnlytics-web/ # Next.js 16 frontend ⬅️ Main codebase
│ ├── src/
│ │ ├── app/ # App Router pages
│ │ │ ├── earnings/[symbol]/ # Dynamic route for earnings
│ │ │ ├── companies/ # Company list page
│ │ │ ├── calendar/ # Earnings calendar
│ │ │ ├── assistant/ # AI assistant (RAG chat) ✨
│ │ │ ├── portfolio/ # Portfolio management
│ │ │ ├── privacy/ # Privacy policy
│ │ │ ├── terms/ # Terms of service
│ │ │ └── api/ # API routes
│ │ ├── components/
│ │ │ ├── ui/ # shadcn/ui primitives
│ │ │ ├── icons/ # SVG icon library (replaced all emoji)
│ │ │ └── layout/ # Header, Footer
│ │ └── lib/ # Utilities (ai.ts, supabase.ts)
│ ├── scripts/ # 24 data scripts
│ │ ├── fetch-earnings.ts
│ │ ├── analyze-batch.ts
│ │ ├── generate-embeddings.ts # Vector generation ✨
│ │ ├── backfill-tier2.ts
│ │ └── send-digests.ts
│ └── supabase/migrations/ # Database schema
└── pencil-earnlytics.pen # Design file (13 pages)
# Frontend development
cd earnlytics-web && npm run dev # Start dev server (localhost:3000)
# Data Operations
npm run fetch:earnings # Fetch latest earnings from FMP
npm run analyze:batch # Generate AI analysis (batch of 5)
npm run generate:embeddings # Generate vector embeddings for RAG
# Build & Deploy
npm run build # Production build
npm run lint # Lint check| Layer | Technology | Version |
|---|---|---|
| Frontend | Next.js | 16.1.6 |
| Frontend | React | 19.2.3 |
| Frontend | TypeScript | 5 |
| Styling | Tailwind CSS | 4 |
| UI Components | shadcn/ui | Latest |
| Icons | Lucide React + Custom SVG | Latest |
| Path alias | @/* → ./src/* |
- |
- Hosting: Vercel Serverless
- Database: Supabase PostgreSQL + pgvector
- AI Service: DeepSeek API (¥0.002/1K tokens)
- Embedding: Cohere Embedding API (1024-dim, free tier)
- Data Source: Financial Modeling Prep (FMP) API + SEC EDGAR
- Automation: GitHub Actions (every 4 hours)
/homenow uses server-side prefetch + cache (revalidate=300) to reduce client waterfall.- Added dynamic imports and viewport-triggered rendering for below-the-fold sections.
HeroStatscounters start only when entering viewport.MarketTickeranimation pauses when tab hidden/offscreen to reduce CPU usage.EarningsCardoptimized withmemo+ memoized sparkline generation./api/market-tickernow supports in-memory short cache +ETag/304.- Added Web Vitals collection pipeline:
- client reporter:
src/components/performance/WebVitalsReporter.tsx - API endpoint:
src/app/api/web-vitals/route.ts(POST ingest + GET summary)
- client reporter:
- Added image optimization helper
src/lib/image-optimization.tsto avoid unnecessaryunoptimized.
- Legacy root doc
earnlytics-web-architecture.mdhas been removed. - Use
for_AGENTS/AGENTS.mdandfor_AGENTS/规范文档/*as the canonical architecture and implementation references.
| Phase | Timeline | Goal | Status | Evidence in Code |
|---|---|---|---|---|
| Plan 1: MVP | Week 1-2 | 10 pages, 10 companies | ✅ Complete | 10+ pages in app/, shadcn/ui components |
| Plan 2: AI Automation | Week 3-4 | AI analysis, automation | ✅ Complete | ai.ts, analyze-batch.ts, GitHub Actions |
| Plan 3: Scale | Month 2 | 30 companies, 109 earnings | ✅ Complete | tier2/tier3 scripts, backfill scripts |
| RAG AI Assistant | Week 5-6 | Vector search, AI chat | ✅ Complete | /assistant page, Cohere embeddings, RAG pipeline |
| Portfolio Optimization | Week 6-7 | Real-time prices, UI upgrade | ✅ Complete | 15-min refresh, glassmorphism design |
| Plan 4: Growth | Month 3 | SEO, traffic growth | 📋 Planned | - |
| Plan 5: Commercialization | Month 4-6 | Monetization | 📋 Planned | - |
| Phase | Monthly Cost | Main Expense | Actual (Based on Code) |
|---|---|---|---|
| MVP | ¥0 | Free tier | ✅ ¥0 (Vercel, Supabase free) |
| Automation | ¥1-2 | DeepSeek API | ✅ ¥0.2-1 (batch processing) |
| Scale | ¥10-20 | Potential DB upgrade | 🚀 ¥0.2-1 (still on free tiers) |
Current Monthly Cost: ~¥0.2-1 (extremely low, all free tiers)
Changed from: /earnings?symbol=aapl (query params)
Changed to: /earnings/aapl (dynamic route)
Evidence: src/app/earnings/[symbol]/page.tsx exists
Reason: Next.js 15+ params are Promises, simpler to use dynamic segments
All emoji replaced with SVG components
Evidence: src/components/icons/index.tsx exists with custom icons
Benefits: Consistent styling, better performance, no platform differences
Approach: Process 5 earnings at a time
Evidence: scripts/analyze-batch.ts with batch logic
Reason: Control API costs, manageable execution time
| Path | Content | Status |
|---|---|---|
doc/计划/ |
Execution plans (Plan 1-5) | ✅ Complete |
doc/策略/ |
Strategy documents | ✅ Complete |
doc/技术/ |
Technical documentation | ✅ Complete |
doc/项目状态报告-20260210.md |
Current status report | ✅ Updated |
- ❌ Run
create-next-appin root directory (creates duplicate config) - ❌ Add API keys to git (use environment variables)
- ❌ Use
as any,@ts-ignore,@ts-expect-error - ❌ Add
.gitignorerules that overlap withearnlytics-web/.gitignore - ❌ Commit
.env.localor files containing secrets
- ✅ Use SVG icons from
src/components/icons/ - ✅ Follow shadcn/ui patterns for components
- ✅ Update progress documents when completing tasks
- ✅ Use dynamic routes for parameterized pages
- ✅ Test build before committing
| Issue | Solution | Evidence |
|---|---|---|
| useSearchParams returns null | Use dynamic route [symbol] instead |
earnings/[symbol]/page.tsx |
| params is Promise in Next.js 15 | Use React.use() to unwrap |
earnings/[symbol]/page.tsx |
| Environment variables in scripts | Use dotenv to load .env.local |
scripts/*.ts with config() |
| API keys leaked to git | 1) Delete file, 2) Rotate keys, 3) Add to .gitignore |
Already fixed |
- Project uses DOVE VPN proxy (HTTP 7897) for GitHub access
- Doc folder uses Chinese naming conventions (计划, 技术, ���略)
- Root
.gitignoreis minimal; full rules inearnlytics-web/.gitignore - Monthly AI cost: ~¥0.2-1 (extremely low cost, batch processing)
- All API keys must be rotated if accidentally committed
- Dynamic routes use
[symbol]format, accessed viaReact.use(params)in Next.js 15 - 23 data scripts available for various operations
- ✅ Complete Frontend: 10+ pages with dynamic routing
- ✅ AI Integration: DeepSeek API with batch processing
- ✅ RAG AI Assistant: Vector search with Cohere embeddings, multi-turn dialogue
- ✅ Data Pipeline: 24 scripts for data fetching, analysis, and embeddings
- ✅ Database Schema: Supabase migrations with pgvector support
- ✅ UI System: shadcn/ui + custom SVG icons + glassmorphism design
- ✅ Automation: GitHub Actions for scheduled tasks
- ✅ Scalability: Support for 30 companies across 3 tiers
- ✅ Real-time Portfolio: 15-min price refresh with auto-update
Production: https://earnlytics-ebon.vercel.app
GitHub: https://github.com/Timcai06/Earnlytics
Branch: main
Last Updated: 2026-02-27