Reorganize app workspaces and align Admin architecture

This commit is contained in:
Igor Martyniuk
2026-07-17 13:46:21 +00:00
parent ba691d3a0c
commit 0ba01cd111
183 changed files with 3745 additions and 4354 deletions
+7 -7
View File
@@ -4,7 +4,7 @@ The backend generator exposes authenticated schema-inspection and generation end
## Endpoints
Routes are registered in `backend/start/routes.ts`.
Routes are registered in `apps/backend/start/routes.ts`.
| Method | Path | Controller method | Purpose |
| ------ | ---------------------------- | ----------------- | -------------------------------------------------- |
@@ -16,7 +16,7 @@ All three endpoints use `middleware.auth()`.
## Database Inspection
`backend/app/services/database_inspector.ts` reads PostgreSQL `information_schema`.
`apps/backend/app/services/database_inspector.ts` reads PostgreSQL `information_schema`.
- Table discovery is limited to the `public` schema.
- framework, authentication, access-control, migration, and PostgreSQL system tables are excluded.
@@ -45,7 +45,7 @@ Nullable database columns receive `| null` in generated model/entity types and o
For module name `<name>`, table `<table>`, and derived module class `<ModuleName>`, selected assets are written under:
```txt
backend/modules/<ModuleName>/
apps/backend/modules/<ModuleName>/
├── api/
│ ├── controllers/<entity>_api_controller.ts
│ ├── validators/<entity>_create_api_validator.ts
@@ -63,7 +63,7 @@ backend/modules/<ModuleName>/
Tests are written under:
```txt
backend/tests/modules/<ModuleName>/
apps/backend/tests/modules/<ModuleName>/
├── <entity>.spec.ts
└── <entity>.api.spec.ts
```
@@ -74,7 +74,7 @@ backend/tests/modules/<ModuleName>/
### Model
Renders `backend/app/templates/backend/model.hbs` with columns, inferred relationships, searchable fields, and optional password hashing.
Renders `apps/backend/app/templates/backend/model.hbs` with columns, inferred relationships, searchable fields, and optional password hashing.
### Controller and routes
@@ -86,7 +86,7 @@ Creates separate create and update Vine validators. Primary keys and timestamp/d
### Policy and permissions
Creates a Bouncer policy with view/create/update/delete checks, creates `config/permissions.ts`, and adds a lazy policy import to `backend/app/policies/main.ts` when missing.
Creates a Bouncer policy with view/create/update/delete checks, creates `config/permissions.ts`, and adds a lazy policy import to `apps/backend/app/policies/main.ts` when missing.
Permission slugs are derived from the module name, for example:
@@ -123,7 +123,7 @@ The controller registers Handlebars helpers for `eq`, `not`, `or`, and `and`. Ne
## Extending the Backend Generator
1. Add or update a Handlebars template under `backend/app/templates/`.
1. Add or update a Handlebars template under `apps/backend/app/templates/`.
2. Add an explicit destination path in the controller `paths` object.
3. Create its parent directory through the existing path initialization.
4. Render only when the corresponding asset is selected.