How braydio/pynance works
Project type and purpose
• pyNance is a full-stack personal finance dashboard.
• Backend: Flask application exposing REST API endpoints for account linking, transaction sync, category logic, CSV export, and webhook handling.
• Frontend: Vue.js single-page application (SPA) that consumes the Flask API to render charts, tables, and settings.
• Integrations: Plaid and Teller external services for banking data.
File structure
Top-level separation
• /backend – Python Flask service
• /frontend – Vue.js app with Vite, Tailwind, and Cypress tests
• config files (.env templates, requirements.txt, package.json)
Backend modules
• app/config – environment, logging, paths, Plaid/Teller setup
• app/extensions – Flask & SQLAlchemy initialization
• app/models – database schema (SQLAlchemy models)
• app/sql – business logic for data read/write (account_logic.py, category_logic.py, etc.)
• app/helpers – SDK wrappers for Plaid/Teller and import utilities
• app/routes – Flask blueprints defining API endpoints (/api/accounts, /api/transactions, /api/plaid, etc.)
• migrations – Alembic scripts for schema migrations
• run.py – entry point for Flask
Frontend modules
• src/main.js & App.vue – application bootstrap
• src/router – Vue Router configuration for views
• src/views – top-level pages (Dashboard.vue, Accounts.vue, etc.)
• src/components – reusable UI elements and chart wrappers
• src/api & src/services – API client modules communicating with Flask (axios wrappers)
• src/styles – global and component styles
• cypress – end-to-end tests
Extract architectural insights from README
• Monolithic backend with clear layering: config → extensions → models → business logic → routes
• SPA front end communicating over a single API base URL
• Environment variables drive external service configuration and API base URL
• Logging is centralized via config/log_setup.py
a. Main components
• User browser / SPA (Vue.js app)
• Flask REST API (backend/app)
• Relational database (e.g., Postgres via SQLAlchemy)
• External services: Plaid and Teller
• Message flows: optional webhooks from Teller
b. Relationships and interactions
• Browser sends HTTP(S) requests to Flask endpoints (GET /api/transactions, POST /api/refresh_accounts, etc.)
• Flask routes call helpers to fetch/update data from Plaid/Teller or database
• SQLAlchemy models persist data in the relational database
• Webhook endpoint (/api/teller_webhook) receives asynchronous updates from Teller
• Flask logs events to local file via log_setup
c. Architectural patterns and design principles
• Layered architecture (Configuration → Extensions → Models → Business Logic → Routes)
• Blueprints for modular API grouping (accounts, transactions, categories, exports)
• Separation of concerns: helpers for external SDK logic, sql/ for DB logic, routes/ for HTTP layer
• SPA pattern: decoupled UI and API
• Environment-driven configuration
d. Key technologies and frameworks
• Flask, Flask-Blueprints, SQLAlchemy, Alembic (backend)
• Vue.js 3, Vue Router, Vite, Tailwind CSS (frontend)
• Axios or fetch (API calls)
• Plaid SDK, Teller API wrappers
• Cypress for E2E testing
Diagramming conventions
• UI components (blue)
• Backend modules (green)
• Data stores (orange)
• External services (gray)
Detail
– Include environment variable loader → config/environment.py.
– Show log pipeline configured by config/log_setup.py.
– Represent Alembic migrations as a side-car to the database.
– Highlight static asset serving (Flask’s static folder) if relevant.
– Capture the dual setup for Plaid vs. Teller integration paths.