PARADIGM MANHOUR PLANNING - CENTRAL OFFICE EDITION
APP UPDATE: 7 OCTOBER 2026

Already using the central program? Follow UPDATE_EXISTING.txt to preserve
your existing database, entries, settings and access codes.

Everyone opens the SAME server address. Colleagues do not run separate EXEs
or choose separate JSON folders. One host computer manages all saved data.

HOST SETUP - DO THIS ON ONE OFFICE COMPUTER ONLY
1. Extract the entire ZIP to a local folder, for example:
   C:\Paradigm_Manhour_Central
   Keep the live application/data outside OneDrive and shared network drives.
2. Install Python 3.11 or newer on this host if it is not already installed:
   https://www.python.org/downloads/windows/
   Use the Windows installer and include the Python launcher / PATH option
   if offered. No additional Python packages or pip installs are needed.
3. TO KEEP YOUR LATEST LOCAL ENTRIES: before the first server start, create
   a 'data' folder beside server.py and COPY your saved manhour-planning.json
   into it. Keep your original JSON file as a separate backup.
   The server imports that file into its database on first startup.
   If no JSON is present, it starts with the included 1,011-entry dataset
   prepared on 7 October 2026.
4. Double-click Start_Server.cmd. Keep the server window open.
5. The window displays the address for colleagues, TEAM ACCESS CODE and
   MANAGEMENT CODE. The browser opens on the host. Enter your name and the
   management code for Field / working days / backups / full import access.
6. Share the displayed OFFICE IP address or computer-name address and the
   TEAM access code with colleagues. Keep the management code private.
7. If another computer cannot connect, right-click Allow_Office_Access.cmd
   and choose Run as administrator on the host. It permits TCP port 8765
   from the local subnet on Private/Domain office networks only. If office
   firewall policy prevents this, ask IT to allow that port on the host.

OTHER USERS
Connect to the same office network, open Edge or Chrome, and enter the
server address provided by the host operator. Enter your name and TEAM code.
You can view all reports and edit team project/employee inputs. Only
management can change dropdown settings, working days or restore a dataset.
Bookmark the address or create a browser desktop shortcut. No Python,
application files or EXE installation is needed on colleagues' computers.

IMPORTING YOUR JSON AFTER THE SERVER HAS ALREADY STARTED
Sign in with the management code. Click Import / restore JSON and select
your manhour-planning.json or a downloaded Manhour Planning backup. Review
the confirmation. This replaces ALL central inputs and settings, not just
one team's rows. A database backup is made before the restore. Existing
users must refresh; old drafts cannot overwrite the restored database.
Copying a JSON file into 'data' after the database exists does not import it.

HOW SHARED SAVING WORKS
Click Save input after entering values. A success message means the host
database committed the change. Other open reports refresh every 5 seconds
while the browser tab is visible and the user is not editing a draft.
The server serialises database writes. Different rows can be saved by many
people without replacing the complete dataset. If two people edit the same
row, the first save succeeds and the stale save is rejected with a message.
The losing draft stays open: copy the desired changes, cancel, then edit the
latest row. The app does not silently merge conflicting values in one cell.
Additional lines preserve planned / delay / modification inputs separately.
Retries of the same saved request do not create duplicate project rows.
If a connection fails, keep the input open and retry the same save. Unsaved
drafts are not stored centrally until Save succeeds; do not close the tab.

WHERE THE DATA LIVES
Live database: data\manhour.sqlite3 on the host computer.
All reads/writes go through server.py. Do not share or sync the live database
file, its '-wal' / '-shm' files, or let other computers open it directly.
The original JSON is an import/backup file; it is not the central live file.
Access codes: HOST_ACCESS_CODES.json, generated on first startup. Do not
share that file, the application folder or the full management code.
Entered names are recorded with edits; they are not individual Microsoft
account identities. Everyone using the team code can edit all team inputs.

BACKUPS AND ONEDRIVE
The server makes consistent database backups at startup, shutdown, before
a full restore, and every 30 minutes while running. It retains 96 recent
snapshots and 30 daily snapshots. Failures appear in the server window and
in the application's backup status. Management can also download a full
JSON backup from the app. Excel exports are report snapshots, not a full
replacement for these database/JSON backups.
To keep automatic BACKUPS in OneDrive: stop the server, edit the generated
server-settings.json and set backup_dir to your OneDrive backup folder.
Example JSON setting (backslashes must be doubled):
  "backup_dir": "C:\\Users\\Binu\\OneDrive - Paradigm\\Manhour Backups"
Use the actual folder on your host, then restart. Keep data_dir local.
Verify a new complete backup appears in OneDrive after startup and that
OneDrive finishes syncing. Backups are private company data; restrict access.

DAILY OPERATION
Keep the host on, connected and awake during working hours. Restart using
Start_Server.cmd after a reboot. Configure an approved startup/logon task
if unattended startup is needed; no Windows service is installed by this
package. Use Ctrl+C to stop the server normally. A closing backup is made.
The server address may change if DHCP changes the host IP; use an IT-reserved
IP or the host computer name for a stable bookmark.
If port 8765 is already used, edit port in server-settings.json and arrange
the matching office firewall rule. Restart and share the new address.

RECOVERY
For JSON backups: use management Import / restore JSON as described above.
For .sqlite3 snapshots: stop the server; make a separate copy of the entire
current data folder; move the current manhour.sqlite3 and any matching
-wal/-shm files out of the active data folder; COPY a known-good completed
SQLite backup into data and rename it manhour.sqlite3; restart. Do not
overwrite a running database. Ask IT to assist if unsure. Do not delete the
original data copy until the restored dataset has been verified.

NETWORK AND ACCESS
This package is intended for the trusted office LAN. Default LAN traffic is
HTTP. Do not expose the port through an internet router. IT can configure
tls_certificate and tls_key in server-settings.json with a trusted server
certificate for HTTPS. Remote offices need an approved VPN or HTTPS setup.
Sessions expire after 12 hours; sign in again to continue. Rotating access
codes alone does not revoke existing sessions: with the server stopped, IT
can remove sessions using SQLite, or wait for expiry.

VALIDATION AND PRACTICAL LIMITS
Integration tests passed for 20 concurrent independent edits, same-row
conflicts, save retries, input validation, soft deletion, settings access,
backup integrity, restore generation protection, importing local JSON and
database reopening after an interrupted uncommitted transaction. The app
bundle built successfully. Windows startup and office firewall scripts
require verification on your actual host; this environment is not Windows.
Transactions, conflict checks and backups reduce data-loss risks; they do
not guarantee zero loss after hardware failure or before an input is saved.
For critical continuity, keep backups on another device/location and use a
UPS for the host. The live database has no fixed application storage quota;
capacity depends on the host disk and backup location.

The existing cloud module and previous local edition are independent of
this office database. Once your imported central data is verified, direct
everyone to this central address for new entries.
