Skip to content

Prepare shared hosting with reliable billing recovery - #110

Merged
ankitsejwal merged 15 commits into
mainfrom
ankitsejwal/lucidity-unfinished-work
Oct 2, 2026
Merged

ankitsejwal merged 15 commits into
mainfrom
ankitsejwal/lucidity-unfinished-work

Conversation

@ankitsejwal

@ankitsejwal ankitsejwal commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

I prepared OpenSociety for the shared DigitalOcean Droplet. The API and web now run in separate Node containers, with R2 uploads and database-backed push recovery. Billing is opt-in, catches up the current month after restart, and retries failed ledger posting. Container builds enforce HTTPS and Clerk configuration, and the deployment guide covers migrations, Caddy, and rollback.

Local development runs through pnpm dev, with Turborepo rebuilding shared packages and restarting the API/web. Docker image builds and smoke tests run in GitHub Actions to keep their storage off the Mac.

While adding restart recovery, I found that concurrent billing runs could create duplicates and failed line inserts could leave incomplete bills or journals. Migration 0024 adds monthly uniqueness, and both writes are now atomic. Monthly ledger posting also uses batches of 100 instead of several database requests per apartment. Existing duplicate monthly bills need review before applying the index; the migration does not delete records.

Build, type-check, lint, and all tests pass, including 1,000-apartment PostgreSQL billing and ledger checks. Both Docker images build and pass smoke tests for SSR, static assets, CORS, non-root execution, and graceful shutdown under the proposed restrictions. CI now repeats those container checks on Linux.

The Droplet is not provisioned. No production database, DNS, store release, or hosting deployment changed. Actual staging capacity and physical-device push delivery remain unverified.

@ankitsejwal
ankitsejwal merged commit 614db07 into main Oct 2, 2026
2 checks passed
ankitsejwal added a commit that referenced this pull request Nov 13, 2026
The mobile redesign in #110 and #111 rewrote the screens the phone demo
touched. I kept the redesigned screens and re-applied the demo changes on
top: each screen reads its API client from the session, the home screen
hides the Resident/Gate toggle during a demo and shows the demo identity
instead, and sign-in gets the demo entry through a SignInForm slot.

Push registration stays inside the live Clerk tree, so a demo never
registers a device. The demo client answers the new vehicle alert and
returns an error for push token calls. Mobile tests now run both the
vitest demo suites and the node build-environment test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant