mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 14:11:09 -05:00
- Add complete backend/ directory with full Django application - Add frontend/ directory with Vite + TypeScript setup ready for Next.js - Add comprehensive shared/ directory with: - Complete documentation and memory-bank archives - Media files and avatars (letters, park/ride images) - Deployment scripts and automation tools - Shared types and utilities - Add architecture/ directory with migration guides - Configure pnpm workspace for monorepo development - Update .gitignore to exclude .django_tailwind_cli/ build artifacts - Preserve all historical documentation in shared/docs/memory-bank/ - Set up proper structure for full-stack development with shared resources
2.7 KiB
2.7 KiB
Ride Search Architecture Decision
Date: 2025-06-24
Status: Planned
Context: Extending search functionality from parks to rides
Decision
Implement ride search functionality following the established BaseAutocomplete pattern with these key architectural decisions:
1. Pattern Consistency
- Extend BaseAutocomplete: Use same authentication-first approach as park search
- Mirror Structure: RideAutocomplete + RideSearchForm following ParkAutocomplete pattern
- HTMX Integration: Same frontend interaction patterns for consistency
2. Relationship Handling
- Park Context: Rides belong to parks via ForeignKey, search results must show both
- Query Optimization: Use
select_related('park')for efficient database queries - Result Display: Show "Ride Name - Park Name" format in autocomplete results
3. Database Strategy
- Indexes: Add database indexes on
Ride.nameandRide.park_id - Query Limits: Limit autocomplete to 10 results for performance
- Filtering: Support filtering by park, thrill level, duration
4. Frontend Architecture
- Component Reuse: Leverage existing search CSS and JavaScript patterns
- HTMX Endpoints:
/search/rides/autocomplete/and/search/rides/results/ - AlpineJS State: Manage selection state and form interactions
5. Testing Strategy
- Unit Tests: RideAutocomplete, RideSearchForm, and filter logic
- Integration Tests: HTMX responses and authentication requirements
- Performance Tests: Large dataset handling and query optimization
Rationale
This approach ensures:
- Consistency: Users get familiar interaction patterns
- Performance: Optimized queries and result limiting
- Maintainability: Follows established codebase patterns
- Scalability: Database indexes and query optimization
Implementation Files
Core Components
search/mixins.py- RideAutocomplete classsearch/forms.py- RideSearchForm classsearch/urls.py- URL routing for ride endpointsrides/views.py- RideSearchView with authentication
Templates
search/templates/search/partials/_ride_search.html- Search formrides/templates/rides/partials/ride_results.html- Results display
Tests
search/tests/test_autocomplete.py- RideAutocomplete testssearch/tests/test_forms.py- RideSearchForm testsrides/tests/test_search_view.py- View and integration tests
Next Steps
- Code mode implementation of core components
- Database migration for indexes
- Template creation and HTMX integration
- Comprehensive test suite
- Performance validation
Dependencies
- Existing BaseAutocomplete infrastructure
- HTMX and AlpineJS frontend stack
- Django authentication system
- Ride model with park relationship