Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Penny β€” Your AI Investing Companion 🌱

This version addresses the 6 problems identified:

  1. 6-Question Onboarding β€” Comprehensive behavioral profiling
  2. Asset Selector Dropdown β€” Browse Stocks, ETFs, and Mutual Funds with subcategories
  3. Conversational Chatbot β€” Penny is now portfolio-aware and chats naturally
  4. Investment Analysis β€” Every investment shows verdict (Excellent/Good/Caution etc.) for YOU
  5. Smart Rebalancing β€” Tells you WHY, WHERE, and HOW MUCH with specific actions
  6. Always-On Recommendations β€” Even with no portfolio, you get starter pack recommendations

πŸš€ Quick Start (Windows PowerShell)

Backend Setup

# 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

Frontend Setup (in a NEW terminal)

# 1. Navigate to frontend folder
cd frontend

# 2. Install dependencies
npm install

# 3. Start frontend (will run on http://localhost:5173)
npm run dev

First Run

  1. Open http://localhost:5173
  2. Click "Create one" to register
  3. Complete the 6-question onboarding β€” Penny will analyze your profile
  4. Explore: Dashboard, Portfolio, Recommendations, Smart Actions, Ask Penny

πŸ“ Project Structure

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

πŸ’‘ Key Features

1. Goldman-Grade Onboarding

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.

2. Smart Asset Browser

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.

3. Investment Verdict

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

4. Conversational Chatbot

Penny knows your profile and holdings. Talks naturally. Uses your name when relevant. Suggests specific tickers. References past conversation. Maintains 12-message context.

5. Smart Rebalancing

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

6. Always-On Recommendations

  • 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

πŸ”‘ Environment Variables

Create backend/.env:

ANTHROPIC_API_KEY=sk-ant-your-key-here
SECRET_KEY=any-long-random-string

πŸ› Troubleshooting

"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


πŸŽ“ Tech Stack

  • 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

About

A full-stack wealth management web app that gives everyday investors Goldman Sachs-level portfolio guidance, powered by Claude API and live market data.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages