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.
- 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
- View, add, delete, and manage registered users
- Enforce role-based access (
adminvsuser) - Admin-only access protected by middleware
| Layer | Technology |
|---|---|
| Frontend | HTML5, CSS3, JavaScript, Chart.js |
| Backend | Node.js, Express.js |
| Database | MySQL |
| API | Alpha Vantage API |
| Session Mgmt | express-session |
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
- Node.js (v18+)
- MySQL server
- Git
-
Clone the repo
git clone https://github.com/yourusername/myfi.git cd myfi -
Install dependencies
npm install
-
Create
.envfile Create a.envfile 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 -
Import database schema Run the following in your terminal to import the database schema:
mysql -u root -p MyFiDB < MyFiDB_dump.sql -
Start the server
node server.js
| 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) |
npm install axios bcrypt cookie-parser cors debug dotenv express express-session morgan multer mysql2 node-cron uuid- ✅ Input validation on both client and server sides
- ✅ Session-based authentication
- ✅ Role-based access control (
adminvsuser) - ✅ Password hashing (recommended for production)
- ✅ Alerts for suspicious activity (e.g., failed logins)
- ✅ Protection against SQL Injection and XSS
To make a user an admin, run the following SQL command:
UPDATE Users SET Role = 'admin' WHERE Email = 'admin@example.com';- API calls are dependent on Alpha Vantage free tier limits
- ✅ OAuth login (Google/Facebook)
- ✅ Two-Factor Authentication (2FA)
- ✅ Admin analytics dashboard
- ✅ Dark mode support
- ✅ Monthly spending insights & predictions
- ✅ Import transactions (CSV/Excel)
https://drive.google.com/file/d/1h3tC0-cbLuIEns0Uu8QFNJDXS3DEIUw9/view?usp=sharing
Made with 💙 for
Web & Database Computing (S1 2025)