## Summary - move the Laravel application into `apps/platform` and keep the repository root for orchestration, docs, and tooling - update the local command model, Sail/Docker wiring, runtime paths, and ignore rules around the new platform location - add relocation quickstart/contracts plus focused smoke coverage for bootstrap, command model, routes, and runtime behavior ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/PlatformRelocation` - integrated browser smoke validated `/up`, `/`, `/admin`, `/admin/choose-workspace`, and tenant route semantics for `200`, `403`, and `404` ## Remaining Rollout Checks - validate Dokploy build context and working-directory assumptions against the new `apps/platform` layout - confirm web, queue, and scheduler processes all start from the expected working directory in staging/production - verify no legacy volume mounts or asset-publish paths still point at the old root-level `public/` or `storage/` locations Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #213
6.5 KiB
6.5 KiB
Data Model: Platform Relocation to apps/platform
Overview
This feature adds no new persisted database entities. The "model" for this slice is a set of logical relocation artifacts and validation rules that govern which files live where, how commands resolve the app, and how runtime integrity is proven after the move.
Logical Entities
RepoOrchestrationLayer
- Purpose: The repo-wide layer that remains at root after the move.
- Fields:
root_directories:docs/,specs/,.specify/,scripts/,.github/,.vscode/, and other repo metadata directoriesroot_files:docker-compose.yml,README.md,Agents.md,GEMINI.md,boost.json,opencode.json, repo ignore files, editor filesownership:repo-level
- Validation rules:
- Must not remain the authoritative home of
app/,bootstrap/,config/,database/,public/,resources/,routes/,storage/,tests/, or app-local package manager files. - Any helper file kept at root must be explicitly classified as repo-level or compatibility-only.
- Must not remain the authoritative home of
PlatformApplication
- Purpose: The relocated Laravel application living under
apps/platform. - Fields:
app_root:apps/platformruntime_directories:app/,bootstrap/,config/,database/,public/,resources/,routes/,storage/,tests/runtime_files:artisan,composer.json,package.json,vite.config.js,phpunit.xml,phpunit.pgsql.xml,drizzle.config.ts,.env.exampleownership:application-level
- Validation rules:
- All authoritative Laravel runtime files must exist only under
apps/platformafter cutover. - Internal relative path assumptions should remain unchanged unless a boundary file proves otherwise.
- All authoritative Laravel runtime files must exist only under
FilePlacementContract
- Purpose: The explicit matrix that defines what stays at root versus what moves into
apps/platform. - Fields:
root_itemsapp_itemsreviewed_exceptionsnon_goals
- Validation rules:
- No reviewed exception may create a second authoritative app root.
- Exception rationale must explain why root or app ownership is correct.
CommandModel
- Purpose: The canonical developer workflow after relocation.
- Fields:
canonical_working_directory:apps/platformcanonical_commands: install, boot, build, test, format, and artisan examplescompatibility_helpers: optional root wrappers, tasks, or aliases that do nothing except delegate to the app rootdelegation_policy:compatibility-only
- Validation rules:
- Exactly one command model may be primary.
- Any helper outside
apps/platformmust be clearly labeled non-canonical.
EnvironmentModel
- Purpose: The configuration boundary between app config truth and compose-level wiring.
- Fields:
app_env_path:apps/platform/.envapp_env_example_path:apps/platform/.env.examplecompose_bridge_variable:SAIL_FILESoptional_root_compose_env: compose-only variables if needed
- Validation rules:
- Application
APP_*, database, queue, cache, and other Laravel config truth must live with the app. - Root-level env data, if introduced, must not duplicate or override canonical app config truth except for explicit compose-only concerns.
- Application
ComposeBridge
- Purpose: The boundary that lets repo-root compose orchestrate an app-local Laravel project.
- Fields:
compose_file_path:docker-compose.ymlcontainer_app_root:/var/www/htmlmount_source:./apps/platformsail_runtime_path:apps/platform/vendor/laravel/sail/runtimes/8.4services:laravel.test,queue,pgsql,redis
- Validation rules:
- Web and queue services must execute against the relocated app root.
node_modulesand storage-related container assumptions must resolve inside the relocated app.
ToolingReference
- Purpose: A repo-level task, MCP, or agent configuration that launches platform commands.
- Fields:
file_pathtool_type: README, VS Code task, MCP config, agent instructions, automation scriptexecution_mode: direct app command or root delegatorstatus: stale, updated, deprecated
- Validation rules:
- No maintained tooling reference may silently assume the app still lives at repo root.
- Absolute local machine paths should be removed where reasonable during normalization.
SmokeCheck
- Purpose: A required runtime or tooling validation step.
- Fields:
idarea: local boot, CLI, build, public entry, panel, auth, queue, tests, toolingcommand_or_routeexpected_outcomeblocking: yes or noevidence
- State transitions:
planned -> passedplanned -> failedplanned -> blocked
RollbackStep
- Purpose: A documented recovery action if the move must be reversed.
- Fields:
orderscope: git, env, dependencies, Docker, docs, open branchesactionexpected_result
- State transitions:
drafted -> verified
ExternalDeployUnknown
- Purpose: A deployment assumption that cannot be proven from the repo alone.
- Fields:
questionwhy_unresolvedownerrequired_before_rollout: yes or nostatus: open, validated, deferred
- State transitions:
open -> validatedopen -> deferred
Relationships
RepoOrchestrationLayerownsdocker-compose.yml, repo docs, editor config, MCP config, and agent config.PlatformApplicationis the sole application runtime referenced byCommandModel,EnvironmentModel, andComposeBridge.FilePlacementContractgoverns bothRepoOrchestrationLayerandPlatformApplication.ComposeBridgelinks the repo-root compose layer to the app-local Laravel runtime.ToolingReferencepoints either directly toPlatformApplicationcommands or to compatibility-only delegators.SmokeCheckvalidatesComposeBridge,CommandModel,PlatformApplication, andToolingReferencebehavior after implementation.RollbackStepreverses changes across both root and app scopes.ExternalDeployUnknowncaptures rollout blockers that sit outside the repository implementation itself.
Invariants
- There is exactly one authoritative Laravel app root after the move:
apps/platform. - There is exactly one official developer command model after the move: app-local commands from
apps/platform. - Repo root remains the orchestration and metadata layer, not a second application root.
- No new product persistence or runtime domain model is introduced by the relocation.