Service Portal
Service Portal — Current Dev (Castle Checkers)
Ready for Deployment
Code is complete and committed to GitHub. Worker, D1 migration, and Cloudflare Pages still need to be set up for the castlecheckers environment. See steps below.
Build Status
| Feature | Status |
|---|---|
| Worker API (auth, CRUD, config) | ✅ Complete |
| Migration 0001 (schema) | ✅ Exists |
| Migration 0002 (Castle Checkers seed) | ✅ Complete |
| Public site (config-driven) | ✅ Complete |
| Customer service request wizard | ✅ Complete — submits to API |
| Admin login (real PBKDF2 auth) | ✅ Complete |
| Dashboard | ✅ Complete — live data from API |
| Requests inbox + convert to client | ✅ Complete |
| Clients CRUD | ✅ Complete |
| Appointments CRUD | ✅ Complete |
| Calendar (month + week) | ✅ Complete |
| Invoices with line items + print | ✅ Complete |
| Reports + revenue chart | ✅ Complete |
| Settings (all fields + password change) | ✅ Complete |
| Responsive mobile layout | ✅ Complete |
| Worker deployed to Cloudflare | ❌ Not done |
| D1 migrations run on remote DB | ❌ Not done |
| Cloudflare Pages project created | ❌ Not done |
| castlecheckers.sonandigital.com DNS | ❌ Not done |
Deployment Steps — Castle Checkers
Run all commands from Windows terminal in the project folder:
cd "E:\Claude_Projects\sonan-trackers\caretaker-portal-Claude\caretaker-portal"
# 1. Push code to GitHub
git push origin 802a351f47ee4bfd46ceb9b1210cab43938cc99e:refs/heads/main
# 2. Run both migrations on existing caretaker_db (D1 already exists)
npx wrangler d1 migrations apply caretaker_db --remote --env castlecheckers
# 3. Set JWT_SECRET Worker secret
npx wrangler secret put JWT_SECRET --env castlecheckers
# (enter a random string — generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
# 4. Deploy the Worker
npx wrangler deploy --env castlecheckers
# Note the Worker URL it prints — you'll need it for Step 6
# 5. Build the frontend (verify it compiles)
npm install
VITE_API_URL=https://castlecheckers-api.sonantechai.workers.dev npm run build
# 6. In Cloudflare Dashboard → Pages → Create Project:
# Connect GitHub → sonantechai/caretaker-portal → main branch
# Build command: npm run build
# Output directory: dist
# Environment variable: VITE_API_URL = https://castlecheckers-api.sonantechai.workers.dev
# 7. Add custom domain:
# Pages project → Custom Domains → Add castlecheckers.sonandigital.com
After Deployment — First Login
Default admin password from migration 0002 is Admin@2026. Change it immediately after first login via Settings → Change Password.
Settings page also lets you update the business name, phone, email, address, service types, task checklist, and invoice footer without any code changes.
Known Gaps / Future Work
| Item | Priority | Notes |
|---|---|---|
| Email notifications (new request → admin) | Medium | Resend integration in Worker; send on POST /api/requests |
| Customer portal (view their own requests) | Low | Would need separate auth flow |
| Photo/document attachments | Low | Cloudflare R2 for storage |
| Recurring appointments | Medium | Requires cron + appointments schema change |
| Invoice PDF (server-side) | Low | Current: browser print. Server PDF via puppeteer/wkhtmltopdf would require a separate service. |
| Realtor deployment | Next | New D1 DB + wrangler env + Pages project + seed migration with realtor service types |