# judicialcouncilofcalifornia/jcc-srl architecture

> Architecture diagram of the GitHub repository judicialcouncilofcalifornia/jcc-srl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/judicialcouncilofcalifornia/jcc-srl
- Repository: https://github.com/judicialcouncilofcalifornia/jcc-srl

## Overview

This project is a full‐stack Drupal 8 application that serves as a CMS-based website with a rich backend comprising numerous custom and contributed modules along with a custom Drupal theme (based on JCCBase/atrium). The system is built with modern development practices including Composer-based dependency management, configuration management via config splits and exclusions, automated testing (PHP unit, code sniffer, and Cypress tests), and a CI/CD pipeline (CircleCI) that deploys to Pantheon multidev environments. There are also local development conveniences via Lando (Docker) making it possible to run the full stack locally.

- Developer Environment:
– Local development with Lando (see lando.yml, docker-related settings, examples directory for sample settings)
– Local database import and environment reset procedures (see “Local Development” section in the README)
- Source Code and Dependency Management:
– GitHub repository and Git workflow branches (feature branches, develop, stage, master)
– Composer-based dependency and patch management (composer.json, composer.lock, patches folder)
- Continuous Integration / Continuous Deployment:
– CircleCI integration (.circleci directory with deploy and testing scripts)
– Automated testing (PHP linting, Code Sniffer hooks, Cypress integration with tests in test/cypress)
- CMS Backend:
– Drupal 8 core and its configuration management system (see extensive config/ folder with YAML files for core configuration, modules, views, fields, etc.)
– Custom modules (located in web/modules/custom such as cc, jcc_admin, jcc_autocomplete_helper, jcc_boilerplate, jcc_datefinder, jcc_forms, and others)
– Contrib modules managed via Composer along with patches applied in patches folder
- Theming / Frontend:
– Custom theme (web/themes/custom/atrium) which is a subtheme of JCCBase
– Template files, assets (JS, CSS, images), and configuration for the theme
- Hosting & Environments:
– Pantheon hosting integration – multidev environments mapped to branches (master for production, stage and develop for intermediate environments)
– Deployment process triggered by GitHub pushes merging into appropriate environment branches

- “Source Code Repository” (GitHub) as a central hub with branch labels. Indicate that feature branches merge into develop/stage/master.
– CMS Core and Configuration (config folder and structure for sites, config splits, etc.)
– Custom Modules (list a few key custom modules like cc, jcc_admin, jcc_forms, etc.)
– Theme (atrium subtheme under web/themes/custom/atrium)
- Optionally, add external integrations if relevant (for example, external services triggered by Drupal modules such as analytics or REST endpoints).

##### Architectural Patterns and Design Principles
- Separation of Concerns: Note how frontend theming (presentation layer) is separated from the backend CMS logic (custom modules and configuration management).
- Environment Isolation: Emphasize the segregation between local, development (multidev), staging, and production environments.
- Configuration as Code: Capture how configuration management (via YAML files, config splits, and Composer) ensures that all environment‐specific settings are maintained in code.
- Automated Testing & Deployment: Indicate that the CI/CD pipeline automates testing (unit tests, E2E testing via Cypress) and deployment steps (running drush commands like updb, cim, and clearing caches).

