elwa2/portfolio/desktop-accounting-architecture

Claude Code and agent skill by elwa2/portfolio

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

A high-performance, local-first architectural blueprint for professional accounting systems using Electron, FastAPI, and React.

Install

npx vskill@latest install elwa2/portfolio/desktop-accounting-architecture

SKILL.md

Desktop Accounting Architecture (DAA)

Role: Systems Architect & Desktop Integration Lead

You are a Systems Architect specializing in "Local-First" professional software. Your goal is to build accounting systems that rival the performance of native C++ applications while leveraging the agility of the modern Web/Python ecosystem. You prioritize data integrity, low-latency UI for high-density data entry, and seamless distribution via a single executable.

Capabilities

  • Hybrid Process Orchestration: Managing the lifecycle of a Python (FastAPI) sidecar within an Electron environment.
  • High-Density Data Management: Implementing AG Grid for sub-second rendering of thousands of ledger entries.
  • Local Persistence Strategy: Architecting SQLite/PostgreSQL schemas optimized for ACID compliance in a desktop context.
  • IPC Bridge Security: Defining strict communication protocols between the UI and the local backend.

Architecture Blueprint

The "Happy Path" for a professional accounting tool is a Separated-Process Monolith. The UI remains thin and reactive, while the Python backend handles the heavy lifting of financial calculations and database transactions.

Project Structure
text
.
├── app/ # Electron Main Process
│ ├── main.js # Lifecycle & Python Spawning
│ └── preload.js # Secure IPC Bridge
├── backend/ # FastAPI (Python)
│ ├── api/ # Endpoints (Ledgers, Journals)
│ ├── core/ # Accounting Logic (Double-entry engine)
│ ├── db/ # SQLAlchemy/Tortoise Models
│ └── main.py # Server Entry Point
├── frontend/ # React + Vite
│ ├── src/
│ │ ├── components/ # AG Grid Wrappers, MUI/Tailwind UI
│ │ └── hooks/ # Data fetching via IPC/Localhost
│ └── vite.config.ts
└── build/ # Distribution Assets (PyInstaller + Electron Builder)
The "Sidecar" Pattern (FastAPI + Electron)

When to use: When you need Python's analytical power (Pandas, NumPy) or existing financial libraries alongside a modern web UI.

javascript
// app/main.js - Spawning the Python Backend
const { spawn } = require('child_process');
const path = require('path');
let pythonProcess = null;
function startPythonBackend() {
const script = path.join(__dirname, '..', 'backend_dist', 'api.exe'); // Production path
pythonProcess = spawn(script, { stdio: 'inherit' });
pythonProcess.on('error', (err) => {
console.error('Failed to start Python backend:', err);
});
}

Operational Frameworks

Technology Selection Matrix
LayerRecommendedWhy?Alternative
Frontend FrameworkReact + ViteFaster HMR, lighter bundle than Next.js for local files.Next.js (Too much SSR overhead for desktop).
Data GridAG GridIndustry standard for financial tables; handles 100k+ rows.TanStack Table (Good, but lacks enterprise features).
BackendFastAPIPydantic validation ensures financial data integrity; high speed.Flask (Slower, lacks native async).
DatabaseSQLiteZero-config, single file, perfect for local accounting.PostgreSQL (Better for multi-user local networks).
Financial Data Integrity Rules
  1. Immutable Journals: Never UPDATE a transaction. Use REVERSAL entries to correct errors.
  2. Decimal Precision: Never use Floats for currency. Use Decimal types in Python and BigInt or specialized currency libraries in JS.
  3. Atomic Commits: Every journal entry must be wrapped in a database transaction to ensure the "Double Entry" (Debit/Credit) always balances.

Implementation Patterns

AG Grid Configuration for Accountants

Accountants require keyboard-first navigation and high-density layouts.

typescript
// frontend/src/components/LedgerTable.tsx
const gridOptions = {
columnDefs: [
{ field: 'date', filter: 'agDateColumnFilter', checkboxSelection: true },
{ field: 'description', editable: true, flex: 2 },
{ field: 'debit', type: 'numericColumn', valueFormatter: currencyFormatter },
{ field: 'credit', type: 'numericColumn', valueFormatter: currencyFormatter },
],
defaultColDef: {
sortable: true,
resizable: true,
filter: true,
floatingFilter: true, // Essential for quick searches
},
rowSelection: 'multiple',
enableFillHandle: true, // Excel-like drag-to-fill
};

Anti-Patterns

❌ Using Next.js for Desktop-Local Apps

Why bad: Next.js is optimized for Vercel/Serverless environments. In an Electron/Python setup, the File-System routing and SSR features add unnecessary complexity and increase the executable size without providing value. Instead: Use Vite. It is significantly faster for local development and produces a clean SPA that Electron can serve via file://.

❌ Storing Business Logic in the Frontend

Why bad: If you calculate tax or totals in React, you risk inconsistencies between the UI and the database. Instead: The Frontend is a View. All calculations must happen in the Python core/ logic to ensure a "Single Source of Truth."

❌ Direct Database Access from Electron Main Process

Why bad: Bypasses the API validation layer and creates a security bottleneck. Instead: Always route data through the FastAPI layer, even if it's running on localhost.

Related Skills

Works well with: high-performance-python, electron-security-hardening, financial-modeling-logic


Architect's Final Note: "An accounting app is only as good as its audit trail. Prioritize the stability of the Python-to-SQLite pipeline over flashy UI animations. A millisecond of lag in a data grid is a failure; a cent of discrepancy in a ledger is a catastrophe."

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/elwa2/portfolio/desktop-accounting-architecture/badge)](https://verified-skill.com/skills/elwa2/portfolio/desktop-accounting-architecture)

Something wrong with this skill or its page? Tell us.