open source laravel finance self-hosted sms

FINANCE - Self-hosted personal finance tracking web app

saleem_hadad

Open Source Maintainer · 2024-01-13

Laravel Company

Hello everyone, I'm happy to share with you my new open-source project called FINANCE. FINANCE is a simple yet powerful, self-hosted finance tracking web app with the ability to parse SMS transactions and generate very useful insights about your money. Repo: https://github.com/saleem-hadad/finance Read the docs: https://finance-demo.saleem.dev/docs View demo app: https://fina...

Self-hosted finance apps have grown in popularity among users who want data ownership without subscription fatigue. FINANCE distinguishes itself by focusing on transaction ingestion from SMS, reducing manual entry friction, and surfacing insights through a clean web interface. This post reviews the project's architecture, extensibility, and how to integrate its data into broader operational dashboards.

Project Overview

FINANCE is built with Laravel and Inertia, using Vue for the frontend. It tracks accounts, categories, and transactions, then renders charts for spending trends and net worth over time. The standout feature is the SMS parser: users forward bank transaction messages to an application phone number or import them, and FINANCE extracts amount, date, and merchant automatically.

SMS Parsing Pipeline

Parsing SMS is more complex than simple regex matching because banks vary message formats by country and language. FINANCE addresses this with configurable parser rules stored in the database, allowing maintainers to add new bank templates without deploying code. Each rule defines regex patterns for amount, currency, date, and counterparty. When a message matches, the parser creates a transaction draft that users can confirm or discard.

Data Model and Insights

The application defines accounts, categories, tags, and transactions with support for transfers between accounts. Recurring transactions are detected by amount and merchant similarity, enabling cash-flow projections. Insight generation happens through scheduled commands that run nightly, avoiding performance impact during user requests.

Dashboard Integration

If your team maintains an internal monitoring dashboard, you can feed FINANCE summary data into analytics pipelines. A related topic is covered in Analytics dashboard, where multi-application monitoring, snapshot models, and alerting strategies let you combine financial insights with operational metrics in one place.

Deployment and Maintenance

FINANCE supports Docker-based deployment, making it easy to run on a VPS or home server. Database backups, queue workers, and scheduled tasks should be managed at the host level. Keep dependencies updated and monitor queue throughput to ensure SMS ingestion remains timely.

Conclusion

FINANCE demonstrates that self-hosted finance tools can be approachable, SMS-aware, and extensible. Its Laravel foundation makes it a solid candidate for customization, whether you want new parsers, additional insight modules, or integration with corporate analytics.

Related Posts

These related posts cover dashboard architecture, self-hosted finance apps, and PDF generation for reports.

Self-Hosting Considerations and Security

Self-hosting FINANCE puts the burden of security on you. Ensure HTTPS with Let's Encrypt or Cloudflare Tunnel. Configure CORS strictly, use rate limiting on API routes, and enable reCAPTCHA on auth forms. Keep Laravel and dependencies updated; use tools like Composer audit and npm audit in CI. Database credentials and Stripe keys should never be committed; use .env and consider Laravel Vapor, Forge, or Envoyer for deployment automation.

For multi-user deployments, implement proper tenant isolation. Each user's transactions and SMS parsings must be scoped by user ID. If you expose an API for third-party integrations, use Sanctum tokens with fine-grained abilities. Automatic backups with Spatie Laravel Backup should include both the database and uploaded files (receipts, attachments). Cloud storage like S3 also helps with redundancy.

SMS Parsing in Practice

The SMS parser must handle varied formats across banks and mobile carriers. Use regex patterns tailored to common SMS templates. Consider letting users manually correct categorized transactions; this feedback loop improves parsing accuracy over time. For privacy, process SMS messages on-device when possible, or ensure messages are encrypted in transit and at rest in your database.

See Analytics dashboard for visualizing expense trends and Laravel Octane benchmark comparing Swoole, OpenSwoole, RoadRunner, FrankenPHP for deploying FINANCE at scale.

Deployment with Docker Compose

A typical FINANCE deployment uses Docker Compose to orchestrate the Laravel app, Nginx, MySQL, and optional Redis containers. Define a docker-compose.yml with named volumes for database persistence and a .env file for secrets. Use the official Laravel Sail image for consistency across development and production. Add a cron service for Laravel's scheduler and a queue worker container for SMS parsing jobs.

Backups should be handled by a scheduled container that dumps the database and compresses it, then uploads to S3 or another remote store. Use healthchecks on each service to detect failures. Nginx should enforce HTTPS and security headers: HSTS, X-Frame-Options, Content-Security-Policy. For file uploads, validate MIME types and store them outside the web root with signed URLs.

Insights and Reporting

The insights feature aggregates transactions by category, vendor, and time period. Implement this with scheduled commands that bucket expenses into daily or weekly summaries. Use Laravel's cache tags to store expensive calculations like monthly cash flow. The frontend can request cached summaries and fall back to real-time calculation only when the cache misses.

For multi-currency support, store amounts in a base currency using an exchange rate service. Let users set their primary currency and convert automatically. Charts showing spending trends benefit from libraries like Chart.js or ApexCharts. See Analytics dashboard for implementation patterns that can be reused in FINANCE.