Tech-driven investment research platform combining institutional-grade analysis with cutting-edge AI technology.
Kirboreo Limited is a Hong Kong-based investment research firm dedicated to decoding the complex world of global technology equities. This platform delivers hedge-fund-grade insights with engineering precision through an AI-powered research interface.
- π€ AI Chat Interface: RAG-powered conversational AI using GPT-4o and Pinecone vector database
- π Real-Time Stock Analysis: Live market data and technical analysis for US tech stocks
- π Research Library: Curated equity research powered by Sanity CMS
- π Interactive Charts: Multi-timeframe stock visualizations with Recharts
- π¨ Modern UI: Glass-morphism design with 3D backgrounds using Three.js
- Next.js 15 (App Router) - React framework with server components
- TypeScript - Type-safe development
- React 19 - Latest React features
- OpenAI GPT-4o - Chat completion and reasoning
- OpenAI Embeddings (
text-embedding-3-small) - Semantic search - Pinecone - Vector database for RAG (index:
knowledge) - Vercel AI SDK - Streaming responses and tool integration
- Sanity.io - Headless CMS for research content
- Yahoo Finance (
yahoo-finance2) - Real-time market data
- CSS Modules + Tailwind CSS - Styling
- Recharts - Stock charts and data visualization
- React Three Fiber - 3D backgrounds and effects
- Lucide React - Icon library
Kirboreo/
βββ app/ # Next.js App Router
β βββ api/
β β βββ chat/
β β βββ route.ts # RAG-powered chat API endpoint
β βββ chat/
β β βββ page.tsx # Chat interface
β βββ analysis/
β β βββ [ticker]/ # Dynamic stock analysis pages
β βββ research/
β β βββ [slug]/ # Research article pages
β βββ about/ # About page
β βββ studio/ # Embedded Sanity Studio
β βββ layout.tsx # Root layout
β βββ page.tsx # Homepage
β
βββ components/ # React components
β βββ ChatWidget.tsx # Floating chat component
β βββ StockAnalysis.tsx # Stock chart & metrics
β βββ Hero.tsx # Landing hero section
β βββ Navbar.tsx # Navigation
β βββ FeaturedReports.tsx # Latest research
β βββ Background3D.tsx # Three.js background
β βββ ui/ # Reusable UI components
β
βββ lib/ # Core utilities
β βββ vector-store.ts # Pinecone integration
β βββ yahoo.ts # Stock data fetching
β βββ utils.ts # Helper functions
β
βββ sanity/ # Sanity CMS configuration
β βββ schemaTypes/ # Content models
β β βββ postType.ts # Research articles
β β βββ stockAnalysisType.ts
β β βββ ...
β βββ lib/
β βββ client.ts # Sanity client
β βββ queries.ts # GROQ queries
β
βββ scripts/ # Utility scripts
β βββ index-sanity-data.ts # Sync content to Pinecone
β
βββ __tests__/ # Test suites
β βββ api/
β βββ components/
β βββ lib/
β
βββ public/ # Static assets
- Node.js 18+ and npm
- OpenAI API key
- Pinecone account (free tier works)
- Sanity.io project
git clone https://github.com/YOUR_USERNAME/Kirboreo.git
cd Kirboreonpm installCreate a .env.local file in the root directory:
# OpenAI
OPENAI_API_KEY=sk-...
# Pinecone
PINECONE_API_KEY=pcsk_...
PINECONE_INDEX_NAME=knowledge
# Sanity CMS
NEXT_PUBLIC_SANITY_PROJECT_ID=your-project-id
NEXT_PUBLIC_SANITY_DATASET=production
SANITY_API_TOKEN=sk...Ensure your Pinecone index has:
- Dimension: 1536 (for
text-embedding-3-small) - Metric: Cosine similarity
- Region: Asia-Pacific (recommended for Hong Kong)
Index your Sanity content into Pinecone:
npm run index-data
# or manually:
npx tsx scripts/index-sanity-data.tsnpm run devOpen http://localhost:3000 in your browser.
Run the test suite:
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Watch mode
npm run test:watchTest structure:
__tests__/api/- API route tests__tests__/components/- Component unit tests__tests__/lib/- Utility function tests__tests__/integration/- End-to-end tests
This project uses React 19. The .npmrc configuration with legacy-peer-deps=true is already set up to avoid peer dependency conflicts.
- Push to GitHub:
git add .
git commit -m "Ready for production"
git push origin main- Import to Vercel:
- Visit vercel.com
- Click "Add New Project"
- Import your GitHub repository
- Configure environment variables (same as
.env.local) - Deploy!
Environment Variables to Configure:
OPENAI_API_KEY- OpenAI API keyPINECONE_API_KEY- Pinecone API keyPINECONE_INDEX_NAME- Pinecone index name (default:knowledge)NEXT_PUBLIC_SANITY_PROJECT_ID- Sanity project IDNEXT_PUBLIC_SANITY_DATASET- Sanity dataset (default:production)SANITY_API_TOKEN- Sanity API tokenRESEND_API_KEY- (Optional) Resend API key for contact form
- Region Configuration (Optional):
The
vercel.jsonfile is configured for Hong Kong, Singapore, and Seoul regions with optimized function settings:
- Function timeout: 60 seconds
- Memory: 1024MB
docker build -t kirboreo .
docker run -p 3000:3000 --env-file .env.local kirboreo- Verify homepage loads
- Test AI chat at
/chat - Check stock analysis pages
- Verify research articles load
- Test contact form (if RESEND_API_KEY configured)
- Monitor Vercel Analytics for performance
User Query
β
1. Embed query (OpenAI text-embedding-3-small)
β
2. Retrieve top-K contexts (Pinecone vector search)
β
3. Inject context into system prompt
β
4. Generate response (GPT-4o)
β
5. Stream response to client
Implementation: app/api/chat/route.ts
User selects ticker/timeframe
β
Server Action (app/actions/stock.ts)
β
Yahoo Finance API
β
Transform & cache
β
Render chart (Recharts)
| Source | Purpose | Update Frequency |
|---|---|---|
| Yahoo Finance | Stock prices, charts | Real-time |
| Sanity CMS | Research articles | Manual publish |
| Pinecone | Vector search context | Indexed on content update |
| OpenAI | Embeddings, chat | API call |
- Context-aware responses: Retrieves relevant research content before answering
- Streaming: Real-time response generation
- Graceful degradation: Falls back to general knowledge if no context found
- Multi-timeframe support: 1d, 5d, 1mo, 6mo, ytd, 1y, 5y
- Intraday data: 15-minute intervals for recent data
- Related research: Auto-links to relevant articles from Sanity
- Full-text search: Powered by Sanity's GROQ queries
- Category filtering: Tech sectors (AI, Cloud, SaaS, etc.)
- Rich content: Block content with code snippets, images, tables
- β API keys stored in environment variables only
- β Server-side API calls (no client-side key exposure)
- β Input validation and sanitization
- β Rate limiting on API routes (Vercel default)
- β HTTPS enforced in production
- Real-time alerts for stock movements
- User authentication and saved watchlists
- Advanced charting (technical indicators)
- Multi-language support (English, Chinese)
- Mobile app (React Native)
- Backtesting framework for strategies
This project is licensed under the MIT License. See LICENSE for details.
The platform includes experimental AI features in the /labs section:
Real-time sentiment analysis for stocks and cryptocurrencies powered by:
- Yahoo Finance: News and price data
- GPT-4o: AI-driven sentiment analysis with witty commentary
- Keyword Analysis: Per-headline sentiment indicators
Features:
- Dynamic background colors based on sentiment (Fear/Greed scale)
- Thermometer visualization (0-100 scale)
- Smart ticker resolution (company name β ticker symbol)
- News filtering for relevant headlines only
- 5-minute caching with rate limiting
Try it: Visit /labs/fomo-meter and enter a ticker (e.g., TSLA, BTC-USD, AAPL)
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with tests
- Ensure all tests pass:
npm test - Commit using Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation updatestest:- Test additionsrefactor:- Code refactoring
- Push to your branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript with explicit types
- Write tests for new features (aim for >80% coverage)
- Follow existing code style
- Add JSDoc comments for public APIs
- Ensure
npm run buildandnpm run lintpass
Kirboreo Limited
Central, Hong Kong
Email: contact@kirboreo.com
Website: kirboreo.com
- Next.js - The React framework
- Vercel - Deployment platform
- Pinecone - Vector database
- OpenAI - AI models
- Sanity.io - Headless CMS
- Yahoo Finance - Market data
Built with β€οΈ by Jingcheng Su
Where Silicon Valley Engineering Meets Wall Street Rigor