A local-first banking application for small-scale banking operations with a single administrative user. This system allows managing agents, clients, and client accounts with strict business rules around engagement payments, account expiration, and renewals.
- Features
- Business Rules
- User Roles
- Account Lifecycle
- Diagrams
- Technical Stack
- Architecture
- Prerequisites
- Installation
- Development
- Build Commands
- Validation Status
- CI/CD
- Versioning and Release
- Repository Structure
- Contributing
- License
- Local-first architecture with SQLite database and migration support.
- Full admin control over agents and clients.
- Client accounts with fixed engagement amounts and strict payment rules.
- Automatic account expiration and renewal.
- Centralized accounting and transaction history.
- Frontend dashboard with charts and statistics.
- Security: DoS protection, token-based authentication, and rate-limited API.
-
Client Engagement
- Each client has a
montantEngagement(fixed engagement amount). - Payments must exactly match the engagement amount. Partial payments are not allowed.
- Each client has a
-
Payment Schedule
- Clients can pay any day within a 30-day period.
- The first payment at client creation goes directly to the company.
- Subsequent payments are credited to the client account.
- Renewal fees follow the same rules: they go to the company and reset the engagement amount.
-
Account Expiration
- If a client account is empty (balance = 0) and 30 days elapse, the account expires automatically.
- Expired accounts can be renewed by the admin, setting a new engagement period.
- If a client deposits money after creation/reactivation and the 30 days elapse, the account switches to withdraw-only, blocking new deposits.
- An account in withdraw-only mode expires once its balance reaches 0.
-
Agent-Client Relationship
- A client is linked to one agent.
- An agent can have multiple clients.
-
Admin
- Create, edit, or delete agents and clients.
- Deposit or withdraw from any client account.
- Full access to accounting and statistics.
-
Agent
- Assigned to multiple clients.
- Can monitor clientsβ accounts and transactions.
-
Client
- Has a personal account with a fixed engagement amount.
- Makes payments according to the rules above.
flowchart TD
A[Client Account Created] --> B[First Payment -> Company]
B --> C[Subsequent Payments -> Client Balance Updated]
C --> D{30 Days Elapsed?}
D -->|Balance > 0| E[Account becomes Withdraw-Only]
D -->|Balance = 0| F[Account Expires]
F --> G[Renewal by Admin sets new montantEngagement]
E --> H[Account Expiration occurs when Balance = 0]
flowchart TD
Admin -->|Manage| Agent
Agent -->|Manages multiple| Client
Client -->|Linked to 1| Agent
Admin -->|Direct actions| Client
stateDiagram-v2
[*] --> Active
Active --> WithdrawOnly : 30 days passed AND balance > 0
Active --> Expired : 30 days passed AND balance == 0
WithdrawOnly --> Expired : balance becomes 0
Expired --> Active : Renew account (set accountExpiresAt = now + 30 days)
- Desktop Shell: Tauri (Rust)
- Backend: Bun + Express + Prisma + SQLite
- Frontend: React + TypeScript + Vite + Tailwind + DaisyUI
- Package Manager: Bun
- Security: express-rate-limit, token-based authentication
Monorepo structure:
client/β frontend UIserver/β backend APIdesktop/β Tauri desktop host + sidecar launcher
Backend packaging strategy:
- No
bun build --compilefor server sidecar - Runtime packaged as:
server/distserver/node_modules(including.prismaand@prisma/client)server/prisma/migrations
- Sidecar execution:
bun dist/index.js
Windows packaging:
- NSIS
currentUserinstaller mode to avoidProgram Filespermission issues.
- Bun (latest stable)
- Rust toolchain (stable)
- Platform dependencies for Tauri build:
- Windows: MSVC Build Tools
- Linux: GTK/WebKit2GTK development packages
- macOS: Xcode Command Line Tools
# Clone the repository
git clone https://github.com/niagnouma/micro-banking-core.git
cd micro-banking-core
# Install monorepo dependencies
bun install
# Optional explicit installs
(cd client && bun install)
(cd server && bun install)β οΈ Current status: development mode is currently broken and not considered reliable.
Use bundled production builds for validation until dev mode is fixed.
# Frontend dev server
cd client
bun run dev
# Backend dev server
cd ../server
bun run devFrom repository root:
# Windows bundle (NSIS)
bun run build:win
# Linux bundles
bun run build:linux
# macOS bundles
bun run build:macThese scripts orchestrate:
- client production build
- backend runtime staging for Tauri resources
- sidecar binary staging (
bun) - Tauri bundle generation
Current executable validation coverage:
Windows (NSIS .exe): tested on Windows 10 VM and on a physical Windows machine.macOS (.app/.dmg): build available, executable not fully validated on a physical Mac.Linux (.rpm/.deb): artifacts generated, executable not validated on physical Linux machines.
Reason:
- limited access to physical test machines and time constraints.
File: .github/workflows/ci.yml
Runs on push (main), pull_request (main), and manual dispatch:
- π¨ Client checks (lint, type-check, prettier, build)
- βοΈ Server checks (prisma generate, lint, type-check, prettier, build)
- π¦ Desktop Rust checks (fmt, clippy, tests)
File: .github/workflows/build-multi-platform.yml
Builds desktop bundles for:
- π§ Linux
- πͺ Windows
- π macOS
Uploads OS-specific artifacts for each run.
File: .github/workflows/release-tag.yml
Trigger:
- push tags matching
v* - manual dispatch
Builds all platforms and publishes GitHub Release assets.
Current line:
- App version:
0.0.1 - Cargo version:
0.0.1 - Release tag format:
v*(recommended:v0.0.1)
Example release flow:
git checkout main
git pull origin main
git tag v0.0.1
git push origin v0.0.1.
βββ client/
βββ server/
βββ desktop/
βββ scripts/
βββ .github/workflows/
- Fork the repository and create a branch for your feature or fix.
- Follow the existing code style and commit conventions.
- Make atomic commits with clear messages.
- Submit a pull request for review.
- See full guidelines in
CONTRIBUTING.md. - Community standards are defined in
CODE_OF_CONDUCT.md. - Vulnerability reporting is defined in
SECURITY.md.
MIT License.