A production-grade, local-first personal financial command center built with deterministic financial math, multi-account ledgering, automated recurring obligations, deep analytics, and PWA mobile support.
π Live Production App: https://bagstack.tech
- Financial Account Diversity: Seamlessly track Savings, Checking, Credit Cards (with credit limits and billing cycle dates), Cash, Investments, and Loans.
- Email-Scoped Workspaces: One master verified email account with unlimited compartmentalized profiles (e.g., Personal, Business, Side-Hustle).
- First-Class Transfers: Move money between accounts without artificially inflating income or expense metrics.
- Zero Floating-Point Drift: All currency calculations are executed strictly in integer minor units (paise/cents). No
0.1 + 0.2 = 0.30000000000000004rounding bugs. - Deterministic Insights: Real-time savings rates, burn-rate metrics, and net-worth calculations derived directly from the immutable transaction ledger.
- Auto-Deductions: Subscriptions automatically log their payments into the account ledger when reaching their renewal date.
- Flexible Controls:
- "Mark as Paid": Manually log an early payment and automatically roll the renewal date forward to the next cycle.
- "Pay Late" / Snooze: Postpone upcoming renewal reminders using the custom date picker without triggering premature deductions.
- "Already Paid" on Creation: Checkbox allowing new subscriptions to record their initial payment and compute the true next billing cycle.
- Direct Account Funding: Contribute directly to savings goals with automatic account balance deduction and linked expense logging under the Savings & Goals category.
- Goal Editing & Target Tracking: Set target dates, modify opening balances, and track progress percentage.
- Interactive Reports: Category spend breakdowns, top merchant volume, daily spending distribution, and 90-day forecast projections.
- Side-by-Side Comparison: Compare any two months to inspect variance in income, expenses, net savings, and category-by-category shifts.
- Add to Home Screen: Installable as a standalone app on iOS Safari and Android Chrome with custom app icons, zero browser address-bar distraction, and native mobile viewport handling.
- Pure Vanilla CSS Design System: Lightweight, responsive interface using CSS tokens (
--bg-surface,--text-primary,--border-default, etc.). - System Theme Adaptation: Built-in
@media (prefers-color-scheme: dark)and pre-hydration initialization to seamlessly adapt to system light or dark preferences without white flashes. - Custom Modern Date Picker: Custom calendar dropdown with quick presets (Today, Tomorrow, +1 Week, +1 Month) replacing browser native white inputs.
- Standard Warning Dialogs: Smooth, glassmorphic confirmation modal safeguarding all destructive operations (account, profile, goal, and subscription deletions) and session sign-outs.
- Email OTP Verification: Cryptographic 6-digit one-time code sent via Gmail SMTP, stored as SHA-256 hashes with 10-minute expiration and rate limiting.
- Instant Sandbox Demo: New visitors can immediately explore preloaded sample data in demo mode with one click from the public landing page.
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router + Turbopack) |
| Language | TypeScript / React 19 |
| Database | SQLite via native Node.js 22 node:sqlite (DatabaseSync + WAL mode) |
| Styling | Vanilla CSS with design tokens (Zero Tailwind overhead) |
| Mobile / PWA | Web App Manifest (manifest.json), Apple touch icons, standalone display |
| Icons | Lucide React |
| Email / SMTP | Nodemailer (Gmail App Password support) |
| Testing | Vitest (23 domain & integration tests) |
| Containerization | Multi-stage Alpine Dockerfile with standalone Next.js build |
- Node.js:
v22.0.0or higher (required for nativenode:sqlite). - npm / yarn / pnpm
git clone https://github.com/AdityaRaj212/bagstack.git
cd bagstacknpm installCopy the template file to .env.local:
cp .env.example .env.localEdit .env.local:
# Optional: Set port (defaults to 3000)
PORT=3000
# Nodemailer / SMTP Configuration for Passwordless Email OTP
# Generate a Google App Password at: https://myaccount.google.com/apppasswords
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-16-char-app-passwordNote: If SMTP credentials are omitted, OTP codes are logged directly to the server terminal console for local development.
npm run devOpen http://localhost:3000 in your browser.
Run the Vitest test suite:
npm testBuild for production verification:
npm run buildBagstack supports zero-cost 24/7 cloud deployment using Render for compute and Turso for distributed SQLite cloud persistence. Even when the free container sleeps or rebuilds, all user accounts, transactions, and settings remain permanently saved.
- Sign up for free at turso.tech (using GitHub).
- Create a database:
bagstackin regionsin(Singapore) oraws-ap-south-1(Mumbai). - Copy your Database URL (
libsql://...) and Auth Token.
- Go to dashboard.render.com and click New + β Web Service.
- Connect your GitHub repository
AdityaRaj212/bagstack. - Choose runtime: Docker on the Free ($0) instance plan.
- Add Environment Variables:
PORT=3000NODE_ENV=productionSMTP_USER=your-email@gmail.comSMTP_PASS=your-google-app-passwordTURSO_DATABASE_URL=libsql://bagstack-yourname.turso.ioTURSO_AUTH_TOKEN=your-turso-token
- Click Deploy Web Service.
Your app is now live with automatic SSL at https://bagstack.onrender.com!
To run the production container locally with Docker Compose:
docker compose up -d --buildYour SQLite database will be persisted in the local Docker volume bagstack_data.
bagstack/
βββ src/
β βββ app/ # Next.js App Router pages & API routes
β β βββ accounts/ # Financial accounts management
β β βββ budgets/ # Envelope budgeting & limits
β β βββ goals/ # Savings goals & account contributions
β β βββ investments/ # Investment tracking & asset allocation
β β βββ loans/ # EMI & loan amortization schedule
β β βββ reports/ # Analytics, trends & month-over-month diffs
β β βββ subscriptions/ # Recurring subscriptions & auto-deductions
β β βββ transactions/ # Ledger feed with search, filters & tags
β β βββ api/ # REST endpoints
β βββ components/ # Reusable UI components
β β βββ AppShell.tsx # Responsive layout shell & demo banner
β β βββ ModernDatePicker.tsx# Custom theme-adaptive calendar dropdown
β β βββ ConfirmDialog.tsx # Universal confirmation modal
β β βββ LandingPage.tsx # High-converting public landing page
β β βββ ...
β βββ context/ # Global AppContext & theme state
β βββ lib/ # Domain logic & services
β β βββ db.ts # SQLite schema, pragmas & migrations
β β βββ finance-service.ts # Financial engine & deterministic calculations
β β βββ auth.ts # Session & multi-profile management
β β βββ mailer.ts # Branded email templates & SMTP delivery
β β βββ money.ts # Integer minor-unit currency utilities
β βββ styles/ # Global styles & design tokens
βββ public/
β βββ manifest.json # Web App Manifest for mobile installation
β βββ icon.svg # Vector brand app icon
βββ tests/ # Automated test suite (Vitest)
βββ Dockerfile # Multi-stage production container
βββ docker-compose.yml # Persistent container orchestration
βββ README.md
MIT License. Designed and engineered for private, personal financial independence.