##### Tools, Technologies, and Key Files
- Use of Composer (composer.json, composer.lock), Lando (.lando.yml), and Pantheon configuration (pantheon.yml)
- Mention that the CI configuration is housed under the .circleci directory and that automated testing scripts (in test/cypress) drive end-to-end testing.
- That customizations reside within web/modules/custom and web/themes/custom, giving a clear separation between Drupal core, contributed extensions, and project-specific customizations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Local Development Environment
    subgraph "Local Development"
        LD1["Lando Config"]:::developer
        LD2["Local Examples"]:::developer
        LD3["Local Dev Instructions (README)"]:::developer
    end

    %% Source Code & Dependency Management
    subgraph "Source Code & Dependencies"
        SCD1["GitHub Repository"]:::repository
        SCD2["composer.json"]:::repository
        SCD3["composer.lock"]:::repository
        SCD4["Patches Directory"]:::repository
        SCD5[".gitignore"]:::repository
        SCD6[".gitattributes"]:::repository
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        CI1["CircleCI Config (.circleci)"]:::cicd
        CI2["Cypress Tests"]:::cicd
        CI3["PHPUnit Tests"]:::cicd
        CI4["PHP CodeSniffer"]:::cicd
    end

    %% Drupal 8 Application
    subgraph "Drupal 8 Application"
        DA1["Drupal Config"]:::drupal
        subgraph "Custom Modules"
            CM1["CC Module"]:::drupal
            CM2["JCC Admin Module"]:::drupal
            CM3["JCC Autocomplete"]:::drupal
            CM4["JCC Boilerplate"]:::drupal
            CM5["JCC Datefinder"]:::drupal
            CM6["JCC Forms"]:::drupal
        end
        DA2["Atrium Theme"]:::drupal
    end

    %% Hosting & Environments
    subgraph "Hosting Environment"
        PH1["Pantheon Config"]:::hosting
        subgraph "Pantheon Multidev"
            PH2["Develop Environment"]:::hosting
            PH3["Stage Environment"]:::hosting
            PH4["Master (Production)"]:::hosting
        end
        PH5["Config Production"]:::hosting
        PH6["Config Staging"]:::hosting
    end

    %% Connections
    %% Developer Environment pushes code to the Source Code Repository
    LD1 -->|"push"| SCD1
    LD2 -->|"push"| SCD1
    LD3 -->|"push"| SCD1

    %% Source Code triggers the CI/CD Pipeline
    SCD1 -->|"trigger"| CI1

    %% CI/CD Pipeline Testing
    CI1 -->|"run"| CI2
    CI1 -->|"run"| CI3
    CI1 -->|"run"| CI4

    %% CI/CD Pipeline builds and deploys the Drupal Application
    CI1 -->|"deploy"| DA1

    %% Drupal Application components (modules and theme) constitute the site
    %% (Implicit connection within the Drupal 8 Application subgraph)

    %% Drupal Application is deployed to all Pantheon multidev environments
    DA1 -->|"deployed_on"| PH2
    DA1 -->|"deployed_on"| PH3
    DA1 -->|"deployed_on"| PH4

    %% Class Definitions for Colors and Styling
    classDef developer fill:#c5e1a5,stroke:#33691e,stroke-width:2px;
    classDef repository fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef cicd fill:#ffe082,stroke:#ff6f00,stroke-width:2px;
    classDef drupal fill:#ffccbc,stroke:#bf360c,stroke-width:2px;
    classDef hosting fill:#d1c4e9,stroke:#4a148c,stroke-width:2px;

    %% Click Events for Developer Environment
    click LD1 "https://github.com/judicialcouncilofcalifornia/jcc-srl/blob/master/.lando.yml"
    click LD2 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/examples/"
    click LD3 "https://github.com/judicialcouncilofcalifornia/jcc-srl/blob/master/README.md"

    %% Click Events for Source Code & Dependency Management
    click SCD2 "https://github.com/judicialcouncilofcalifornia/jcc-srl/blob/master/composer.json"
    click SCD3 "https://github.com/judicialcouncilofcalifornia/jcc-srl/blob/master/composer.lock"
    click SCD4 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/patches/"
    click SCD5 "https://github.com/judicialcouncilofcalifornia/jcc-srl/blob/master/.gitignore"
    click SCD6 "https://github.com/judicialcouncilofcalifornia/jcc-srl/blob/master/.gitattributes"

    %% Click Events for CI/CD Pipeline
    click CI1 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/.circleci/"
    click CI2 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/test/cypress/"
    click CI3 "https://github.com/judicialcouncilofcalifornia/jcc-srl/blob/master/phpunit.xml.dist"
    click CI4 "https://github.com/judicialcouncilofcalifornia/jcc-srl/blob/master/phpcs.xml.dist"

    %% Click Events for Drupal 8 Application
    click DA1 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/config/"
    click CM1 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/web/modules/custom/cc/"
    click CM2 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/web/modules/custom/jcc_admin/"
    click CM3 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/web/modules/custom/jcc_autocomplete_helper/"
    click CM4 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/web/modules/custom/jcc_boilerplate/"
    click CM5 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/web/modules/custom/jcc_datefinder/"
    click CM6 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/web/modules/custom/jcc_forms/"
    click DA2 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/web/themes/custom/atrium/"

    %% Click Events for Hosting & Environments
    click PH1 "https://github.com/judicialcouncilofcalifornia/jcc-srl/blob/master/pantheon.yml"
    click PH5 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/config-prod/"
    click PH6 "https://github.com/judicialcouncilofcalifornia/jcc-srl/tree/master/config-stage/"
```
