Skip to content

Siddhantaternos/SENRA-Expense-Tracker

Repository files navigation

⚡ SENRA

Personal Finance & Stock Intelligence Platform

FastAPI Python Groq yFinance License

Track expenses · Analyze stocks · AI-powered insights · Real-time Indian markets

FeaturesScreenshotsTech StackSetupAPI Docs


🔥 What is SENRA?

SENRA is a full-stack personal finance and stock analysis platform built for the Indian market. It combines real-time NSE stock data, AI-powered financial insights via Groq's LLaMA 3.1, and a clean dark-mode dashboard — all in a single-file frontend with a FastAPI backend.

Built by Siddhant Deshmane —> because every finance app either costs money or looks like it was made in 2009.


✨ Features

💰 Personal Finance

  • Track income and expenses with categories and notes
  • Monthly breakdown —> earned, spent, saved, invested
  • Import from files —> CSV/Excel bank statements auto-parsed (HDFC, ICICI, SBI, Axis, Zerodha, Groww)
  • Category auto-detection —> Swiggy → Food, Uber → Transport, Netflix → Entertainment

📈 Stock Intelligence

  • Real-time Indian market data via NSE (nsetools) during market hours
  • Candlestick & line charts with 7 intervals —> 1m, 5m, 15m, 1H, 1D, 1W, 1M
  • Scrolling ticker band —> live prices for top Indian/global stocks
  • Scorecard —> Performance, Valuation, Growth, Profitability, Entry Point, Red Flags
  • Key metrics —> PE, PB, ROE, Revenue Growth, Beta, D/E Ratio, Dividend Yield
  • Shareholding pattern —> interactive doughnut pie (Promoter, Foreign, Mutual Funds, Retail)
  • Latest news —> stock-specific news feed with clickable links
  • AI signal —> BUY / SELL / HOLD with entry price and risk level

🤖 AI Agent (SENRA)

  • Natural language finance tracking —> "spent 500 on food", "got salary 50000", "bought 10 AAPL at 250"
  • Powered by Groq's LLaMA 3.1 8B Instant —> ultra-fast responses
  • 5 tools: add expense, add income, add stock, get summary, get breakdown
  • Stock agent with ticker context —> ask anything about the stock you're viewing
  • Max 3-line replies, straight to the point

🔐 Auth & Settings

  • JWT authentication with 30-day token expiry
  • Register with country → auto-sets currency (India → ₹ INR)
  • Settings modal —> change profile, password, country/currency
  • Dark/Light mode toggle
  • Download reports -> CSV export for expenses, income, portfolio, monthly summary

🌍 Multi-Currency

  • Auto exchange rate from fawazahmed0/currency-api
  • Indian stocks display in ₹ directly (no double conversion)
  • USD stocks convert to user's currency

🛠 Tech Stack

Layer Technology
Backend Python 3.12, FastAPI, SQLAlchemy, SQLite
AI Groq API — LLaMA 3.1 8B Instant
Stock Data yFinance, nsetools (NSE live)
Auth JWT (python-jose), bcrypt (passlib)
Charts lightweight-charts v4.1.1 (TradingView), Chart.js v4.4
Frontend Vanilla HTML/CSS/JS — single file SPA
Currency fawazahmed0/currency-api
File Import pandas, openpyxl

🚀 Setup

Prerequisites

1. Clone the repo

git clone https://github.com/Siddhantaternos/SENRA-Expense-Tracker.git
cd SENRA-Expense-Tracker

2. Create virtual environment

python -m venv venv

# Windows
venv\Scripts\activate

# Mac/Linux
source venv/bin/activate

3. Install dependencies

pip install fastapi uvicorn sqlalchemy "python-jose[cryptography]" "passlib[bcrypt]==4.0.1" python-multipart groq yfinance nsetools pandas openpyxl python-dotenv pytz

4. Create .env file

GROQ_API_KEY=your_groq_api_key_here
SECRET_KEY=your-secret-key-change-in-production

5. Run the server

uvicorn app.main:app --reload --port 8080

6. Open the app

Open Frontend.html directly in your browser no build step needed.


📁 Project Structure

SENRA/
├── app/
│   ├── main.py              # FastAPI app, all routers registered
│   ├── database.py          # SQLAlchemy + SQLite connection
│   ├── models.py            # User, Expense, Income, Portfolio tables
│   ├── schemas.py           # Pydantic schemas
│   └── routers/
│       ├── auth.py          # JWT login/register, profile, change-password
│       ├── expenses.py      # CRUD + monthly/category summary
│       ├── income.py        # CRUD + source summary
│       ├── portfolio.py     # Stock holdings + live P&L
│       ├── stocks.py        # Search, chart, analysis, scorecard, news
│       ├── nse_live.py      # Real-time NSE data via nsetools
│       ├── import_data.py   # CSV/Excel bank statement parser
│       ├── dashboard.py     # Overview endpoint
│       ├── agent.py         # Groq AI agent with 5 tools
│       └── insights.py      # AI expense insights
├── Frontend.html            # Single-file SPA (no build needed)
├── expenses.db              # SQLite database (auto-created)
├── .env                     # API keys (not committed)
└── README.md

📡 API Docs

Once running, visit: http://localhost:8080/docs

Method Endpoint Description
POST /auth/register Register new user
POST /auth/login Login, returns JWT
GET /auth/me Get current user
PUT /auth/profile Update profile/country
POST /auth/change-password Change password
GET /stocks/{ticker} Stock info + live price
GET /stocks/{ticker}/chart OHLCV candles (7 intervals)
GET /stocks/{ticker}/analysis Scorecard, signal, holders, news
GET /stocks/{ticker}/price Live price (NSE for Indian stocks)
GET /stocks/search Autocomplete by country
GET /nse/quote/{symbol} Real-time NSE quote
GET /nse/gainers Top NSE gainers
POST /agent/chat AI agent chat
POST /import/preview Preview file import
POST /import/confirm Confirm and save import
GET /dashboard/overview Full financial overview

🗺 Roadmap

  • JWT Authentication
  • Expense & Income tracking
  • Stock search with autocomplete
  • Live candlestick charts (7 intervals)
  • AI agent (Groq LLaMA 3.1)
  • NSE real-time data
  • Shareholding pattern pie chart
  • Stock news feed
  • CSV/Excel import
  • Settings modal (profile, password, theme)
  • Report download (CSV)
  • TradingView widget integration
  • Price alerts / push notifications
  • Budget goals per category
  • Global real-time data (Polygon.io)
  • Mobile app

⚠️ Disclaimer

SENRA is for personal finance tracking and educational purposes only. Stock signals (BUY/SELL/HOLD) are generated by AI and should not be treated as financial advice. Always do your own research before investing.


📄 License

MIT License use it, fork it, build on it.


Built with ❤️ by Siddhant Deshmane

Star this repo if SENRA helped you track your money better

github.com/Siddhantaternos/SENRA-Expense-Tracker

About

SENRA is a full-stack personal finance and stock analysis platform built for the Indian market. It combines real-time NSE stock data, AI-powered financial insights via Groq's LLaMA 3.1, and a clean dark-mode dashboard all in a single-file frontend with a FastAPI backend.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors