pacnpal edcd8f2076 Add secret management guide, client-side performance monitoring, and search accessibility enhancements
- Introduced a comprehensive Secret Management Guide detailing best practices, secret classification, development setup, production management, rotation procedures, and emergency protocols.
- Implemented a client-side performance monitoring script to track various metrics including page load performance, paint metrics, layout shifts, and memory usage.
- Enhanced search accessibility with keyboard navigation support for search results, ensuring compliance with WCAG standards and improving user experience.
2025-12-23 16:41:42 -05:00
ok
2024-11-01 03:35:53 +00:00
2024-10-29 21:29:16 -04:00
ok
2025-08-28 23:20:09 -04:00

ThrillWiki - Django + HTMX Application

A comprehensive theme park and roller coaster information system built with Django and HTMX, providing a progressive enhancement approach to modern web development.

Architecture Overview

ThrillWiki is a Django monolith with HTMX-driven interactivity, not a traditional SPA. This architecture provides:

  • Server-side rendering for SEO and initial page load performance
  • Progressive enhancement with HTMX for dynamic updates without full page reloads
  • REST API for programmatic access and potential mobile app integration
  • Alpine.js for minimal client-side state (limited to form validation and UI toggles)
thrillwiki/
├── backend/                 # Django application (main codebase)
│   ├── apps/               # Modular Django applications
│   │   ├── accounts/       # User management and authentication
│   │   ├── api/v1/         # REST API endpoints
│   │   ├── core/           # Shared utilities and base classes
│   │   ├── location/       # Geographic data and services
│   │   ├── media/          # File management (Cloudflare Images)
│   │   ├── moderation/     # Content moderation workflows
│   │   ├── parks/          # Theme park data and operations
│   │   └── rides/          # Ride information and relationships
│   ├── config/             # Django settings and configuration
│   │   ├── django/         # Environment-specific settings
│   │   └── settings/       # Modular settings modules
│   ├── templates/          # Django templates with HTMX
│   │   ├── components/     # Reusable UI components
│   │   ├── htmx/           # HTMX partial templates
│   │   └── layouts/        # Base layout templates
│   └── static/             # Static assets (CSS, JS, images)
├── shared/                  # Shared resources
│   ├── scripts/            # Development and deployment scripts
│   └── media/              # Shared media files
├── architecture/            # Architecture documentation
├── docs/                    # Project documentation
└── tests/                   # Test files

Technology Stack

Technology Version Purpose
Django 5.2.8+ Web framework
Django REST Framework 3.15.2+ API framework
HTMX 1.20.0+ Dynamic UI updates
Alpine.js 3.x Minimal client-side state
Tailwind CSS 3.x Utility-first styling
PostgreSQL/PostGIS 14+ Database with geospatial support
Redis 6+ Caching and sessions
Celery 5.5+ Background task processing
UV Latest Python package management

Quick Start

Prerequisites

  • Python 3.13+ with uv for package management
  • PostgreSQL 14+ with PostGIS extension
  • Redis 6+ for caching and sessions

Development Setup

  1. Clone the repository

    git clone <repository-url>
    cd thrillwiki
    
  2. Install dependencies

    cd backend
    uv sync --frozen  # Use locked versions for reproducibility
    
  3. Environment configuration

    cp .env.example .env
    # Edit .env with your settings
    
  4. Database setup

    uv run manage.py migrate
    uv run manage.py createsuperuser
    
  5. Start development server

    uv run manage.py runserver
    

The application will be available at http://localhost:8000.

Project Structure Details

Django Applications

App Description
accounts User authentication, profiles, preferences, and social auth
api/v1 RESTful API endpoints with OpenAPI documentation
core Shared utilities, managers, middleware, and services
location Geographic models, geocoding, and map services
media Cloudflare Images integration and file management
moderation Content review workflows and moderation queue
parks Theme park models, views, and related operations
rides Ride models, coaster statistics, and ride history

HTMX Patterns

ThrillWiki uses HTMX for server-driven interactivity:

  • Partial templates (*_partial.html) for dynamic content updates
  • HX-Trigger for cross-component communication
  • hx-indicator with skeleton loaders for loading states
  • Field-level validation via HTMX for form feedback

See HTMX Patterns for detailed conventions.

Hybrid API/HTML Endpoints

Many views serve dual purposes:

  • HTML response for browser requests (template rendering)
  • JSON response for API requests (DRF serialization)

This is achieved through content negotiation and hybrid view mixins.

Development Workflow

Running the Development Server

