Adding Features
A decision guide for engineers: where does your new feature live?
Decision Matrix
| You’re building… | Primary repo | Supporting repo | Notes |
|---|---|---|---|
| New student-facing feature | Housr-App | Housr-API2 | Build API v2 module + App feature |
| New marketing/landing page | Housr-Webapp | — | Add page under src/app/[locale]/ |
| New property search feature | Housr-Webapp | Housr-API2 | May use direct DB queries for search |
| New admin capability | Housr Portal | — | Add Filament resource or page |
| New agent/landlord feature | Housr Portal | Housr-API2 | Portal UI + optional API endpoints |
| New API endpoint | Housr-API2 | — | Never add to API v1 |
| New property data source | Housr-Property-Feeds | — | New importer module |
| New payment feature | Housr-API2 | Housr-App or Webapp | Use RyftPay |
Step-by-Step: New App Feature
- Design the API: Create a new module in API v2 (
Modules/YourFeature/) with routes, controllers, models, migrations - Build the App feature: Create
src/features/your-feature/withapi/,components/,hooks/,types/subdirectories - Wire up React Query: API function in
api/, hook inhooks/, component consumes the hook - Add navigation: Add tab or screen to
src/app/routing - Handle regions: Check if the feature is UK-only, US-only, or both. Use feature flags if needed.
Step-by-Step: New Webapp Page
- Create the page:
src/app/[locale]/your-page/page.tsx - Add route config: Entry in
src/components/layouts/route-config.tsx(controls header, hero, footer, CTA, allowed regions) - Add navigation: Entry in
src/components/layouts/navigation-config.tsif it should appear in the nav - Add i18n: Entries in
src/dictionaries/us.jsonanduk.jsonif region-specific text is needed - Data fetching: Server Actions or direct API calls from the server component
Step-by-Step: New Portal Feature
- Create a Filament resource:
php artisan make:filament-resource YourModel - Define the table and form: Columns, filters, actions in the resource
- Add authorization: Define policies for who can view/create/edit/delete
- Add to navigation: Filament auto-registers resources, but you can customize grouping and ordering
Step-by-Step: New API v2 Module
- Create the module:
php artisan module:make YourModule - Define routes:
Routes/api.phpin the module - Create models and migrations:
Database/directory in the module - Build controllers: Follow RESTful conventions
- Add auth middleware: Use appropriate guards (Bearer JWT, Firebase, etc.)
- Test: Write feature tests for all endpoints
Common Patterns
Feature Flags
Use feature flags for gradual rollout:
- App:
FeatureFlagProvidercontext — check flags before rendering features - API v2: Config-based or database-driven flags
- Portal: Filament can conditionally show/hide resources
Multi-Repo Features
Many features span multiple repos. The typical pattern:
- Start with the API (data model + endpoints)
- Build the consumer (App, Webapp, or Portal)
- Deploy API first, then consumer
- Use feature flags to decouple deployment timing
Last updated on