MCPSERV.CLUB
MyFin

MyFin

Self-Hosted

Personal finance platform for budgeting and tracking

Active(88)
203stars
0views
Updated 13 days ago
MyFin screenshot 1
1 / 2

Overview

Discover what makes MyFin powerful

MyFin is a self‑hosted personal finance platform that exposes a well‑structured REST API and a lightweight web UI. At its core, the application ingests transaction data, normalises it via configurable rules, and persists it in a relational database. The API layer is written in **Go**, leveraging the Gin framework for routing and middleware, while the front‑end uses **React** with TypeScript for a responsive single‑page experience. Data is stored in PostgreSQL, accessed through the `pgx` driver, and migrations are managed by `golang-migrate`. The stack is deliberately minimal to keep the runtime footprint small and to enable straightforward Docker deployment.

Backend

Database

Front‑end

Containerization

Overview

MyFin is a self‑hosted personal finance platform that exposes a well‑structured REST API and a lightweight web UI. At its core, the application ingests transaction data, normalises it via configurable rules, and persists it in a relational database. The API layer is written in Go, leveraging the Gin framework for routing and middleware, while the front‑end uses React with TypeScript for a responsive single‑page experience. Data is stored in PostgreSQL, accessed through the pgx driver, and migrations are managed by golang-migrate. The stack is deliberately minimal to keep the runtime footprint small and to enable straightforward Docker deployment.

Architecture

  • Backend: Go + Gin, compiled to a single binary. The service exposes endpoints for authentication (JWT), account CRUD, transaction import, rule evaluation, and budget calculations. Business logic is split into domain packages (accounts, transactions, rules, budgets) that are unit‑tested in isolation.
  • Database: PostgreSQL 13+, with a schema that normalises entities such as accounts, categories, entities, and a many‑to‑many table for split transactions. Indexes on foreign keys and common query columns (date, amount) ensure efficient aggregation for reporting.
  • Front‑end: React 18 + Vite, using Context API for global state and react-query for data fetching. The UI consumes the same REST endpoints, keeping the client stateless and cache‑friendly.
  • Containerization: A single docker-compose.yml bundles the API, a PostgreSQL container, and a Nginx reverse proxy. The image is built from the Dockerfile in the repo and can be pulled directly from GitHub Packages (ghcr.io/aFaneca/myfin).

Core Capabilities

  • Rule Engine: Developers can define JSON‑based rules that match on fields like description, amount, or date. The engine executes these at import time, auto‑categorising and allocating amounts to budgets.
  • Split Transactions: An API endpoint accepts a parent transaction ID and an array of splits, updating the database atomically via a transaction.
  • Budgets: The budgeting module exposes CRUD operations for monthly budgets and provides an aggregation endpoint that returns spend vs. target ratios, making it easy to plug into dashboards or notification services.
  • Webhooks: Optional outbound webhooks are supported; when a transaction is imported or a rule fires, a POST can be sent to a user‑configured URL for real‑time integrations.

Deployment & Infrastructure

Self‑hosting is the primary focus. The binary requires only Go’s runtime (or a Docker image), PostgreSQL, and an optional reverse proxy. Scaling horizontally is achieved by running multiple API instances behind a load balancer; the database remains a single point of truth, but read replicas can be added for heavy reporting workloads. The Docker image is lightweight (< 200 MB) and includes health checks, making it suitable for cloud VPS providers or on‑premise servers.

Integration & Extensibility

MyFin’s API follows RESTful conventions with JSON payloads, making it trivial to consume from any language. The rule engine’s JSON syntax is documented and can be extended by adding new matchers (e.g., regex, fuzzy string). The project exposes a plugin hook: developers can write small Go modules that register additional endpoints or background jobs, compiled into the same binary. The front‑end is also open source, so custom UI components can be added without touching the backend.

Developer Experience

The repository contains comprehensive README documentation, API OpenAPI specs (auto‑generated via swaggo), and example curl commands. Unit tests cover 90 % of the core logic, and CI pipelines run on GitHub Actions. Community support is modest but active; issues are triaged quickly, and pull requests for new features (e.g., OAuth2 support) are welcomed. Licensing under GPL v3 ensures freedom to modify and redistribute, though it requires derivative works to remain open source.

Use Cases

  1. Enterprise Self‑Hosted Finance – A small business can host MyFin on its internal network, keeping all financial data private while still benefiting from a modern UI and rule‑based categorisation.
  2. Personal Data Sovereignty – Privacy‑conscious users can run MyFin on a Raspberry Pi, syncing only to their own cloud storage via the API.
  3. Custom Budgeting Bots – Developers can build Slack or Discord bots that query the budget endpoint and post alerts when spending exceeds thresholds.
  4. Data‑Driven Analytics – Data scientists can pull raw transaction tables via the API, transform them in Python, and feed them into machine‑learning models for forecasting.

Advantages

  • Performance: Go’s compiled binaries and PostgreSQL’s efficient query engine deliver low latency even with thousands of transactions.
  • Flexibility: The rule engine and split transaction logic are fully exposed, allowing bespoke workflows without modifying core code.
  • Licensing: GPL v3 guarantees that any enhancements remain open, fostering a community of shared improvements.
  • Ease of Deployment: A single Docker Compose file and minimal runtime dependencies make onboarding quick for developers familiar with containerisation.

In summary, MyFin offers a technically robust, extensible platform for developers who need full control over their personal finance data while still leveraging modern web technologies and a powerful rule‑based engine.

Open SourceReady to get started?

Join the community and start self-hosting MyFin today

Weekly Views

Loading...
Support Us

Featured Project

$30/month

Get maximum visibility with featured placement and special badges

Repository Health

Loading health data...

Information

Category
other
License
GPL-3.0
Stars
203
Technical Specs
Pricing
Open Source
Database
PostgreSQL
Docker
Official
Supported OS
LinuxDocker
Author
afaneca
afaneca
Last Updated
13 days ago