Overview
SpendWisely George consists of multiple components that can be installed independently based on your needs:- Frontend PWA (Required): The web interface
- Google Apps Script (Required): Data storage and AI processing
- Python Backend (Optional): Bank sync and portfolio features
- Unfold CLI (Optional): Fold Money integration
You can start with just the frontend and Google Apps Script for basic expense tracking, then add the backend later for advanced features.
System Requirements
For Basic Setup (Frontend + Google Apps Script)
- Modern web browser (Chrome, Firefox, Safari, Edge)
- Google account
- Gemini API key (free tier available)
For Full Setup (With Backend)
- Python 3.8 or higher
- pip (Python package manager)
- Git (for cloning the repository)
- Go 1.19+ (if building Unfold from source)
Installation Methods
- Quick Setup
- Full Setup
- Production Deploy
Best for: Testing and personal useThis method uses GitHub Pages for the frontend and Google Apps Script for the backend.
Part 1: Frontend Installation
Clone the Repository
Configure the Frontend
Update Script URL
Open You’ll update this after deploying Google Apps Script.
index.html and locate line 306:index.html
Part 2: Google Apps Script Setup
Create the Google Sheet
Create New Sheet
- Go to Google Sheets
- Create a new blank spreadsheet
- Add headers in the first row:
| A | B | C | D | E |
|---|---|---|---|---|
| Date | Description | Amount | Category | Type |
Deploy the Apps Script
Add the Script Code
Copy the entire contents of
google_script.js and paste it into the editor.google_script.js
Deploy as Web App
- Click Deploy → New deployment
- Select type: Web app
- Configuration:
- Description: “George Finance API”
- Execute as: Me (your email)
- Who has access: Anyone
- Click Deploy
- Authorize the required permissions
- Copy the deployment URL
Configure Google Apps Script
The script handles three types of operations:GET Requests - Fetch Data
GET Requests - Fetch Data
Returns current balance, expenses, budget, and privacy settings:
google_script.js
POST Requests - Save Data
POST Requests - Save Data
Handles multiple actions:
save_settings: Updates budget, privacy mode, and Gemini API keydelete: Removes a transaction from the sheetadd: Adds a basic transactionprocess_text: AI-powered expense processing
AI Processing with Gemini
AI Processing with Gemini
The script sends prompts to Gemini Flash:
google_script.js
Part 3: Backend Server (Optional)
Install Dependencies
Configure the Server
The server configuration is at the top ofserver.py:
server.py
Key Configuration Options
Key Configuration Options
- UNFOLD_BINARY: Path to the Unfold CLI executable
- UNFOLD_CONFIG: YAML file storing Fold Money credentials
- DB_PATH: SQLite database for cached transactions
- HOLDINGS_FILE: JSON file storing mutual fund holdings
Start the Server
http://localhost:8000.
For production deployment, set the
PORT environment variable:API Endpoints
The FastAPI server provides these endpoints:Part 4: Unfold CLI Setup
Unfold is a Go-based CLI tool for Fold Money integration. Pre-built binaries are not provided in the repository, so you’ll need to build from source or obtain a binary.
Directory Structure
Create the unfold directory:Configuration File
The server createsunfold_config.yaml automatically when you log in via the UI:
unfold_config.yaml
Using Unfold
Once configured, the backend automatically calls Unfold:server.py
db.sqlite with transaction data.
Part 5: Environment Variables
For Local Development
Create a.env file (optional, for advanced configurations):
For Production Deployment
Set these environment variables on your hosting platform:| Variable | Description | Example |
|---|---|---|
PORT | Server port | 8000 |
GEMINI_KEY | Google Gemini API key | AIza... |
FOLD_PHONE | Pre-configured phone (optional) | +919876543210 |
Verification Steps
Test Frontend Connection
Open the frontend and check the status indicator:
- Should show “ONLINE” in green
- Balance should display (or show ••••••)
Test Backend API (if installed)
Visit
http://localhost:8000/docs for the interactive API documentation.Troubleshooting
Google Apps Script Errors
Google Apps Script Errors
Error: “Authorization required”
- Solution: Re-deploy the script and grant all requested permissions
- Solution: Verify the
SHEET_IDconstant matches your actual Sheet ID
- Solution: Check your API quota at Google AI Studio
Backend Server Errors
Backend Server Errors
Error:
ModuleNotFoundError: No module named 'fastapi'- Solution: Install dependencies:
pip install -r requirements.txt
- Solution: Verify
UNFOLD_BINARYpath is correct or skip bank sync features
- Solution: The server allows all origins by default. Check browser console for specific errors.
Frontend Issues
Frontend Issues
Issue: Status stuck on “INITIALIZING…”
- Check: Is
SCRIPT_URLcorrect? - Check: Can you access the Apps Script URL directly?
- Check: Browser console for JavaScript errors
- Requires: HTTPS or localhost
- Requires: Microphone permissions granted
- Supported: Chrome, Edge, Safari (limited)
Database Issues
Database Issues
Issue: Transactions not syncing
- Verify: Backend server is running
- Verify: Fold account is logged in (check
/api/fold/status) - Check:
unfold/db.sqlitefile exists and has recent timestamp
- Verify: Holdings are saved via Settings → Mutual Fund Holdings
- Check: Network access to
api.mfapi.in - Check: Scheme codes are valid (6-digit numbers)
Security Considerations
Next Steps
Deploy to Production
Learn how to deploy to Render, Railway, or Fly.io
Explore Features
Discover all the powerful features of SpendWisely George
API Reference
Explore all backend endpoints
Integrations
Set up bank sync and portfolio tracking