cd backend
uv run manage.py runserver

Django Management Commands

# Database operations
uv run manage.py migrate
uv run manage.py makemigrations
uv run manage.py createsuperuser

# Static files
uv run manage.py collectstatic

# Validate configuration
uv run manage.py validate_settings

# Testing
uv run manage.py test

Code Quality

# Format code
uv run black .
uv run isort .

# Lint code
uv run ruff check .
uv run flake8 .

# Type checking
uv run pyright

Configuration

Environment Variables

ThrillWiki uses environment variables for configuration. Key variables:

Variable Description
SECRET_KEY Django secret key (required)
DEBUG Debug mode (True/False)
DATABASE_URL PostgreSQL connection URL
REDIS_URL Redis connection URL
DJANGO_SETTINGS_MODULE Settings module to use

See Environment Variables for complete reference.

Settings Architecture

ThrillWiki uses a modular settings architecture:

config/
├── django/              # Environment-specific settings
│   ├── base.py          # Core settings
│   ├── local.py         # Development overrides
│   ├── production.py    # Production overrides
│   └── test.py          # Test overrides
└── settings/            # Modular settings
    ├── cache.py         # Redis caching
    ├── database.py      # Database configuration
    ├── email.py         # Email settings
    ├── logging.py       # Logging configuration
    ├── rest_framework.py # DRF and CORS
    ├── security.py      # Security headers
    └── storage.py       # Static/media files

API Documentation

Interactive Documentation

  • Swagger UI: /api/docs/
  • ReDoc: /api/redoc/
  • OpenAPI Schema: /api/schema/

API Overview

  • Base URL: /api/v1/
  • Authentication: JWT Bearer tokens or session-based
  • Content-Type: application/json

See API Documentation for complete endpoint reference.

Key Features

Park Database

  • Comprehensive theme park information worldwide
  • Operator and property owner relationships
  • Geographic data with PostGIS support
  • Operating status and seasonal information

Ride Database

  • Complete ride specifications and statistics
  • Roller coaster technical data (height, speed, inversions)
  • Manufacturer and designer tracking
  • Historical status and name changes

User Features

  • User authentication with social login (Google, Discord)
  • Profile management and preferences
  • Review and rating system
  • Personalized content and contributions

Content Moderation

  • Review and approval workflows
  • Moderation queue management
  • User moderation actions
  • Bulk operations support

API Capabilities

  • Full CRUD for all entities
  • Advanced filtering and search
  • Pagination and sorting
  • Rate limiting and caching

Documentation

Core Documentation

Configuration

Architecture

Accessibility

Testing

Running Tests

# Run all tests
uv run manage.py test

# Run specific app tests
uv run manage.py test apps.parks
uv run manage.py test apps.rides

# Run with coverage
uv run coverage run manage.py test
uv run coverage report

Accessibility Testing

# Run accessibility tests
uv run manage.py test backend.tests.accessibility

Deployment

Development Environment

# Start development server
uv run manage.py runserver

# Full development setup
./shared/scripts/dev/setup-dev.sh

Production Deployment

See Deployment Guide for detailed production setup instructions.

Key production requirements:

  • DEBUG=False
  • SSL/HTTPS enforcement
  • Redis for caching and sessions
  • PostgreSQL with connection pooling
  • Proper secret management

Production Checklist

See Production Checklist for deployment verification.

Contributing

We welcome contributions! Please follow these guidelines:

  1. Development Setup - Follow the setup instructions above
  2. Code Standards - Follow Django coding standards and use provided linters
  3. Testing - Write tests for new features
  4. Documentation - Update documentation as needed

Quick Contribution Start

# Fork and clone the repository
git clone https://github.com/your-username/thrillwiki.git
cd thrillwiki

# Set up development environment
cd backend && uv sync

# Create a feature branch
git checkout -b feature/your-feature-name

# Make your changes and test
uv run manage.py test

# Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


Built with Django + HTMX for the theme park and roller coaster community

Description
This is a Django-based theme park management system called ThrillWiki that provides comprehensive functionality for managing parks, rides, locations, and related entities. The system includes features for user accounts, content moderation, history tracking, media management, and analytics. It follows a modular architecture with separate Django apps for each major feature area and uses Tailwind CSS for frontend styling. The project emphasizes maintainability through extensive documentation and decision tracking in dedicated memory-bank directories.
https://www.thrillwiki.com
Readme 150 MiB
Languages
Python 61.1%
HTML 31.4%
CSS 6.5%
JavaScript 0.9%