---
name: evolution-workspace-mapping
description: /config/workspace/evolution/ is a shared dev-server directory used by both code-server and an external LAMP stack. Edits take effect on the dev environment immediately; production deploys via git + an external DB-sync tool.
metadata: 
  node_type: memory
  type: project
  originSessionId: 4dc20618-b8cd-4e07-90cd-ff3d62ef2585
---

The **evolution** repo workspace at `/config/workspace/evolution/` is a directory on the user's **development server**. It is shared between two consumers on that same host:

1. **code-server** — runs as a **Docker container** on the dev server (hostname `shane-vscode.evolutionerp.com.au`). The container has `/var/www/shane.evolutionerp.com.au` bind-mounted in as its workspace root, so `/config/workspace/evolution/` inside the container = `/var/www/shane.evolutionerp.com.au/evolution/` on the host.
2. **The host LAMP stack** (Apache + PHP + MariaDB, running directly on Ubuntu, not in a container) which serves the site at `shane.evolutionerp.com.au` from `/var/www/shane.evolutionerp.com.au/evolution/`.

The dev server also runs **Portainer** (container management) and **NGINX Proxy Manager** (routes the two hostnames to the right backend). Both `shane.*` and `shane-vscode.*` resolve to the same physical Ubuntu host.

**Why:** Same physical filesystem under the bind-mount, so the editor sees exactly the files the dev web server serves. There is no separate "sync to dev" step. But the code-server *runtime* (binaries, PATH, installed packages) is the container's, not the host's — host-installed `php`/`mysql`/`curl` are **not** automatically reachable from inside code-server.

**How to apply:**
- File edits via Edit/Write tools land on the dev LAMP stack immediately — no mirroring, scp, or rsync needed. Do not tell the user to "mirror the change on the server."
- This is the **dev** environment, **not production**. Edits do not go live to customers automatically.
- Production / customer sites are synced separately:
  - **Code** is deployed via **git** (push to a shared remote; production pulls).
  - **Database schema changes** are propagated from the dev tenant DB (`85-1384947162`) to all customer tenant DBs via an **external database query tool** — not by re-running scripts against each tenant.
- **Tooling inside code-server is rehydrated via [[codeserver-setup-scripts]]** — `php` 8.3, `composer`, `mariadb` client, `phpstan`, `phpcs`, `shellcheck`, `rg`, `fd`, `jq` are all available after the rehydrate scripts run. Claude can run `php -l`, query the DB directly, etc. — no need to round-trip through the user for these. `docker` is still unavailable inside the container (and we don't want it there).
- The PHP CLI/web server on the host runs as `www-data`. The editor side typically writes as `abc` (or `shane`). Directories that need writes from both (e.g. `.claude/schema/`) should be group-writable (`chmod -R g+w`).
- `85-1384947162` is the canonical dev tenant DB; `evolution` is the master DB. See `.claude/schema/INDEX.md`.
- DB credentials (`sqlHost`/`sqlUser`/`sqlPasswd`) live in the repo's `.env`.
