Skip to content

MyFi is a full-stack personal finance management web application that enables users to manage budgets, track assets, create price alerts, and view personalized investment portfolios. The platform supports both regular users and an admin user with role-based access control.

Notifications You must be signed in to change notification settings

arshitadewan7/MyFi

Repository files navigation

MyFi – Personal Finance Dashboard

MyFi is a full-stack personal finance management web application that enables users to manage budgets, track assets, create price alerts, and view personalized investment portfolios. The platform supports both regular users and an admin user with role-based access control.

  • MyFi is a personal finance web application designed for users to manage their finances with clarity, confidence and convenience. With comprehensive financial insights, combining real-time market data and other financial tracking features, the app brings together a clean, user-friendly interface to help users track expenses, monitor investments, and stay updated with relevant financial news and market movements - all in one place.

✨ Features

👤 For Users

  • Secure login/logout with session management
  • Interactive budget planner with visual charts
  • Asset tracking (e.g., stocks, crypto, savings)
  • Real-time price alerts via Alpha Vantage API
  • Auto-categorized portfolios (e.g., Stocks, Crypto)
  • Live market snapshot with financial data
  • Security alerts on failed login attempts

🛡️ For Admins

  • View, add, delete, and manage registered users
  • Enforce role-based access (admin vs user)
  • Admin-only access protected by middleware

Tech Stack

Layer Technology
Frontend HTML5, CSS3, JavaScript, Chart.js
Backend Node.js, Express.js
Database MySQL
API Alpha Vantage API
Session Mgmt express-session

Project Structure

MyFi/
├── config/                
│   └── db.js                          # MySQL database connection
│
├── middleware/             
│   └── isAdmin.js                    # Middleware to restrict admin-only routes
│
├── public/                          # Static assets and frontend HTML pages
│   ├── images/                      # App icons, UI assets
│   ├── javascripts/                 # Client-side JS
│   ├── stylesheets/                 # CSS files
│   ├── uploads/                     # Uploaded profile pictures or files
│   ├── admin.html                   # Admin dashboard UI
│   ├── assets.html                  # User asset tracker UI
│   ├── budget.html                  # Budget planner UI
│   ├── dashboard.html               # Main user dashboard
│   ├── login.html                   # Login page
│   ├── portfolios.html              # Investment portfolio UI
│   ├── profile.html                 # User profile page
│   └── register.html                # Registration page
│
├── routes/                          # Express route handlers
│   ├── admin.js
│   ├── alerts.js
│   ├── assets.js
│   ├── budget.js
│   ├── index.js
│   ├── marketData.js
│   ├── portfolios.js
│   ├── profile.js
│   └── users.js
│
├── utils/                           # Reusable utilities
│   ├── cache.js                     # Market data caching
│   └── checkAlerts.js              # Background price alert checker
│
├── mysql/                           # SQL schema and seed files
│   └── MyFiDB_dump.sql
│
├── .gitignore                       # Files/directories to ignore in Git
├── package.json                     # NPM package metadata
├── package-lock.json                # NPM dependency lock
├── README.md                        # Project documentation
├── server.js                        # App startup and route mounting
└── app.js                           # Express app configuration

Setup Instructions

✅ Prerequisites

  • Node.js (v18+)
  • MySQL server
  • Git

🔧 Installation

  1. Clone the repo

    git clone https://github.com/yourusername/myfi.git
    cd myfi
  2. Install dependencies

    npm install
  3. Create .env file Create a .env file in the root directory with the following content:

    DB_HOST=localhost
    DB_USER=root
    DB_PASSWORD=your_mysql_password
    DB_NAME=MyFiDB
    ALPHA_VANTAGE_KEY=your_api_key_here
    
  4. Import database schema Run the following in your terminal to import the database schema:

    mysql -u root -p MyFiDB < MyFiDB_dump.sql
  5. Start the server

    node server.js

Dependencies

Package Purpose
axios Makes HTTP requests (e.g., to Alpha Vantage API)
bcrypt Password hashing (stronger, native module — consider using in production)
cookie-parser Parses cookies attached to client requests
cors Enables Cross-Origin Resource Sharing
debug Lightweight debugging utility
dotenv Loads environment variables from .env file
express Web application framework
express-session Session management middleware
morgan HTTP request logger middleware
multer Middleware for handling multipart/form-data (e.g., file uploads)
mysql2 MySQL database driver with promise support
node-cron Scheduler for running background jobs (e.g., checking alerts)
uuid Generates unique identifiers (e.g., for user IDs, tokens)

Install All Dependencies

npm install axios bcrypt cookie-parser cors debug dotenv express express-session morgan multer mysql2 node-cron uuid

Security Measures

  • ✅ Input validation on both client and server sides
  • ✅ Session-based authentication
  • ✅ Role-based access control (admin vs user)
  • ✅ Password hashing (recommended for production)
  • ✅ Alerts for suspicious activity (e.g., failed logins)
  • ✅ Protection against SQL Injection and XSS

Admin Role Setup

To make a user an admin, run the following SQL command:

UPDATE Users SET Role = 'admin' WHERE Email = 'admin@example.com';

Known Bugs or Limitations

  • API calls are dependent on Alpha Vantage free tier limits

🌱 Future Enhancements

  • ✅ OAuth login (Google/Facebook)
  • ✅ Two-Factor Authentication (2FA)
  • ✅ Admin analytics dashboard
  • ✅ Dark mode support
  • ✅ Monthly spending insights & predictions
  • ✅ Import transactions (CSV/Excel)

Video Demonstration

https://drive.google.com/file/d/1h3tC0-cbLuIEns0Uu8QFNJDXS3DEIUw9/view?usp=sharing

Submission Info

Made with 💙 for
Web & Database Computing (S1 2025)

About

MyFi is a full-stack personal finance management web application that enables users to manage budgets, track assets, create price alerts, and view personalized investment portfolios. The platform supports both regular users and an admin user with role-based access control.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors