Engineering
Local setup
How to run the Rails platform and the Expo app. Secrets stay in credentials, not in this wiki.
Open this wiki
open wiki/index.html
Or double-click wiki/index.html. No server needed. The running platform also serves it at /wiki.
Platform
Rails 8.1.3.1 fullstack app in platform/: public web, workspace (/app), Admin console (/admin), and the staff JSON API (/api/v1).
Prerequisites
- Ruby 4.0.2 (
platform/.ruby-version) and Bundler - PostgreSQL
config/master.keyso encrypted credentials can be read
Foreman is installed by bin/dev if missing. Node is not required; Tailwind uses the tailwindcss-rails binary.
Credentials
All environments read PostgreSQL host, port, username, and password from credentials.dig(:database, :production).
cd platform
bin/rails credentials:edit
Expected keys (values stay in credentials, not in git): database.production, amazon.s3, amazon.ses, amazon.sms, super_user, google, facebook, apple, stripe.production / stripe.development, deploy. Stripe reads production in production and development otherwise.
config/master.key is gitignored. Without it the app will not boot. Never paste passwords or keys into the wiki.
Databases
| Environment | Name |
|---|---|
| development | taskpaws_development |
| test | taskpaws_test |
| production primary | taskpaws |
| production cache / queue / cable | taskpaws_cache, taskpaws_queue, taskpaws_cable |
Run
cd platform
bin/setup --skip-server
bin/dev
App at http://localhost:3000. Health: GET /up. Jobs: bin/jobs. Tests: bin/rails test and bin/ci. bin/setup installs gems and prepares the database (migrations plus SuperUser seed); pass --reset to rebuild from scratch.
Production recurring jobs (config/recurring.yml): finished-job cleanup, stale QR upload session purge, Billing::RenewDueSubscriptionsJob daily at 6am, and AppointmentReminderJob every 5 minutes.
Storage and locales
Active Storage uses S3 (amazon service, us-west-2, bucket taskpaws-<env>) in every environment. English default; Spanish from the marketing nav, /app profile menu, or Admin language menu (cookie) or when Accept-Language prefers es. YAML UI copy lives in en.yml / es.yml; landing plan/feature marketing is edited at Admin /admin/translations. Guide: docs/architecture/translations.md.
Routes
| Path | What |
|---|---|
/, /login, /register | Landing, staff login (email + Google / Apple / Facebook), create account / start trial |
/app | Workspace home: clinic radar at a Location, SaaS billing widgets |
/app/settings | Hierarchy, legal entities, locations, location groups (Elite), SaaS billing; /app/billing redirects there |
/app/staffs | Users & roles: invite, resend, disable/enable, role assignment |
/app/patients, /app/clients | Patient charts and pet parents |
/app/schedule | Location appointment calendar (/app/appointments writes) |
/app/whiteboard, /app/visits/:id | Visit board (Floor / Pipeline / List) and Visit 360 workspace |
/app/catalog, /app/pricing_groups, /app/patient_groups | Catalog and pricing |
/app/appointment_types | Appointment types (duration, color, catalog item, deposit) |
/app/tax_groups, /app/taxes | Taxes with Location overrides |
/app/inventory | Per-Location stock |
/app/checkout, /app/invoices, /app/credit_notes, /app/deposits | Clinic sales, invoices, credit notes, payments, deposits |
/app/tips, /app/commissions, /app/commission_groups | Staff tips and commissions |
/app/notification_settings | Client email/SMS notifications and templates |
/api/v1 | Staff JSON API (Bearer token) used by mobile/ |
/admin/login, /admin | SuperUser login and dashboard |
/admin/users, /admin/super_users, /admin/organizations | Staff accounts (impersonate, invites), super admins, organizations (trial days, credits, plan) |
/admin/plans, /admin/translations, /admin/billing_transactions | SaaS plans, marketing translations, SaaS charges |
/admin/breeds, /admin/catalog_item_categories, /admin/observation_kinds | Platform catalogs |
/admin/roles, /admin/actions, /admin/audits, /admin/settings | RBAC catalog, audit log, platform settings |
/intake/:token, /plans/:token, /photo_uploads/:token | Public token pages: patient intake, treatment plan approval, QR photo upload |
/webhooks/stripe | Stripe SaaS billing webhooks |
/privacy, /terms, /facebook/deletion, /locale/:locale, /up | Legal, Facebook deletion, language cookie, health check |
Mobile
Expo SDK 58, React 19.3.0, React Native 0.88.0, TypeScript strict. State and API: Redux Toolkit slices (src/store) calling src/api through an axios httpClient. Entry: index.ts → src/App/App.tsx. Docs: Expo v58.
Prerequisites
- Node.js and npm
- Expo Go on a device, or iOS Simulator / Android Emulator
cd mobile
npm install
npm start
Then npm run ios, npm run android, or npm run web. The API origin comes from EXPO_PUBLIC_API_BASE_URL (default http://localhost:3000). Native ios/ and android/ are gitignored; generate with Expo prebuild when needed. App chrome strings: src/i18n/locales/en.json / es.json.
Status
Screens (phone and tablet layouts) run against /api/v1:
| Screen | Behavior |
|---|---|
| Login / Register | Email and password, Google / Apple / Facebook, trial register |
| Home | Workspace switcher, trial banner, new appointment. Stats and agenda cards are sample data |
| Schedule | Appointments with types, walk-ins, check-in, undo check-in. Pull to refresh |
| Patients / Clients | Directory, detail, create and edit |
| Staff | Directory, invite, resend, edit, role assignments |
| Organization | Settings: organization, legal entities, locations |