Documentation hr-management-static-website/ARCHITECTURE.md

System Architecture

← workflow-tools Overview View Source Markdown ↗
System ArchitectureReact + ViteContributing to Bulk WhatsApp SenderFeatures & UsageGetting Starteddocs

System Architecture

Overview

This application is a Single Page Application (SPA) that acts as a wrapper around a local SQLite database. It leverages sql.js to run SQLite entirely in the browser memory, using the File System Access API (where supported) to read/write directly to a local file.

Directory Structure

src/
├── components/       # UI Components
│   ├── EmployeeTable.jsx  # Main data grid & PDF generation logic
│   ├── EmployeeForm.jsx   # Add/Edit Modal
│   └── Settings.jsx       # Company config form
├── db/
│   └── database.js   # Core Database Layer (init, migrations, I/O)
├── utils/
│   ├── dbService.js  # Business Logic Layer (CRUD operations)
│   ├── csvParser.js  # CSV Import Utility
│   └── EmailService.js # Email logic (Stub/Mailto)
└── App.jsx           # Main Router & Layout

Key Modules

1. Database Layer (src/db/database.js)

2. Business Logic (src/utils/dbService.js)

3. PDF Generator (src/components/EmployeeTable.jsx)

Testing Strategy

🧠 AI & Developer Context (The "Brain")

This section helps AI agents and developers understand the core logic flow:

Data Flow

  1. User Action: User clicks "Save Employee".
  2. UI Component: EmployeeForm.jsx validates and calls onSave.
  3. App State: App.jsx receives data and calls DBService.addEmployee().
  4. Business Logic: src/utils/dbService.js prepares the SQL query (INSERT/UPDATE).
  5. Database Layer: src/db/database.js executes the SQL against the in-memory SQLite WASM instance.
  6. Persistence: database.js immediately triggers saveDatabase() to write the binary buffer back to the user's local disk via File System Access API.

Key Schema Validation

Future Roadmap

← Back to workflow-tools