Implementation Plan & Costing
Phased build plan for the Proximity Green platform, implemented with Claude Code and a senior developer. Covers all 18 architecture requirements.
Approach: Claude Code + Senior Developer
Claude Code fundamentally changes the implementation model. Instead of a team of 4–6 developers over 12+ months, a single senior developer working with Claude Code can deliver the platform in 6 phases over ~20 weeks.
| Factor | Traditional Team | Claude Code + 1 Senior Dev |
|---|---|---|
| Team size | 4–6 developers | 1 senior developer + Claude Code |
| Timeline | 12–18 months | ~20 weeks (5 months) |
| Code velocity | ~200 lines/day per dev | ~2,000+ lines/day (AI-assisted) |
| Documentation | Often neglected | Generated alongside code |
| Test coverage | Varies (often low) | AI generates tests with each feature |
| Human role | Write all code | Architect, review, direct, decide |
The senior developer's role shifts from writing code to architecture, decision-making, code review, and directing Claude Code. This is more demanding in some ways — the developer must be strong enough to review and guide AI output — but dramatically faster in total throughput.
Timeline
Build Phases
Phase 1: Foundation
Database, auth, API skeleton, RBAC, media storage, deployment pipeline. Reqs 1, 2, 3, 4, 6, 17, 18.
- ✓ PostgreSQL schema design & migrations (Drizzle ORM) — all core tables from WSM data model review
- ✓ Auth layer: OAuth 2.0 via Clerk, Google login, SALTOK token issuer endpoint
- ✓ API skeleton: Hono framework, versioned routes (
/api/v1/), OpenAPI spec generation - ✓ RBAC middleware: role definitions, permission scoping by org/location
- ✓ Input validation: Zod schemas for all endpoints
- ✓ Data validation framework: Zod schemas with configurable field rules table (Req 17)
- ✓ Media storage: Cloudflare R2 bucket + Image Transformations for on-the-fly resize/webp/avif (Req 18)
- ✓ Media upload API: validation, UUID naming, metadata in PostgreSQL, originals in R2
- ✓ CI/CD: GitHub Actions → Cloudflare Workers deployment
- ✓ Dev environment: Docker Compose for local PostgreSQL + Redis
- ✓ Error monitoring: Sentry integration
- ✓ API documentation: auto-generated from OpenAPI spec
Phase 2: Core Business Logic
Members, organisations, locations, spaces, bookings, CRM. Reqs 5, 6, 13.
- ✓ Service layer: Location, Organisation, User, Membership, License CRUD
- ✓ Booking engine: availability checks, conflict detection, peak/off-peak pricing, half/full-day discounts
- ✓ Check-in/presence system: QR code, direct login, federated PIN
- ✓ CRM: Lead, Opportunity, Task, Track, Contact models & services
- ✓ Event system: domain events (BookingCreated, MemberOnboarded, etc.) via Inngest
- ✓ Notification service: email templates (Resend), SMS hooks
- ✓ Audit logging: append-only PostgreSQL table with before/after capture, DB triggers (Req 13)
- ✓ Search indexing: Typesense for users, orgs, rooms, contacts
- ✓ Test suite: unit tests for all service layer functions, integration tests for booking flow
Phase 3: Billing, Wallet & Payments
The most complex phase. Wallet system, invoicing engine, payment gateway. Reqs 10, 11, 12.
- ✓ Wallet architecture: multi-currency, quota vs evergreen types, multi-frequency resets
- ✓ Double-entry ledger: immutable append-only, balance derived from SUM
- ✓ Deduction engine: priority ordering (monthly → weekly → daily → evergreen)
- ✓ Reserve-to-debit pattern: booking holds with expiry and conversion
- ✓ Invoicing engine: subscription (recurring) & once-off invoices, line items, pro-rata calculations
- ✓ Invoice workflow: draft → approved → sent → paid (state machine)
- ✓ Price escalation: scheduled percentage increases, commitment discounts
- ✓ Accounting adapter: interface + Xero implementation
- ✓ Payment API: third-party scoped deduction endpoint (Req 12)
- ✓ Payment gateway: PayFast integration (stored tokens, subscriptions)
- ✓ Consolidated balance endpoint per user per currency
- ✓ Quota reset cron jobs: daily, weekly, monthly schedulers
- ✓ Comprehensive test suite: ledger integrity, deduction ordering, edge cases
Phase 4: Third-Party Integrations
External systems, third-party API access, infrastructure integrations. Reqs 7, 8, 9.
- ✓ Third-party API access: OAuth 2.0 client credentials, scoped tokens, per-client rate limits
- ✓ API key management: registration, rotation, audit logging
- ✓ FreeRADIUS integration: NetworkAccessProvider adapter, user provisioning/deprovisioning
- ✓ PaperCut integration: PrintProvider adapter (REST API, not SSH)
- ✓ Parking integration: Admyt adapter for car management & access
- ✓ Smart lock integration: Clay adapter for door access groups & tags
- ✓ Additional payment gateways: Mollie, PayPal (adapter pattern)
- ✓ Calendar sync: iCal feed generation & import
- ✓ Webhook system: outbound webhooks for third-party event subscriptions
- ✓ Integration test suite: mock adapters for CI, live adapters for staging
Phase 5: Frontend & AI Features
Member portal, admin dashboard, AI assistant, CRM interface, views/filtering, PDF export, reporting. Reqs 14, 15, 16.
- ✓ Frontend framework: Next.js or SvelteKit on Cloudflare Pages
- ✓ Member portal: dashboard, bookings, wallet, profile, team management
- ✓ Admin dashboard: KPIs, invoice runs, member management, space management
- ✓ CRM interface: leads, opportunities, pipeline view, tasks
- ✓ AI assistant (member): conversational booking, balance queries, team management
- ✓ AI assistant (admin): morning briefing, anomaly detection, churn prediction
- ✓ Smart booking: AI room recommendations with reasoning
- ✓ Auto-generated TypeScript SDK from OpenAPI spec for type-safe frontend
- ✓ Gallery platform: exhibition browser, artist profiles, AI art guide, collector tools (Req 18)
- ✓ Gallery media: artwork_media table with roles (primary/detail/in_situ/process), CatalogIt migration
- ✓ Responsive design: mobile-first, Proximity Green brand system
- ✓ Saved views per user: configurable columns, sort order, filters persisted to user_preferences (Req 16)
- ✓ Looker-style filter builder with cascading dropdowns on all list views (Req 16)
- ✓ PDF export engine: list, detail, and audit trail PDFs from any view (Req 14)
- ✓ Reporting dashboard: PostgreSQL views as API endpoints, AI-assisted queries (Req 15)
- ✓ E2E tests: Playwright for critical user journeys
Phase 6: Data Migration & Launch
Migrate data from WorkSpaceMan MongoDB, parallel run, cutover.
- ✓ Migration scripts: MongoDB → PostgreSQL data transformation
- ✓ Encrypted data migration: decrypt with old cipher, re-encrypt with new
- ✓ Xero ID mapping: preserve accounting links through migration
- ✓ Wallet/ledger migration: reconstruct balances from transaction history
- ✓ Parallel run: new platform reads from old data via adapter (2 weeks)
- ✓ User acceptance testing: key stakeholders validate critical workflows
- ✓ Cutover plan: DNS switch, rollback procedure, monitoring dashboard
- ✓ Post-launch support: 2-week hypercare period
Development Cost
Developer Time
| Phase | Duration | Hours | Cost (ZAR) |
|---|---|---|---|
| Phase 1: Foundation | 4 weeks | 120 | R96,000 |
| Phase 2: Core Business | 5 weeks | 160 | R128,000 |
| Phase 3: Billing & Wallet | 5 weeks | 160 | R128,000 |
| Phase 4: Integrations | 5 weeks | 120 | R96,000 |
| Phase 5: Frontend & AI | 6 weeks | 200 | R160,000 |
| Phase 6: Migration & Launch | 4 weeks | 80 | R64,000 |
| Total Developer Time | ~20 weeks | 840 | R672,000 |
Based on senior developer contract rate of R800/hr. Phases overlap (see timeline), so calendar time is ~20 weeks despite ~29 phase-weeks of content.
AI Tooling Cost (During Build)
| Tool | Plan | Per Month | 5 Months (ZAR) |
|---|---|---|---|
| Claude Code (Max) | 1 seat | $100 | R9,250 |
| Claude API (for AI features) | Pay-as-you-go | ~$50 | R4,625 |
| Total AI Tooling | $150/mo | R13,875 | |
Exchange rate: R18.50/USD. Claude API costs are for development/testing of the AI assistant features.
Total Build Cost
| Category | Cost (ZAR) | ||
|---|---|---|---|
| Senior developer (840 hours @ R800/hr) | R672,000 | ||
| Claude Code Max (5 months) | R9,250 | ||
| Claude API (5 months dev/test) | R4,625 | ||
| Infrastructure during build (5 months) | R21,600 | ||
| Contingency (15%) | R106,120 | ||
| Total Build Cost | R813,595 |
Monthly Running Costs (Post-Launch)
Infrastructure
| Service | Plan | USD/mo | ZAR/mo |
|---|---|---|---|
| Cloudflare Workers + Pages | Workers Paid + Pro | $25 | R463 |
| Neon PostgreSQL | Launch (autoscale) | $25 | R463 |
| Upstash Redis | Pay-as-you-go | $5 | R93 |
| Clerk (Auth) | Free tier (50K users) | $0 | R0 |
| Sentry (Monitoring) | Team | $29 | R537 |
| Inngest (Workflows) | Hobby | $0 | R0 |
| Typesense Cloud (Search) | Small cluster | $30 | R555 |
| Resend (Email) | Pro | $20 | R370 |
| Cloudflare R2 + Image Transforms | Pay-as-you-go | $5 | R93 |
| Total Infrastructure | $139/mo | R2,574/mo |
AI Features (Production)
| Feature | Model | USD/mo | ZAR/mo |
|---|---|---|---|
| Member AI assistant | Claude Haiku 4.5 | ~$30 | R555 |
| Admin briefing & anomalies | Claude Sonnet 4.6 | ~$20 | R370 |
| Smart booking recommendations | Claude Haiku 4.5 | ~$10 | R185 |
| Total AI (est. 500 users) | ~$60/mo | R1,110/mo |
AI costs scale with usage. Haiku for high-volume member queries (~$0.25/1M input tokens), Sonnet for complex admin analysis. Estimates based on ~500 active users with moderate AI interaction.
Ongoing Maintenance
| Item | ZAR/mo | ||
|---|---|---|---|
| Developer maintenance (20 hrs/mo @ R800) | R16,000 | ||
| Claude Code Max (maintenance dev) | R1,850 | ||
| Total Maintenance | R17,850/mo |
Total Monthly Running Cost
| Category | ZAR/mo | ||
|---|---|---|---|
| Infrastructure | R2,481 | ||
| AI features | R1,110 | ||
| Maintenance (developer + Claude Code) | R17,850 | ||
| Total Monthly | R21,441/mo |
Cost Comparison: Traditional vs Claude Code
Claude Code Advantage
| Metric | Traditional (4-dev team) | Claude Code + 1 Dev | Saving |
|---|---|---|---|
| Build timeline | 12–18 months | 5 months | 7–13 months faster |
| Build cost | R2.5M–R4M | R814K | R1.7M–R3.2M saved |
| Monthly ops | R80K–R120K | R21K | R59K–R99K/mo saved |
| Test coverage | Variable (often <30%) | 80%+ (AI-generated) | Higher quality |
| Documentation | Often incomplete | Complete (AI-generated) | Better maintainability |
Traditional estimate based on 4 developers at R50K–R70K/mo each for 12–18 months, plus project management overhead.
Total Investment Summary
| Item | ZAR | ||
|---|---|---|---|
| One-time: Build cost | R813,595 | ||
| Recurring: Monthly operations | R21,441/mo | ||
| Year 1 total (build + 7 months ops) | R963,682 | ||
| Year 2 total (12 months ops) | R257,292 |
Risks & Mitigations
Risk Wallet complexity
The deduction priority system is the hardest part to get right. Mitigation: build Phase 3 first as a standalone module with exhaustive property-based tests before integrating.
Risk Data migration integrity
WSM's denormalised MongoDB with computed fields in hooks makes migration non-trivial. Mitigation: run parallel systems for 2 weeks, reconcile balances daily.
Risk Single developer dependency
One-person team creates key-person risk. Mitigation: Claude Code generates well-documented, well-tested code that another developer can pick up. All architectural decisions documented.
Risk Xero API changes
Xero may update their API during build. Mitigation: accounting adapter pattern isolates Xero-specific code behind a stable interface.
Risk AI feature costs at scale
AI API costs grow with users. Mitigation: use Haiku for high-volume queries, Sonnet only for complex analysis. Cache common responses. Set usage budgets per feature.
Risk Scope creep
New requirements emerge during build. Mitigation: freeze scope per phase, track additions for a "Phase 7" backlog. The modular architecture supports iterative additions.
Assumptions
- Senior developer rate: R800/hr (mid-range SA freelance contract rate)
- Exchange rate: R18.50/USD
- Claude Code Max plan: $100/mo per seat
- Developer works ~8 productive hours/day, ~4 days/week (accounting for meetings, reviews, planning)
- Claude Code provides 3–5x productivity multiplier on code generation, testing, and documentation
- Infrastructure sizing based on ~500 active users, moderate traffic
- AI feature costs estimated for moderate AI interaction (not every user every day)
- Existing WorkSpaceMan remains operational during build; no emergency fixes costed
- 15% contingency covers scope adjustments and unforeseen complexity
Next Steps
- Approve plan & budget — align on scope, timeline, and cost envelope
- Engage senior developer — ideally strong in TypeScript, PostgreSQL, and API design
- Set up infrastructure — Cloudflare, Neon, Clerk accounts (most have free tiers to start)
- Begin Phase 1 — database schema and auth layer are the foundation everything else builds on
- Weekly demos — each Friday, deploy to staging and demo progress against the phase deliverables