Skip to content

ishankgp/MF_return_tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ˆ Mutual Fund Returns Tracker

A modern web application to track and analyze mutual fund performance with real-time data fetching, beautiful UI, and automated daily updates.

Fund Performance Dashboard

✨ Features

  • Real-time Data Fetching: Automatically fetches latest NAV and returns data from mutual fund APIs
  • Clean Web Interface: Responsive UI built with Flask and modern web technologies
  • Smart Caching: Redis-backed caching with in-memory fallback for optimal performance
  • Advanced Filtering: Search and filter funds by name or category
  • Export Functionality: Download fund data as CSV for further analysis
  • Auto-refresh: Scheduled daily updates at 11 AM (configurable)
  • Performance Tracking: Track returns across multiple timeframes (1D, 1W, 1M, 3M, 6M, 1Y, 3Y, 5Y)

πŸš€ Quick Start

Prerequisites

  • Python 3.8+
  • Redis (optional, for caching)

One-Click Setup & Run

Simply double-click the startup script:

start.bat: Checks dependencies and starts the Flask server

Or run from command line:

.\start.bat

This will:

  • Create virtual environment (if needed)
  • Install Python dependencies
  • Start the Flask server at http://localhost:5000
  • Automatically open your browser

πŸ“¦ Manual Installation

Backend Setup

  1. Create virtual environment:
python -m venv venv
venv\Scripts\activate  # On Windows
  1. Install dependencies:
pip install -r requirements.txt
  1. Run Flask server:
python app.py

The application will be available at http://localhost:5000

πŸ“ Project Structure

mutual_funds/
β”œβ”€β”€ app.py                    # Flask backend server
β”œβ”€β”€ fetch_mf_returns.py       # Data fetching logic
β”œβ”€β”€ config.py                 # Configuration settings
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ start.bat                 # One-click launcher
β”œβ”€β”€ templates/                # Flask HTML templates
β”œβ”€β”€ static/                   # Static assets (CSS, JS)
└── logs/                     # Application logs

πŸ”§ Configuration

Adding/Modifying Funds

Edit the funds list in fetch_mf_returns.py:

funds = [
    {"name": "Fund Name", "code": "FUND_CODE"},
    # Add more funds here
]

Setting up Daily Auto-refresh (11 AM)

Windows Task Scheduler

  1. Open Task Scheduler
  2. Create Basic Task
  3. Set trigger: Daily at 11:00 AM
  4. Set action: Start start.bat (full path: D:\Github clones\mutual_funds\start.bat)
  5. Enable "Run whether user is logged on or not"
  6. Set "Start in" directory to: D:\Github clones\mutual_funds

Or use PowerShell to create scheduled task:

$action = New-ScheduledTaskAction -Execute "D:\Github clones\mutual_funds\start.bat" -WorkingDirectory "D:\Github clones\mutual_funds"
$trigger = New-ScheduledTaskTrigger -Daily -At 11:00AM
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
Register-ScheduledTask -TaskName "MutualFundTracker" -Action $action -Trigger $trigger -Settings $settings -Description "Daily mutual fund data refresh at 11 AM"

πŸ” API Endpoints

  • GET / - Main dashboard (web UI)
  • GET /api/funds - Get all fund data (JSON)
  • POST /api/refresh - Force data refresh
  • GET /health - Health check endpoint

πŸ’‘ Usage Tips

  1. Quick Search: Use the search bar to find specific funds instantly
  2. Category Filter: Filter by Large Cap, Mid Cap, Small Cap, Liquid, or Debt funds
  3. Sort Columns: Click any column header to sort by that metric
  4. Export Data: Click the download button to export current view as CSV
  5. View Details: Click any fund row to see detailed performance metrics

πŸ› οΈ Troubleshooting

Server won't start

  • Ensure Python 3.8+ is installed: python --version
  • Check if port 5000 is free: netstat -an | findstr :5000
  • Verify all dependencies: pip install -r requirements.txt

Data not updating

  • Check internet connection
  • Verify mutual fund API is accessible
  • Clear Redis cache (if using): redis-cli FLUSHALL
  • Check logs in logs/app.log

πŸ” Environment Variables

Create a .env file for custom configuration:

FLASK_ENV=development
REDIS_URL=redis://localhost:6379
LOG_LEVEL=INFO

πŸ“Š Performance

  • Caching: 10-minute TTL for fund data
  • Async fetching: Parallel API calls for faster data retrieval
  • Optimized rendering: Efficient data handling for large datasets

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

This project is open source and available under the MIT License.

πŸ™ Acknowledgments

  • Built with Flask and modern web technologies
  • Uses public mutual fund APIs for data
  • Redis for high-performance caching

Note: This application is for educational and personal use. Always verify financial data from official sources before making investment decisions.

About

Mutual fund intelligence tracker with async ingestion, scoring experiments, and dashboard analytics

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors