Download Windows app
# School Accounts 1.4.1

An independent Windows offline desktop application for school accounts, with a sidebar and dashboard inspired by the GPharma workflow. It uses Electron and local SQLite. It does not require Python or an internet connection for normal use.

## Included

- Administrator enrollment and login; no default password.
- Student roll number, class, contact, monthly fee and admission fee month.
- Partial fee collections, remaining monthly balances, and sequential receipts.
- Print/PDF fee receipts and reports.
- Expenses by category, date and payee.
- Teacher directory and daily Present / Absent / Late / Leave attendance.
- Monthly fee balances, collections/expenses and teacher attendance reports.
- Archive/reactivate student and teacher records; no deletion of financial history.
- Void incorrect receipts/expenses with a reason and retained original entry.
- Local database backup/restore, password changes and recent activity.

Exam marks, student attendance, courses and student portals are outside this accounts-focused version. This is a single-administrator, single-computer app; it has no shared server, payroll calculations, online payments or cloud synchronization.

## Windows use

1. Extract the entire `School-Accounts-1.4.1-Windows-x64.zip` into a folder.
2. Open `School Accounts.exe` in that folder; keep the other bundled files beside it.
3. Enter your school name, username and a password of at least 12 characters.
4. Add students, then use Fees Collection to receive payments. Add teachers before marking attendance.
5. Save regular database backups from Settings to a separate drive.

The release is a portable Windows x64 ZIP, not an installer. It is unsigned. Native Windows startup, printing and restore acceptance remain to be checked on Windows; Linux Electron UI and backend tests passed.

## Records and accounting rules

- The app starts empty. The uploaded Flask database and GPharma data are not imported or changed.
- Money is stored as integer paisa. Overpayments are blocked.
- A month's fee is fixed when the first payment is recorded. Later monthly-fee edits affect months without an existing charge.
- Receipts retain the student name, roll and class present at payment time.
- Fee balances apply to the selected fee month. Cash reports apply to transaction dates and exclude voids. Net collections are not a bank balance or full double-entry accounts.
- Attendance counts only marked days; unmarked days are not automatically absent. Salary expenses are manual and do not depend on attendance.
- Business dates use Pakistan time; activity log timestamps are UTC.
- Local data: `%APPDATA%\school-accounts\school-accounts.sqlite`. Backups contain school records and password hashes and should be kept private. The database is not encrypted.
- Restore replaces the active database, keeps a safety copy, and requires signing in with the backup's credentials. There is no password-recovery service.

## Development

Node 22.23 or newer recommended.

```
npm install
npm test
npm start
npm run package:win
```

For an isolated desktop UI test on Linux:

```
xvfb-run -a node tests/desktop-smoke.cjs
```

The test alone uses `--no-sandbox` to support a root-run Linux harness. Normal app startup leaves the renderer sandbox enabled. The renderer has no Node integration or network access and uses a narrowly exposed IPC API. Database writes are validated in the main process.

## Licensing (1.1.0)

Create the local administrator, then open Settings → License & online activation. Enter the SCH activation key supplied by your provider. The provider controls expiry, renewals, suspension and the permitted computer count through the separate School Accounts license dashboard.

Initial activation and regular checks require internet and secure OS credential storage. Signed online authorizations permit up to seven days offline, capped at the subscription expiry. The app checks every 24 hours when running, with bounded retries. Suspension/released devices become read-only after a successful rejection or lease expiry; offline revocation is not instant. Existing records, print/PDF, backup/restore and account settings remain available. License secrets are not included in database backups. Reactivating may be needed on a new computer.

The licensing service receives installation/computer identifiers, app version, and the customer details entered by the provider. School financial and attendance data remain local. School Accounts has a distinct signing key and portal from GPharma. The older 1.0 release remains unlicensed; users must update for enforcement.

Public download: https://school-accounts-downloads.grpharma-raheel.workers.dev/
Private provider dashboard: https://school-accounts-licensing.grpharma-raheel.workers.dev/

## About — 1.1.1

Open About in the sidebar for developer Muhammad Moeen Akhter’s photo, bio, NUML education, email and phone, plus the installed version/build date, runtime details, current device/license status, and support/user-guide addresses. Developer details match the existing GPharma About page. Technology and product information describe School Accounts. The About page remains available when the license is read-only.

To update, close the app, extract the full new Windows ZIP into a separate program folder and open School Accounts.exe using the same Windows account. Data and activation remain in the existing user-data directory. Back up the school database before updating; do not copy or delete the user-data directory.

## Finance workspace & Google Drive — 1.2.0

The redesigned sidebar groups accounts, people and workspace tools. Dashboard shows selected-month cash collections/expenses, fee-month balances and collection progress, six-month payment-date trends, recent receipts and today’s teacher attendance. Search this page filters the visible table rows on the current page.

Open **Backups** from the sidebar:

1. Select **Connect Google Drive**. Your browser opens Google sign-in; choose your account and allow the app-data permission. Normal users do not need to create a client ID. The official build reuses the provider’s existing GPharma desktop OAuth app configuration, so Google may display its registered app name. School Accounts uses a separate backup namespace and a separate OS-encrypted account-token file.
2. Enter and confirm a **backup password of at least 12 characters**. Keep it separately: the app does not save it and there is no password reset for encrypted backups. This password is independent of your administrator password and license key.
3. Select **Back up to Google Drive**. A consistent SQLite snapshot is encrypted locally using AES-256-GCM and scrypt before upload. The uploaded file is checksum-verified and then marked as a recovery point.
4. Select **Refresh backups** to list recovery points. These are in Google’s private application-data storage, not normal My Drive folders.
5. To restore, choose a backup, enter its backup password, then confirm the school/date in the native dialog. Authentication, checksum and database-schema checks run first. Current data is saved to a safety copy before replacement. You must sign in with the account stored in that backup.

Cloud backups are manual; no background schedule or automatic deletion is enabled. Internet and secure OS credential storage are needed to connect/upload/download. Failed uploads leave the active database intact; temporary snapshots are removed. Database size limit for cloud backup: 256 MB. Local backup/restore remains available; local .sqlite exports are not encrypted. Backup/restore works while the license is read-only.

Google account tokens and any advanced client override stay encrypted with the OS vault, outside the renderer and outside school database backups. Signing keys and account refresh tokens are never embedded in releases. Google desktop OAuth application credentials are public-client configuration and are compiled into the main-process Drive module only.

Real Google consent, Windows secure credential storage and a live customer-account round trip still need acceptance on the customer’s Windows computer. Automated tests use mocked Google transport and isolated databases, not a customer’s Google account.

Developer builds: `SCHOOL_GOOGLE_BUILD_CONFIG_FILE` may point to a private Desktop OAuth JSON file. The normal build reads `.secrets/google-desktop-client.json` if present; without it, Advanced Google app setup is available. Do not distribute account tokens or the issuer private key.

