How opencore-x/opensociety works
OpenSociety serves residents, gate staff, and community administrators through native mobile and web apps backed by a society-specific API and database. The main workflow is a user action in an app, an authenticated API request, and a domain operation that reads or updates community records; gate staff can also queue visitor registration offline. The product spans visitor access, community operations, and finance/reporting, with push, identity, and file-storage integrations. Some route and client internals were not sampled, so uncertain links are omitted or marked unverified.
Main entry points: index.ts API runtime · app Mobile app · middleware.ts Identity and access · reports.ts Reports and exports
Components 22
User apps
- Mobile app
apps/mobile/app - Offline visitor queue
apps/mobile/lib/offline/query-client.ts - Admin dashboard
apps/web/src/routes/admin - Mobile API client
apps/mobile/api/client.ts
API and access
- API runtime
apps/api/src/index.ts - Identity and access
apps/api/src/middleware.ts - Push dispatch
apps/api/src/lib/push-dispatch.ts
Community operations
- Visitor access
apps/api/src/routes/visitors.ts - Community management
apps/api/src/routes/apartments.ts - Gate operations
apps/api/src/routes/guards.ts - Notices and tickets
apps/api/src/routes/notices.ts - Household help
apps/api/src/routes/house-help.ts
Finance and reporting
- Billing and payments
apps/api/src/routes/bills.ts - Ledger posting
apps/api/src/lib/ledger-posting.ts - Reports and exports
apps/api/src/routes/reports.ts
Persistence and services
- Society database
packages/db/src/client.ts - Clerk identity
- Cloudflare R2
- Expo Push
Other components
- Resident
- Gate staff
- Administrator
Connections 24
- Resident → Mobile app: uses
- Gate staff → Mobile app: uses
- Administrator → Admin dashboard: manages community
- Mobile app → Mobile API client: requests data
- Mobile API client → API runtime: calls API
- Admin dashboard → API runtime: calls API
- Offline visitor queue → Mobile app: queues registration
apps/mobile/lib/offline/query-client.ts - API runtime → Identity and access: applies access
apps/api/src/index.ts - API runtime → Visitor access: routes requests
apps/api/src/index.ts - API runtime → Community management: routes requests
apps/api/src/index.ts - API runtime → Gate operations: routes requests
apps/api/src/index.ts - API runtime → Notices and tickets: routes requests
apps/api/src/index.ts - API runtime → Household help: routes requests
apps/api/src/index.ts - API runtime → Billing and payments: routes requests
apps/api/src/index.ts - API runtime → Reports and exports: routes requests
apps/api/src/index.ts - Billing and payments → Ledger posting: posts bills
apps/api/src/routes/bills.ts - API runtime → Society database: creates database client
apps/api/src/index.ts - Identity and access → Society database: loads user records
apps/api/src/middleware.ts - Identity and access → Clerk identity: verifies sessions
apps/api/src/middleware.ts - Reports and exports → Society database: queries records
apps/api/src/routes/reports.ts - Reports and exports → Ledger posting: reads ledger data
- API runtime → Push dispatch: dispatches pushes
apps/api/src/index.ts - Push dispatch → Expo Push: sends notifications
- API runtime → Cloudflare R2: stores uploads