Skip to main content
Glama

MCP Agent - AI Expense Tracker

by dev-muhammad
DASHBOARD.md•4.78 kB
# Dashboard Implementation Summary ## āœ… What Was Implemented ### 1. Web Dashboard (`templates/index.html`) A beautiful, modern expense tracker dashboard with: #### Features: - šŸ’° **Summary Statistics Cards** - Total Income (with transaction count) - Total Expenses (with transaction count) - Net Balance (color-coded based on positive/negative) - šŸ“Š **Category Summary Section** - Visual breakdown by category - Amount and transaction count per category - Percentage bars showing relative spending - Sorted by amount (highest first) - šŸ”„ **Latest Transactions Table** - 10 most recent transactions - Shows: title, category, type, amount, date - Color-coded amounts (green/red) - Responsive table design #### UI/UX: - šŸŽØ Modern dark theme design - šŸ“± Fully responsive (works on mobile/tablet/desktop) - ⚔ Auto-refresh every 30 seconds - šŸ”„ Loading states and empty states - ✨ Smooth animations and transitions - šŸŽÆ Clean, professional interface ### 2. Backend Updates (`main.py`) - Added root route (`/`) to serve the dashboard - Imports `HTMLResponse` for serving HTML - Template loaded from `templates/index.html` ### 3. Sample Data Script (`seed_data.py`) - Populates database with realistic sample data - Creates 3 income transactions: - Monthly salary - Freelance project - Stock dividends - Creates 11 expense transactions across categories: - Food (groceries, restaurant) - Housing (rent) - Transportation (uber, gas) - Utilities (electric) - Entertainment (Netflix) - Shopping (laptop) - Education (online course) - Healthcare (doctor visit) ### 4. Documentation - **README.md** - Updated with dashboard features - **USAGE.md** - Comprehensive usage guide - **DASHBOARD.md** - This implementation summary ## šŸš€ How to Use ### Quick Start: ```bash # 1. Start the server python start.py # 2. Add sample data (optional) python seed_data.py # 3. Open dashboard open http://localhost:8002/ ``` ### Access Points: - šŸ  Dashboard: http://localhost:8002/ - šŸ“š API Docs: http://localhost:8002/docs - šŸ” Health Check: http://localhost:8002/health ## šŸŽÆ Dashboard Functionality ### Data Flow: 1. Frontend fetches data from three API endpoints: - `/summary` - Overall statistics - `/summary/categories` - Category breakdown - `/transactions?limit=10` - Latest transactions 2. JavaScript processes and renders data: - Formats currency with `Intl.NumberFormat` - Formats dates with `Intl.DateTimeFormat` - Creates dynamic HTML elements - Updates progress bars and colors 3. Auto-refresh mechanism: - Reloads data every 30 seconds - Maintains real-time view of finances ### Color Coding: - 🟢 **Green** - Income, positive balance - šŸ”“ **Red** - Expenses, negative balance - ⚪ **Gray** - Neutral information ### Visual Elements: - Cards with hover effects - Progress bars for categories - Badges for transaction types - Responsive grid layouts ## šŸ“Š Sample Dashboard Preview When populated with sample data, you'll see: **Summary Cards:** ``` Total Income: $6,750.00 Total Expenses: $3,644.99 Net Balance: $3,105.01 3 transactions 11 transactions 14 total transactions ``` **Top Categories:** 1. Housing - $1,800.00 (49.4%) 2. Shopping - $1,200.00 (32.9%) 3. Food - $235.00 (6.4%) ... and more **Latest Transactions:** - Monthly Rent | Housing | Expense | -$1,800.00 - Grocery Shopping | Food | Expense | -$150.00 - Monthly Salary | Salary | Income | +$5,000.00 ... and more ## šŸ”§ Technical Stack - **Frontend**: Vanilla JavaScript (no frameworks) - **Backend**: FastAPI (Python) - **Database**: SQLite - **Styling**: Custom CSS with CSS variables - **API**: RESTful JSON endpoints ## šŸŽØ Design Principles 1. **Minimalist** - Clean, uncluttered interface 2. **Accessible** - High contrast, readable fonts 3. **Performant** - Lightweight, fast loading 4. **Responsive** - Works on all screen sizes 5. **Professional** - Business-ready design ## šŸ”œ Future Enhancements Potential additions: - šŸ“ˆ Charts and graphs (Chart.js integration) - šŸ“… Date range filters - šŸ” Advanced search and filtering - šŸ“¤ Export to CSV/PDF - šŸ‘„ Multi-user support with authentication - šŸ“Š Budget tracking and alerts - šŸ”” Real-time notifications - šŸ“± Progressive Web App (PWA) ## ✨ Key Highlights āœ… Zero external JavaScript dependencies āœ… Modern ES6+ JavaScript āœ… CSS Grid and Flexbox layouts āœ… Smooth animations and transitions āœ… Loading and error states āœ… Mobile-first responsive design āœ… Dark theme optimized āœ… Auto-refresh functionality āœ… Professional UI/UX --- **Dashboard is ready to use!** šŸš€ Simply run `python start.py` and visit http://localhost:8002/

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dev-muhammad/MCPAgent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server