A Node.js backend server for managing financial data and providing smart financial insights. The server integrates with Google Apps Script for data storage and processing.
-
Marketplace Management
- Latest transaction tracking
- Monthly budget allocation
- Historical expenditure analysis
- User income and budget management
- Expense transaction tracking
-
Smart Financial Features
- Dashboard statistics
- Recurring transaction prediction
- Pattern detection
- Smart suggestions
- Goal suggestions
- Category-based expense analysis
- OCR transaction processing
- Usage duration prediction
- Budget alerts
- Goal reminders
- Category prediction
- Node.js
- Express.js
- Google Apps Script
- Axios
financial-server/
├── controllers/ # Request handlers
├── middleware/ # Custom middleware
├── routes/ # API routes
├── services/ # Business logic
├── utils/ # Utility functions
└── scripts/ # Google Apps Script files
- Clone the repository:
git clone https://github.com/anh29/financial-server.git
cd financial-server- Install dependencies:
npm install- Set up environment variables:
Create a
.envfile in the root directory with the following variables:
PORT=3000
MODEL_URL=your_model_url
- Start the server:
npm startGET /getLatestTransaction/user/:userId- Get latest transactionGET /getMonthlyBudgetWithAllocations/user/:userId/month/:month- Get monthly budgetGET /getHistoricalExpenditures/user/:userId- Get historical expendituresGET /getUserIncomeAndBudgets/user/:userId- Get user income and budgetsGET /getExpensesTransactions/user/:userId- Get expense transactions
GET /dashboard/:userId- Get dashboard statisticsGET /predictRecurring/:userId- Predict recurring transactionsGET /detectRecurring/:userId- Detect new recurring patternsGET /suggestions/:userId- Get smart suggestionsGET /goals/suggest/:userId- Suggest smart goalsGET /expenseByCategory/:userId- Get expenses by categoryGET /ocr/pending/:userId- Get pending OCR reviewsPOST /ocr/confirm- Confirm OCR transactionPOST /predictUsageDuration- Predict usage durationGET /alerts/budget/:userId- Check budget alertsGET /reminders/goals/:userId- Check goal remindersPOST /category- Predict category
The server implements comprehensive error handling with:
- Input validation
- Error logging
- Standardized error responses
- Google Apps Script error handling
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.