MoneyFlux is an open-source personal expense tracking application that uses Google Sheets as a backend database and a modern Next.js frontend. Track your expenses and income easily with this Progressive Web App.
- Google Sheets Backend: Uses Google Sheets as a database for storing all transactions
- Progressive Web App: Loads quickly and works as a standalone app on mobile and desktop
- PIN Protection: Secure your financial data with a PIN code
- Monthly Overview: View your expenses and income for the current month and previous months
- Category Management: Track expenses by categories with visual representations
- CRUD Operations: Create, read, update, and delete transactions
- Data Visualization: See your spending patterns with charts and summaries
- Responsive Design: Works on all devices - desktop, tablet, and mobile
MoneyFlux consists of two main components:
- Create a new Google Sheet at sheets.google.com
- Go to Extensions > Apps Script
- Replace the default code with the Google Apps Script code from this repository
- Update the
SHEET_ID
constant with your Google Sheet ID (found in the Sheet URL) - Deploy the script as a web app:
- Click on Deploy > New deployment
- Select "Web app" as the deployment type
- Set "Who has access" to "Anyone"
- Click "Deploy"
- Copy the web app URL for later use
-
Clone the repository:
git clone https://github.com/nagacoder/moneyflux.git cd moneyflux
-
Install dependencies:
npm install
-
Create a
.env.local
file in the root directory and add your Google Apps Script web app URL:NEXT_PUBLIC_API_ENDPOINT=https://script.google.com/macros/s/.../exec
-
Run the development server:
npm run dev
-
Build for production:
npm run build
The frontend can be easily deployed to Cloudflare Pages or any other hosting provider:
-
Build your application:
npm run build
-
Deploy to Cloudflare Pages by connecting your GitHub repository in the Cloudflare Dashboard
- Open the app in your browser
- You'll be prompted to set up a PIN code
- This PIN code is converted to an API key that will be used for all API requests
- Once set up, you can start tracking your expenses and income
- Click the "+" button to add a new transaction
- Select the transaction type (Income or Expense)
- Choose or create a category
- Enter the amount and optional description
- Submit the form to save the transaction
The dashboard provides several views of your financial data:
- Summary cards showing total income, expenses, and balance
- Pie chart visualizing expenses by category
- Monthly navigation to view historical data
- Transaction list with all details
The Google Apps Script provides the following API endpoints:
- createTransaction: Add a new transaction
- readTransactions: Get transactions with optional filters
- updateTransaction: Update an existing transaction
- deleteTransaction: Remove a transaction
- getCategories: Get all available categories
- addCategory: Create a new category
- getCategories: Retrieve all categories
- getSummary: Get summarized transaction data by category
- readTransactions: Get transactions with optional query parameters
- setup: Initialize the spreadsheet with default sheets and categories
The API is protected with a simple API key that is derived from the PIN you set. While this provides basic protection, it's recommended to use this application for personal use only and not store extremely sensitive financial information.
You can add new categories directly through the application interface or by editing the "Categories" sheet in your Google Spreadsheet.
The application uses a modern, clean design that can be customized through the CSS files in the project.
Contributions are welcome! Please feel free to submit a Pull Request.
- 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 - see the LICENSE file for details.
- Next.js - The React Framework
- Google Apps Script - For the backend API
- React - UI Library
- Recharts - Charting Library
Created by nagacoder