๐ฐ Aegis - AI-Powered Expense Tracker v2.0
Aegis is a modern, intelligent full-stack expense tracking application that leverages AI to help you manage your finances smarter. Built with a Node.js/Express backend, SQLite, and vanilla JavaScript, it offers a premium futuristic UI, conversational AI assistance, automated insights, and personalized financial recommendations.
โจ Features
๐ฏ Core Functionality
- User Authentication - Secure JWT-based registration and login with bcrypt password hashing
- Income & Expense Tracking - Track all your financial transactions with categorized tags
- Recurring Expenses - Manage subscriptions and bills that auto-generate transactions when due
- Real-time Balance Dashboard - Instantly see your available balance and spending breakdown
- Visual Analytics - Interactive charts (Chart.js) showing expense distribution, monthly comparisons, and trends
- Advanced Filtering - Search, filter, and sort transactions with server-side pagination
- Persistent Storage - All data saved securely in a local SQLite database
๐ค AI-Powered Features
Aegis securely proxies all AI requests through the backend using either xAI (Grok) or Groq APIs.
1. AI Chat Assistant ๐ฌ
Conversational financial advisor:
- Ask questions about your spending: "How much did I spend on food this month?"
- Get personalized saving tips based on your actual data
- Context-aware responses that know your balance and transaction history
2. Financial Forecasting & Predictions ๐
Dashboard AI integration:
- Predicts your end-of-month spending based on the last 7 days' trend
- Alerts you if you're projected to exceed your income
- Offers quick, actionable daily advice
3. Smart Tagging & Fast Entry ๐ท๏ธ
Intelligent categorization:
- Learns from your recent spending history
- Automatically suggests the best category for new expenses
- Parses natural language (e.g., "50 on coffee" โ Food expense)
4. AI Budget Planner ๐
Personalized budget recommendations on the Analytics page:
- Analyzes current spending patterns
- Suggests optimized category allocations
- Generates a custom budget aiming for a 20%+ savings rate
5. Anomaly Detection โ ๏ธ
Intelligent spending pattern analysis:
- Detects unusually high expenses
- Identifies duplicate transactions
- Flags suspicious patterns
๐ Getting Started
Prerequisites
- Node.js (v16 or higher)
- Modern web browser (Chrome, Firefox, Safari, Edge)
- xAI API Key (or Groq API Key)
Installation
- Clone the repository
git clone https://github.com/rithunkp/Aegis.git
cd Aegis/server
- Install dependencies
npm install
- Set up environment variables
Create a
.env file in the server directory:
PORT=3000
JWT_SECRET=your_super_secret_jwt_key
GROQ_API_KEY=xai-your_api_key_here # Can be an xAI or Groq key
- Start the server
npm start
The server will automatically initialize the SQLite database on first run.
- Open in browser
Navigate to
http://localhost:3000
๐ Usage Guide
- Registration: Create a new account on the login page. Your data is isolated and persistent.
- Dashboard: View your overall financial health, top categories, and AI end-of-month predictions. Use the "Quick Add" bar for fast entries.
- Transactions: View, search, filter, edit, and delete your complete transaction history.
- Analytics: Analyze your spending with interactive doughnut, line, and bar charts. Generate an AI budget plan based on your habits.
- AI Assistant: Chat directly with the AI about your finances for insights and advice.
- Recurring: Set up automated monthly, weekly, or daily expenses (like Netflix or Rent).
- Settings: Customize your own tags, update your profile, and toggle between Light and Dark themes.
๐ ๏ธ Technology Stack
Frontend
- HTML5 & CSS3 - Modern futuristic UI, glassmorphism, responsive mesh gradients
- Vanilla JavaScript (ES6+) - Modular SPA architecture with hash routing
- Chart.js - Interactive data visualization
- Font Awesome - Icon library
Backend
- Node.js & Express - RESTful API server
- SQLite3 - Zero-configuration relational database
- JWT (JSON Web Tokens) - Stateless authentication
- Bcrypt.js - Passion hashing
AI Integration
- xAI & Groq APIs - Dynamic endpoint switching based on API key
- Features: JSON parsing, natural language understanding, financial context injection
๐ Project Structure
Aegis/
โโโ public/ # Frontend SPA
โ โโโ index.html # Login/Register page
โ โโโ app.html # Main application shell
โ โโโ css/
โ โ โโโ style.css # Unified design system
โ โโโ js/
โ โโโ api.js # Backend API client
โ โโโ auth.js # Authentication logic
โ โโโ app.js # Router and page controllers
โโโ server/ # Node.js Backend
โ โโโ index.js # Express entry point
โ โโโ .env # Secret keys (not tracked)
โ โโโ db/
โ โ โโโ database.js # SQLite connection & init
โ โ โโโ schema.sql # Database structure
โ โ โโโ database.sqlite # Auto-generated DB file
โ โโโ middleware/
โ โ โโโ auth.js # JWT verification
โ โโโ routes/ # API Endpoints
โ โ โโโ auth.js
โ โ โโโ transactions.js
โ โ โโโ tags.js
โ โ โโโ recurring.js
โ โ โโโ analytics.js
โ โ โโโ ai.js # Secure AI proxy
โ โโโ services/
โ โโโ groqService.js # AI API logic
โโโ README.md
๐ค Contributing
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch:
git checkout -b feature-name
- Commit changes:
git commit -m 'Add feature'
- Push to branch:
git push origin feature-name
- Open a Pull Request
๐ Support
Made by Rithun KP