Skip to content
prod e051e98
Browse

The three-tier admin model

Where your ops files live

Running a CodeCanyon app is not just code — it’s also ops: deploy logs, backups, monitoring scripts, secret webhook URLs. The three-tier admin model answers one question for all of it: which of these files belongs to the project, which belongs to one domain, and which is shared across the whole server?

Get this map right once and you never again wonder where a deploy log or a Discord webhook should live.

graph TD
subgraph Laptop["Your laptop (project repo)"]
Local["Admin-Local/<br/>guides · vault · customizations registry"]
end
subgraph Server["The hosting account (one server)"]
Domain["Admin-Domain/<br/>per-domain runtime: deploy logs, backups, monitors"]
ServerWide["Admin-Server/<br/>account-wide: shared scripts, webhooks, baselines"]
end
Local -->|deploys to| Domain
ServerWide -->|provides defaults to| Domain

The diagram shows the flow: you author in Admin-Local on your laptop, deploy to a per-domain space on the server, and the server-wide tier supplies shared defaults to every domain.

TierLives atScopeIn git?Examples
Admin-LocalProject repo: Admin-Local/This one projectYes — except 2-ProjectVault/ (gitignored secrets)Phase guides, ProjectCard, vault, customizations registry
Admin-DomainServer: ~/domains/<domain>/Admin-Domain/One domain (e.g. staging.x.com, x.com)No — runtime stateDeploy history, per-domain backups, monitor scripts, tmp
Admin-ServerServer: ~/Admin-Server/The whole hosting accountYes — its own repoMonitoring scripts, shared webhooks, MD5 baselines, server environment

The natural instinct is to put everything in the project’s .env. That breaks the moment one hosting account runs several Laravel apps (a common shared-hosting setup).

graph TD
Account["One hosting account"]
Account --> P1["Project A"]
Account --> P2["Project B"]
Account --> P3["Project C"]
Shared["Admin-Server<br/>shared webhook + scripts"]
Shared -.->|one URL, all inherit| P1
Shared -.->|one URL, all inherit| P2
Shared -.->|one URL, all inherit| P3
  • Why not just .env per project? If a Discord webhook lives in every project’s .env, rotating it means editing N projects. Put it in Admin-Server once and every project inherits the new URL.
  • Why not put everything in Admin-Server? Per-domain runtime state — deploy logs, monitor crons specific to one domain — belongs to that domain, not to a shared account-wide repo. That’s what Admin-Domain is for.

The git question — why one tier is tracked and one isn’t

Section titled “The git question — why one tier is tracked and one isn’t”

The cleanest way to remember which tier goes in git: authoring state is tracked, runtime state is not.

  • Admin-Local is in git because it’s authoring state — the guides and vault you write before you deploy.
  • Admin-Domain is never in git because it’s runtime state — logs and timestamps that change every minute while the app runs. Runtime state in git is just noise: it bloats the repo and breaks reproducible deploys.
  • Admin-Server has its own repo because the shared scripts are authored too, but they belong to the account, not to any single project.

How shared settings resolve — the cascade

Section titled “How shared settings resolve — the cascade”

When a task needs a shared setting (like a webhook URL for deploy notifications), it doesn’t guess — it checks each tier in order and uses the first one it finds:

graph TD
Need["Task needs a webhook URL"]
Need --> S1{"Set in the project's<br/>shared/.env?"}
S1 -->|Yes| Use1["Use it (per-project override)"]
S1 -->|No| S2{"Set in Admin-Server's<br/>server.env?"}
S2 -->|Yes| Use2["Use it (server-wide default)"]
S2 -->|No| Skip["Skip the task with a<br/>logged note — never block the deploy"]

The order matters: a per-project value wins when set (useful for a project that needs its own community channel), the server-wide value is the preferred default, and if neither is set the task simply no-ops with a “skipped” log line rather than failing the deploy.

The convention is the Admin- prefix everywhereAdmin-Local, Admin-Domain, Admin-Server. The inverted form Domain-Admin/ is legacy from an older convention; if you see it in an old guide or on a server, it should be migrated to Admin-Domain/.

Putting a file somewhere? Ask…Then it goes in
Is it a guide, the vault, or a per-project record?Admin-Local
Is it a log, backup, or monitor for one domain?Admin-Domain
Is it a script, webhook, or baseline shared by all domains?Admin-Server