A modern, full-stack personal finance management application built with the MERN stack, financial insights, interactive 3D visualizations, and comprehensive expense tracking.
- Features
- Tech Stack
- Project Structure
- Prerequisites
- Installation
- Environment Variables
- Running the Application
- API Documentation
- Data Visualization
- Contributing
- License
- Transaction Management
- Add, view, and track income & expenses
- Categorize transactions with custom categories
- Date-based transaction filtering
- CSV export for financial reports
- Budget Planning
- Set monthly spending limits per category
- Real-time budget tracking
- Visual progress indicators
- Budget vs actual spending analysis
- Over-budget warnings
- Savings Goals
- Create multiple savings goals
- Track progress towards targets
- Add funds incrementally
- Completion tracking and achievements
- Goal archiving
- Financial Reporting
- Monthly income/expense summary
- Category-wise spending breakdown
- Interactive 3D pie charts
- CSV export functionality
- Date range filtering
- Interactive Visualizations
- 3D doughnut charts using Three.js
- Animated hover effects with React Spring
- Real-time data updates
- Color-coded spending categories
- User Experience
- Modern glassmorphism UI design
- Dark theme with gradient accents
- Responsive mobile-first design
- Smooth animations and transitions
- Money rain animation on welcome page
- React 19.1.0 - UI library
- React Router DOM 7.8.1 - Client-side routing
- Redux Toolkit 2.8.2 - State management
- Axios 1.11.0 - HTTP client
- Three.js 0.179.1 - 3D graphics
- @react-three/fiber 9.3.0 - React renderer for Three.js
- @react-three/drei 10.7.3 - Three.js helpers
- React Spring 10.0.1 - Animation library
- Matter.js 0.20.0 - Physics engine
- Lottie React 2.4.1 - Animation player
- React Markdown 10.1.0 - Markdown renderer
- Node.js - Runtime environment
- Express 5.1.0 - Web framework
- MongoDB - NoSQL database
- Mongoose 8.17.0 - ODM for MongoDB
- JWT (jsonwebtoken 9.0.2) - Token-based authentication
- bcryptjs 3.0.2 - Password hashing
- Cookie Parser 1.4.7 - Cookie management
fintrac/
βββ backend/
β βββ src/
β β βββ controllers/
β β β βββ budget.controller.js
β β β βββ goal.controller.js
β β β βββ report.controller.js
β β β βββ transaction.controller.js
β β β βββ user.controller.js
β β βββ middlewares/
β β β βββ auth.middleware.js
β β βββ models/
β β β βββ budget.model.js
β β β βββ goal.model.js
β β β βββ transaction.model.js
β β β βββ user.model.js
β β βββ routes/
β β β βββ budget.routes.js
β β β βββ goal.routes.js
β β β βββ report.routes.js
β β β βββ transaction.routes.js
β β β βββ user.routes.js
β β βββ utils/
β β β βββ ErrorHandler.js
β β β βββ ErrorWrapper.js
β β βββ index.js
β βββ package.json
β βββ .env
βββ frontend/
β βββ src/
β β βββ assets/
β β β βββ money.png
β β βββ components/
β β β βββ BudgetForm.jsx
β β β βββ BudgetList.jsx
β β β βββ GoalForm.jsx
β β β βββ GoalList.jsx
β β β βββ MoneyRain.jsx
β β β βββ ProtectedRoute.jsx
β β β βββ SpendingPieChart.jsx
β β β βββ TransactionForm.jsx
β β βββ pages/
β β β βββ BudgetsPage.jsx
β β β βββ DashboardPage.jsx
β β β βββ GoalsPage.jsx
β β β βββ HomePage.jsx
β β β βββ LoginPage.jsx
β β β βββ RegisterPage.jsx
β β β βββ TransactionsPage.jsx
β β β βββ WelcomePage.jsx
β β β βββ WelcomePage.css
β β βββ services/
β β β βββ api.js
β β βββ store/
β β β βββ authActions.js
β β β βββ authReducer.js
β β β βββ store.js
β β βββ App.jsx
β β βββ App.css
β β βββ index.css
β β βββ main.jsx
β βββ public/
β βββ package.json
β βββ .env
βββ README.md
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- MongoDB (v4.4 or higher)
- npm or yarn package manager
git clone <https://github.com/yourusername/fintrac.git>
cd fintrac
cd backend
npm install
cd frontend
npm install
Create a .env file in the backend directory:
# Server Configuration
PORT=4000
# Database Configuration
DB_PATH=mongodb://127.0.0.1:27017
DB_NAME=finance_CB
# CORS Configuration
CORS_ORIGINS=http://localhost:5173
# JWT Secret
JWT_SECRET=your_jwt_secret_key_here_make_it_long_and_secure
Create a .env file in the frontend directory:
# API Base URL (optional, defaults to localhost:4000)
VITE_API_URL=http://localhost:4000/api/v1
# If using local MongoDB
mongod
# Or if using MongoDB service (Linux)
sudo systemctl start mongod
# Or if using MongoDB service (macOS)
brew services start mongodb-community
cd backend
npm start
The backend server will start on http://localhost:4000
cd frontend
npm run dev
The frontend will start on http://localhost:5173
<http://localhost:4000/api/v1>
Register a new user
Request Body:
{
username: string,
email: string,
password: string (min 6 characters)
}
Response:
{
success: true,
message: "User registered successfully",
token: string,
user: {
id: string,
username: string,
email: string
}
}Login user
Request Body:
{
email: string,
password: string
}
Response:
{
success: true,
message: "User LoggedIn Successfully",
token: string,
user: {
id: string,
username: string,
email: string
}
}Get user profile (Protected)
Headers:
Authorization: Bearer {token}
Response:
{
success: true,
user: {
_id: string,
username: string,
email: string,
createdAt: date
}
}All transaction endpoints require authentication via Bearer token.
Add new transaction
Headers:
Authorization: Bearer {token}
Request Body:
{
type: "income" | "expense",
category: string,
amount: number,
date: date,
description: string
}
Response:
{
success: true,
message: "Transaction created successfully",
data: Transaction
}Get all user transactions
Headers:
Authorization: Bearer {token}
Response:
{
success: true,
data: [Transaction]
}Update transaction
Headers:
Authorization: Bearer {token}
Request Body:
{
type?: "income" | "expense",
category?: string,
amount?: number,
date?: date,
description?: string
}
Response:
{
success: true,
message: "Transaction updated successfully",
data: Transaction
}Delete transaction
Headers:
Authorization: Bearer {token}
Response:
{
success: true,
message: "Transaction deleted successfully"
}Set or update budget
Headers:
Authorization: Bearer {token}
Request Body:
{
category: string,
limit: number
}
Response:
{
success: true,
message: "Budget set/updated successfully",
data: Budget
}Get all user budgets
Headers:
Authorization: Bearer {token}
Response:
{
success: true,
data: [Budget]
}Create savings goal
Headers:
Authorization: Bearer {token}
Request Body:
{
name: string,
targetAmount: number,
currentAmount?: number (default: 0),
targetDate?: date
}
Response:
{
success: true,
data: Goal
}Get all user goals
Headers:
Authorization: Bearer {token}
Response:
{
success: true,
data: [Goal]
}Update goal progress
Headers:
Authorization: Bearer {token}
Request Body:
{
currentAmount?: number,
name?: string,
targetAmount?: number,
targetDate?: date
}
Response:
{
success: true,
data: Goal
}Delete goal
Headers:
Authorization: Bearer {token}
Response:
{
success: true,
message: "Goal deleted successfully"
}Get current month financial summary
Headers:
Authorization: Bearer {token}
Response:
{
success: true,
data: {
income: number,
expense: number,
savings: number
}
}Get expense breakdown by category
Headers:
Authorization: Bearer {token}
Query Parameters (optional):
- startDate: date (default: current month start)
- endDate: date (default: next month start)
Response:
{
success: true,
data: [
{
_id: "category_name",
totalAmount: number
}
]
}Export transactions as CSV
Headers:
Authorization: Bearer {token}
Response:
CSV file download with columns:
- Date
- Type
- Category
- Amount
- DescriptionThe application features an interactive 3D doughnut chart built with:
- Three.js: For 3D rendering
- React Three Fiber: React renderer for Three.js
- React Spring: Smooth animations
- Drei: Three.js helpers
Features:
- Interactive hover effects
- Real-time data updates
- Color-coded categories
- Tooltips with amounts
- Orbital controls for rotation
A physics-based animation on the welcome page using:
- Matter.js: 2D physics engine
- Falling money bills with realistic physics
- Random rotation and positioning
- Optimized performance
- Color Palette: Purple/pink gradients with dark theme
- Typography: Inter font family
- Spacing: Consistent spacing scale
- Components: Reusable card-based layouts
- Smooth page transitions
- Hover effects on interactive elements
- Loading states with animations
- Progress bars with gradient fills
- Mobile-first approach
- Breakpoints: 480px, 768px, 1024px, 1200px
- Touch-friendly interfaces
- Optimized for all screen sizes
- Password Hashing: bcryptjs with salt rounds
- JWT Authentication: Secure token-based auth
- Protected Routes: Middleware verification
- HTTP-Only Cookies: Optional cookie storage
- Input Validation: Server-side validation
- CORS Configuration: Restricted origins
- Error Handling: Secure error messages
- Quick overview of financial health
- Monthly income, expense, and savings summary
- Recent transactions list
- Quick navigation to all features
- Data export functionality
- Add income and expenses
- Transaction filtering (all/income/expense)
- Sorting options (date/amount/category)
- Full transaction history
- Edit and delete capabilities
- CSV export
- Set category-wise budgets
- Visual progress bars
- Over-budget warnings
- Total budget overview
- Real-time spending tracking
- Budget utilization percentage
- Create savings goals
- Track progress with visual indicators
- Add money incrementally
- Goal completion tracking
- Achievement celebrations
- Goal archiving
- React.memo: Prevents unnecessary re-renders
- useCallback: Memoizes callback functions
- Lazy Loading: Code splitting for routes
- Debouncing: Input field optimizations
- Pagination: Large data set handling
- Caching: API response caching
# Run backend tests
cd backend
npm test
# Run frontend tests
cd frontend
npm test
- Multi-currency support
- Recurring transactions
- Bank account integration
- Bill reminders
- Investment tracking
- Tax calculation
- Family account sharing
- Mobile app (React Native)
- Email notifications
- Advanced AI insights
This project is licensed under the ISC License.