This version addresses the 6 problems identified:
- 6-Question Onboarding β Comprehensive behavioral profiling
- Asset Selector Dropdown β Browse Stocks, ETFs, and Mutual Funds with subcategories
- Conversational Chatbot β Penny is now portfolio-aware and chats naturally
- Investment Analysis β Every investment shows verdict (Excellent/Good/Caution etc.) for YOU
- Smart Rebalancing β Tells you WHY, WHERE, and HOW MUCH with specific actions
- Always-On Recommendations β Even with no portfolio, you get starter pack recommendations
# 1. Navigate to backend folder
cd backend
# 2. Install dependencies
pip install -r requirements.txt
# 3. Create .env file (copy from .env.example)
# Edit it and add your Claude API key:
# ANTHROPIC_API_KEY=sk-ant-your-key-here
# SECRET_KEY=any-random-string-here
# 4. Start backend (will run on http://127.0.0.1:8000)
python -m uvicorn main:app --reload# 1. Navigate to frontend folder
cd frontend
# 2. Install dependencies
npm install
# 3. Start frontend (will run on http://localhost:5173)
npm run dev- Open
http://localhost:5173 - Click "Create one" to register
- Complete the 6-question onboarding β Penny will analyze your profile
- Explore: Dashboard, Portfolio, Recommendations, Smart Actions, Ask Penny
penny-app/
βββ backend/
β βββ main.py # FastAPI entry point
β βββ database.py # SQLite + enhanced profile schema
β βββ claude_service.py # AI services (chat, analysis, profiling)
β βββ market_data.py # yfinance + asset universe
β βββ recommendation_engine.py # Always-on recommendations
β βββ scoring.py # Portfolio analytics & health scoring
β βββ seed_data.json # Stocks/ETFs/Mutual Funds catalog
β βββ requirements.txt
β βββ .env.example
β βββ routers/
β βββ auth.py # JWT auth
β βββ profile.py # 6-Q onboarding
β βββ portfolio.py # Holdings management
β βββ market.py # Asset browsing/search
β βββ chat.py # Conversational chatbot
β βββ actions.py # Smart actions (rebalance, panic, etc.)
β βββ recommendations.py # Always-on recs
βββ frontend/
βββ package.json
βββ vite.config.js
βββ tailwind.config.js
βββ postcss.config.js
βββ index.html
βββ src/
βββ main.jsx
βββ App.jsx # Routing with onboarding gate
βββ api.js # All API endpoints
βββ index.css # Tailwind + animations
βββ pages/
β βββ Auth.jsx # Login/register
β βββ Onboarding.jsx # 6-question flow
β βββ Dashboard.jsx # Hero + health + always-on recs
β βββ Portfolio.jsx # Holdings + asset selector + analysis
β βββ Recommendations.jsx # Always-on with filters
β βββ SmartActions.jsx # Rebalance (Why/Where/How), Overlap, Panic, Life, Hype
β βββ Chat.jsx # Conversational AI
βββ components/
βββ layout/Header.jsx
βββ investment/
β βββ AssetSelector.jsx # Dropdown with subcategories
β βββ InvestmentAnalysis.jsx # Good/Bad verdict
βββ portfolio/
β βββ HealthScore.jsx
β βββ AllocationPie.jsx
β βββ PortfolioMap.jsx
βββ recommendations/RecommendationCard.jsx
βββ insights/
β βββ ConcentrationWarning.jsx
β βββ DiversificationGap.jsx
βββ shared/
βββ Card.jsx
βββ Badge.jsx
βββ Button.jsx
6 questions analyze: Goal, timeline, risk tolerance (via 20% drop scenario), monthly investment, experience, age. Claude generates: behavioral type, custom allocation, recommended core holdings, watch-outs, and action steps.
Three tabs: Stocks (by sector), ETFs (by category), Mutual Funds (by category). Subcategory pills filter further. Search anytime. Click any asset β AI analyzes if it fits YOU.
Every investment gets analyzed against your profile:
- Excellent Fit / Good Fit / Decent Fit / Caution / Not Recommended
- Fit Score (0-100)
- Pros/Cons specific to your situation
- Suggested allocation %
- Behavioral note
- Alternative suggestions
Penny knows your profile and holdings. Talks naturally. Uses your name when relevant. Suggests specific tickers. References past conversation. Maintains 12-message context.
Three sections:
- WHY β Headline + explanation + risk if not done
- WHERE & HOW MUCH β Specific BUY/SELL actions with dollar amounts
- IMPACT β Before/after, tax considerations, fee impact
- Plus timing recommendation and behavioral advice
- Empty portfolio β starter pack (VTI, BND, VEA, target date fund)
- Concentration risk β diversifiers
- Missing bonds β bond ETFs (when appropriate to risk)
- Sector concentration β cross-sector ETFs
- Always at least 3 recommendations
Create backend/.env:
ANTHROPIC_API_KEY=sk-ant-your-key-here
SECRET_KEY=any-long-random-string
"ANTHROPIC_API_KEY not set": Make sure .env is in the backend/ folder (not the project root)
bcrypt error: pip install bcrypt==4.0.1 passlib[bcrypt]
npm dev not found: Make sure you ran npm install first
CORS error: Backend must be on port 8000, frontend on 5173
- Backend: FastAPI, SQLite, Anthropic Claude (Sonnet), yfinance, JWT
- Frontend: React 18, Vite, Tailwind CSS, Recharts, Axios, React Router
- AI: Claude Sonnet 4 for profiling, chat, analysis, and rebalancing
Biult by Pratyaksh Singh