Implementation references: [Google desktop OAuth with PKCE](https://developers.google.com/identity/protocols/oauth2/native-app) and [private application-data storage](https://developers.google.com/workspace/drive/api/guides/appdata). Disconnect removes this app’s local connection; your existing Drive recovery points remain.

## Fee slips, paid receipts & student workspace — 1.3.0

**Students** now opens the full directory with name/roll/class/contact search, class/status/fee-status filters, fee-month selection, sorting and 20-row pagination. Open a student’s Profile for contact/admission details, the selected month’s balance, issued fee slips and all payment receipts. Add/edit/archive/reactivate controls preserve payment history.

**Fee Slips** issues a numbered monthly challan before payment. Select the student, fee month, issue date and due date. Issuing freezes that month’s fee amount but records no payment. Each student/month has one slip; duplicate issue requests return it. Slips retain student/class/school details present at issue. They cover the selected fee month, rather than automatically combining past-month arrears.

Use **Print / PDF** for a styled A4 document with parent/student and school office copies. Unpaid/partly-paid/settled status and current valid-payment balance are shown. A payment request is explicitly not payment proof. **Collect** opens the fee form with that student, month and current balance selected.

**Receipts** prints a matching green paid-fee acknowledgement. It shows the received amount on that specific receipt, payment date/method, monthly fee and current fee-month balance. A partial payment is distinguished from a paid-in-full month. Voided receipts are prominently marked and excluded from balances. Original receipt/student details are retained; balance totals on reprints reflect valid payments as of the printed date.

Old databases and backups upgrade automatically with the new fee-slip table; license identity and Google Drive connection remain unchanged. Creating slips requires a valid posting license, while viewing and printing existing slips remains available in read-only mode.

Complete demonstration screenshots and sample PDFs are provided separately. The release starts empty and contains no demonstration school records.

## Detailed school accounts — 1.4.0

Based on the supplied school form and notes:

- **Fourteen fee particulars:** registration, admission, refundable security, monthly tuition, annual, examination, stationery/test-series, science lab, computer lab, sports fund, library, activity, transport and miscellaneous charges. Transport and miscellaneous amounts have separate remarks; miscellaneous charges require remarks. Monthly and transport plans are prefilled per student. Other charges are explicitly entered, not silently repeated. No automatic security refund/forfeiture or blanket non-refundable policy is applied.
- **Detailed challans/receipts:** side-by-side School copy and Student copy on A4 landscape, ID, class, fee month, dates, fee heads, total, paid and balance, notes, Accountant and Received by signature lines. School address/contact/tagline/default notes can be set in Settings.
- **Class printing:** select class/month and Generate & print class. Up to 200 eligible students per batch; each gets both copies. Active existing bills are reused, settled accounts skipped. Bulk generation uses each student’s monthly + transport plan; individual itemised bills already issued remain intact. Bulk operations are transactional.
- **Defaulters:** explicit from/through month range, contact/class/status, outstanding balance and print/PDF. Issued amounts are fixed; unissued months use the current monthly/transport plan. A range of up to 120 months is supported.
- **Departure:** Withdrawn and Left statuses retain dues through the selected departure month. Later automatic dues stop and later unpaid challans are cancelled while retaining their original document snapshots. Valid future payments block backdating until those payments are resolved. Old arrears may still be collected. Reactivation clears the end month and permits a new numbered bill; cancelled documents remain in history.
- **Corrections:** an unpaid challan can be cancelled with a reason and replaced by a new numbered bill. Paid bills cannot be cancelled while valid payments exist. Cancelling does not stop the student’s normal monthly plan; withdrawal is the explicit billing-stop operation.
- **Staff:** Teacher, Administration, Admin, Accounts, Principal, Coordinator and Support Staff positions; CNIC, contact, address, subject/department, salary plan, joining and leaving dates. These are job designations, not additional application login roles.
- **Manual payroll:** choose salary month, basic salary, allowances and deductions. Attendance never automatically changes salary. A salary payment posts one linked Salary expense and prints a salary payslip. Duplicate valid staff/month payments are blocked. Voiding the payroll or its linked expense voids both, after which a corrected payment can be entered. Joining/leaving months bound eligible salary months; no automatic proration is applied.
- **Expenses:** added Stationery, Cleaning, Transport, Print, Refreshment and Purchase categories.

Older databases/backups upgrade automatically with preserved student/receipt/slip IDs and fixed amounts. New billing/payroll tables are included in local and encrypted Google backups. Keep a verified backup before updating. The app remains single-admin and offline-first. Native Windows printing and real Google account acceptance remain pending on the customer computer.

After upgrading to 1.4.0, update your Windows shortcut to the new School Accounts.exe and use that version for the upgraded database. Earlier executables do not understand the new fee particulars, departure and payroll records. Use a verified pre-upgrade backup if a rollback is required.

## GPharma visual design

The desktop interface follows the local GPharma ERP theme: white navigation, emerald actions, slate surfaces, compact forms and tables, tabular financial totals and coordinated dashboard charts. Use the sidebar chevron to collapse or expand navigation; icon buttons retain accessible names and tooltips. The top bar offers fee collection and expense shortcuts. School branding, accounting rules, local records, licensing and backups retain their existing behavior.

## Interface update — 1.4.1

The desktop now follows GPharma's white sidebar, emerald actions and slate workspace. Collapse navigation using the sidebar chevron. Table actions use round icons; hover for the action name. Fee collection and expense shortcuts sit in the top bar. Fees, expenses, payroll, documents, licensing and backup behavior remain compatible with 1.4.0. Extract this complete ZIP into a new program folder and open the new executable with your existing Windows account.