# 1mhdjant23/doc-incep architecture

> Architecture diagram of the GitHub repository 1mhdjant23/doc-incep, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/1mhdjant23/doc-incep
- Repository: https://github.com/1mhdjant23/doc-incep

## Overview

##### Project type and purpose
- This is a containerized web‐infrastructure project built with Docker.
- It uses Docker Compose to assemble a three-tier WordPress application:
- A reverse-proxy web server (Nginx) with TLS termination
- A PHP-FPM/WordPress application server
- A MariaDB database with persistent storage
- The goal is to learn service isolation, inter‐container networking, and data persistence.

##### File structure
- Top-level:
- Makefile / README.md
- srcs/docker-compose.yml (central orchestration)
- srcs/requirements:
- mariadb/ (Dockerfile, custom my.cnf, setup script)
- nginx/ (Dockerfile, nginx.conf, .dockerignore)
- wordpress/ (Dockerfile, setup-wp.sh)
- Each service folder contains:
- Base image definition (Dockerfile)
- Configuration files and initialization scripts
- No separate frontend/backend folders: all services sit as containers, tied together by docker-compose.

##### README for additional insights
- Docker Compose defines networks and volumes.
- Nginx performs HTTPS termination, forwards PHP traffic to the WordPress container.
- WordPress (PHP-FPM) reads/writes to MariaDB via the internal Docker network.
- MariaDB data is persisted on a named Docker volume.

##### Detail
- Docker Compose file as a “control plane” element or annotation.
- Call out configuration files (nginx.conf, my.cnf) as mounted volumes.
- Initialization scripts (setup-wp.sh, set-up-db.sh) as part of the build step.
- Dependency order:
- First build images, then start mariadb, then wordpress, then nginx.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client
    Client["Client / Browser"]:::client

    %% Docker Network Enclosure
    subgraph "Docker Network" 
        direction TB
        Nginx["nginx:latest\n443→443"]:::web
        Wordpress["wordpress-php-fpm\n9000→9000"]:::app
        MariaDB["mariadb\n3306→3306"]:::db
        Volume["mariadb_data"]:::volume
    end

    %% Control Plane
    subgraph "Control Plane"
        Compose["docker-compose.yml"]:::config
        Make["Makefile"]:::config
        Readme["README.md"]:::config
    end

    %% Data Flows
    Client -->|"HTTPS 443"| Nginx
    Nginx -->|"FastCGI 9000"| Wordpress
    Wordpress -->|"SQL 3306"| MariaDB
    MariaDB -->|"persists data"| Volume

    %% Click Events
    click Compose "https://github.com/1mhdjant23/doc-incep/blob/main/srcs/docker-compose.yml"
    click Nginx "https://github.com/1mhdjant23/doc-incep/tree/main/srcs/requirements/nginx"
    click NginxDF "https://github.com/1mhdjant23/doc-incep/tree/main/srcs/requirements/nginx/Dockerfile"
    click NginxConf "https://github.com/1mhdjant23/doc-incep/blob/main/srcs/requirements/nginx/conf/nginx.conf"
    click NginxIgnore "https://github.com/1mhdjant23/doc-incep/blob/main/srcs/requirements/nginx/.dockerignore"
    click Wordpress "https://github.com/1mhdjant23/doc-incep/tree/main/srcs/requirements/wordpress"
    click WPDF "https://github.com/1mhdjant23/doc-incep/tree/main/srcs/requirements/wordpress/Dockerfile"
    click WPInit "https://github.com/1mhdjant23/doc-incep/blob/main/srcs/requirements/wordpress/tools/setup-wp.sh"
    click MariaDB "https://github.com/1mhdjant23/doc-incep/tree/main/srcs/requirements/mariadb"
    click MariaDF "https://github.com/1mhdjant23/doc-incep/tree/main/srcs/requirements/mariadb/Dockerfile"
    click MariaConf "https://github.com/1mhdjant23/doc-incep/blob/main/srcs/requirements/mariadb/conf/my.cnf"
    click MariaInit "https://github.com/1mhdjant23/doc-incep/blob/main/srcs/requirements/mariadb/tools/set-up-db.sh"
    click Make "https://github.com/1mhdjant23/doc-incep/tree/main/Makefile"
    click Readme "https://github.com/1mhdjant23/doc-incep/blob/main/README.md"

    %% Styles
    classDef client fill:#B3E5FC,stroke:#0288D1,color:#000
    classDef web fill:#FFCDD2,stroke:#C62828,color:#000
    classDef app fill:#C8E6C9,stroke:#2E7D32,color:#000
    classDef db fill:#D1C4E9,stroke:#6A1B9A,color:#000
    classDef volume fill:#FFE0B2,stroke:#EF6C00,color:#000,shape:cylinder
    classDef config fill:#ECEFF1,stroke:#546E7A,color:#000,stroke-dasharray: 5 5
```
