mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 13:51: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
5.2 KiB
5.2 KiB
System Architecture Documentation
Overview
ThrillWiki is a Django-based web platform built with a modular architecture focusing on theme park information management, user reviews, and content moderation.
Technology Stack
Backend
- Framework: Django 5.1.6
- API: Django REST Framework 3.15.2
- WebSocket Support: Channels 4.2.0 with Redis
- Authentication: django-allauth, OAuth Toolkit
- Database: PostgreSQL with django-pghistory
Frontend
- Templating: Django Templates
- CSS Framework: Tailwind CSS
- Enhancement: HTMX, JavaScript
- Asset Management: django-webpack-loader
Infrastructure
- Static Files: WhiteNoise 6.9.0
- Media Storage: Local filesystem with custom storage backends
- Caching: Redis (shared with WebSocket layer)
System Components
Core Applications
-
Parks Module
- Park information management
- Geographic data handling
- Operating hours tracking
- Integration with location services
-
Rides Module
- Ride specifications
- Manufacturer/Designer attribution
- Historical data tracking
- Technical details management
-
Reviews System
- User-generated content
- Media attachments
- Rating framework
- Integration with moderation
-
Moderation System
- Content review workflow
- Quality control mechanisms
- User management
- Verification processes
-
Companies Module
- Company profiles
- Verification system
- Official update management
- Park operator features
Service Layer
-
Authentication Service
# Key authentication flows User Authentication → JWT Token → Protected Resources Social Auth → Profile Creation → Platform Access -
Media Service
# Media handling workflow Upload → Processing → Storage → Delivery -
Analytics Service
# Analytics pipeline User Action → Event Tracking → Processing → Insights
Data Flow Architecture
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Client │ ──→ │ Django │ ──→ │ Database │
│ Browser │ ←── │ Server │ ←── │ (Postgres) │
└─────────────┘ └──────────────┘ └─────────────┘
↑ ↓
┌──────────────┐
│ Services │
│ (Redis/S3) │
└──────────────┘
Security Architecture
-
Authentication Flow
- JWT-based authentication
- Social authentication integration
- Session management
- Permission-based access control
-
Data Protection
- Input validation
- XSS prevention
- CSRF protection
- SQL injection prevention
Deployment Model
Production Environment
├── Application Server (Daphne/ASGI)
├── Database (PostgreSQL)
├── Cache/Message Broker (Redis)
├── Static Files (WhiteNoise)
└── Media Storage (Filesystem/S3)
Development Environment
├── Local Django Server
├── Local PostgreSQL
├── Local Redis
└── Local File Storage
Monitoring and Scaling
-
Performance Monitoring
- Page load metrics
- Database query analysis
- Cache hit rates
- API response times
-
Scaling Strategy
- Horizontal scaling of web servers
- Database read replicas
- Cache layer expansion
- Media CDN integration
Search Architecture
Search Infrastructure
- Base Pattern:
BaseAutocompleteprovides authentication-first autocomplete foundation - Park Search:
ParkAutocomplete+ParkSearchFormwith HTMX integration - Ride Search: Planned extension following same pattern with park relationship context
Search Components
-
Autocomplete Layer
- Authentication requirement enforced at base level
- Query limiting (10 results) for performance
- HTMX-driven real-time suggestions
-
Form Layer
- Django forms with autocomplete widgets
- Filter integration for advanced search
- Clean validation and error handling
-
Frontend Integration
- HTMX for dynamic updates (
hx-get,hx-trigger) - AlpineJS for local state management
- Tailwind CSS for consistent styling
- HTMX for dynamic updates (
Database Optimization
- Indexes on searchable fields (
name, foreign keys) select_related()for relationship queries- Query result limiting for performance
Integration Points
-
External Services
- Email service (ForwardEmail.net)
- Social authentication providers
- Geographic data services
- Media processing services
-
Internal Services
- WebSocket notifications
- Background tasks
- Media processing
- Analytics processing
System Requirements
Minimum Requirements
- Python 3.11+
- PostgreSQL 13+
- Redis 6+
- Node.js 18+ (for frontend builds)
Development Tools
- black (code formatting)
- flake8 (linting)
- pytest (testing)
- tailwind CLI (CSS processing)