Skip to content

Latest commit

 

History

History
113 lines (78 loc) · 4.56 KB

File metadata and controls

113 lines (78 loc) · 4.56 KB

Roofers App – Architecture Overview

Overview

Roofers App is a closed‑source Windows .exe application built for offline operation, secure license enforcement, and automated reporting. It provides a fast, local Operational CRM tailored specifically for roofing production workflows, including tear‑off, installation, repairs, payroll, and material tracking.

Unlike cloud‑based CRMs, the system runs entirely on the user’s machine or internal network, ensuring reliability, data ownership, and zero external dependencies.

The application supports both SQL Server Express and Full SQL Server, selected during installation.


Architecture

Role‑Based Access Control (RBAC)

All AIAI applications now include a unified, secure RBAC system designed for multi‑admin environments and professional data governance.

Global Admin Full system access. Can configure company‑wide settings, manage other admins, control data sources, and access all modules.

Local Admin Operational access only. Can manage day‑to‑day tasks such as employees, jobs, materials, time entries, invoices, or inventory (depending on the app). Cannot modify global settings or create new companies.

Admin‑Only Registration Only administrators can register accounts. No employee or installer self‑registration is allowed.

Dynamic UI Permissions Each screen automatically adapts to the user’s role. Restricted modules are hidden or blocked with clear access messages.

Centralized Permission Enforcement All role checks are handled through a unified RBAC engine to ensure consistent security across every module and workflow.

Multi‑Admin Support Global Admin customers can add additional administrators using the Admin Add‑on. Each admin receives their own secure login and role‑based access.

This RBAC system ensures secure, scalable, and professional‑grade access control across all AIAI applications.

Database Selection (Installer‑Driven)

During installation, the user selects one of two supported database modes:

1. SQL Server Express (Local Database – Recommended for 1–5 Users)

  • Installer automatically installs and configures SQL Server Express
  • Ideal for single‑machine setups or small office networks
  • No licensing cost

2. Full SQL Server (Standard/Enterprise)

  • User connects to an existing SQL Server instance
  • Supports multi‑user environments and IT‑managed deployments
  • Designed for medium to large roofing companies

The installer writes a registry flag (UseSQLExpress) that determines which connection setup page the application loads on first launch.


License Enforcement Flow

A valid Stripe subscription is required to use this application.

• On first launch, the app checks your subscription status securely through Stripe. • If your subscription is active, the app unlocks full access. • If your subscription is canceled, expired, or unpaid, access is restricted. • Internet is required only during subscription verification and plan changes. • All billing and upgrades are handled through Stripe’s secure checkout.


Local Session Context

  • All data is stored in SQL Server Express or Full SQL Server
  • No cloud sync, Redis, or external session store
  • Secure login using salted + hashed admin credentials
  • Fully offline operation after initial license activation

Data Transfer Between Computers

The app includes a built‑in SQL migration tool for moving data to a new machine:

  • Creates a .bak backup file from the old computer
  • Restores the .bak file on the new computer
  • Works for both SQL Express and Full SQL Server
  • Ideal for machine upgrades or office migrations

SQL Connection Pages

The application routes users to the correct connection setup page based on installer selection:

  • sql_connection_page.py – SQL Express
  • sql_server_connection_page.py – Full SQL Server

Both pages support:

  • Connection testing
  • Credential validation
  • Database creation (if needed)
  • Secure admin login setup

Payroll & Work Ticket Workflow

Admin Login → Roofing Work Ticket Entry → Payroll Calculation → Excel Export

  • Admin enters job details, roofing crew info, materials used, and tasks completed
  • Payroll supports multiple calculation methods:
    • Squares installed × rate
    • Bundles / rolls / LF × rate
    • Hourly wage
    • Flat rate per job
  • Pay is automatically split across workers per job
  • Excel payroll reports are generated two days after the pay period ends

File Storage & Export

All reports are stored locally