How scpwiki/wikijump works
Project Type and Purpose
• Wikijump is a full‑stack wiki/collaboration platform developed as an evolution of the legacy Wikidot system.
• It features a modern Rust‑based backend (in the “deepwell” directory) handling business logic, data models, endpoints, and services; a modern Svelte/TypeScript frontend (in “framerail”); and support for legacy PHP modules (in “legacy”) that may still be referenced or maintained.
• The project also includes extensive deployment scripts (Docker, AWS/Terraform configurations in “install”), localization resources, and additional “web” modules for extra front‑end assets or API definitions.
Analyzing the File Structure
• Look for clearly separated high‑level components:
• “deepwell”: This folder holds the Rust backend code. Inside it are subdirectories for configuration, endpoints, models, database access, various business logic “services” (e.g., authentication, paging, rendering, etc.) and integration with external systems (Redis, file revisions, caching).
• “framerail”: Contains the modern frontend components built using Svelte, TypeScript, and associated libraries that interface with the backend API.
• “legacy”: Contains legacy PHP code – this is a separate subsystem that might interact with or be superseded by the deepwell services.
• “install”: Contains environment-specific configurations and deployment scripts (for local, dev, and prod) using Docker, AWS, Terraform, etc.
• “locales”: Contains translation files and localization configurations (using Fluent, cmftml, and typed variants).
• “web”: Contains additional web assets, API documentation (OpenAPI definitions in “web/modules/api”), helper scripts, and resource views.
Key Components
a. Backend (Deepwell):
– Subdivide into key modules such as:
• API/Endpoints (each file in deepwell/src/endpoints)
• Business Services (e.g., authentication, file, message, user, page, etc.)
• Data Models and Database Access (deepwell/src/models and deepwell/src/database)
• Auxiliary Services like caching (Redis integration), job workers, and special pages.
– Illustrate how these layers interact with external systems:
• Database (PostgreSQL, as suggested by “postgres” in the install folders)
• Caching system (Redis)
• File storage (MinIO configuration present in install/local/minio)
b. Frontend (Framerail):
– Represent the modern Svelte components and routes that render the wiki content and manage client‐side interactions.
– Note its communication channel with the deepwell backend via APIs.
c. Legacy System:
– Represent the legacy PHP codebase as a separate legacy subsystem that might either run side‑by‑side or serve as a “migration reference” for new deepwell services.
d. Deployment and Infrastructure:
– Include separate nodes for deployment configurations (Docker, AWS/Terraform setups), referencing the “install” directories and GitHub Actions workflows.
– Indicate different environments (dev, local, prod) with deployment pipelines.
e. Localization:
– Represent localization modules using the “locales” directories (Fluent, cmftml, typed, and validator) which integrate with both the frontend and backend to provide multilingual support.
Relationships and Interactions
• User browsers interact with the Framerail frontend.
• Framerail makes API calls to the Deepwell backend.
• Deepwell accesses and updates the Database, caches with Redis, and integrates with external services (email, file storage, etc.).
• Deployment tools (Docker, Terraform) orchestrate containerized services in the production environment.
• Localization services feed translation data into both frontend and backend components.
Architectural Patterns/Design Principles
• Layered/MVC-like separation: Separate presentation (Framerail), business logic (Deepwell services and endpoints), and data persistence (database access).
• Separation of concerns: Different modules for authentication, file management, rendering, and so on.
• Environment-driven deployments: Highlight the use of Docker containers, AWS/Terraform scripts for production, and local development support.
• Clear API boundaries: Emphasize that the modern frontend interacts with the backend through RESTful APIs or possibly GraphQL endpoints.
• “Database” (PostgreSQL)
• “Cache” (Redis)
• “File Storage” (MinIO)
• “External Services” (email, etc.)
• A layer for “Deployment Infrastructure” showing Docker, AWS/Terraform CI/CD pipelines (installation scripts and GitHub Actions workflows).
• A “Localization” component and indicate that it feeds data to both Frontend and Backend.
• Use labels like “Deepwell (Rust)” and “Framerail (Svelte/TS)” so viewers immediately grasp the tech stacks.
Happy diagramming!