WebUI module split; docs
This commit is contained in:
40
README.md
40
README.md
@@ -1,25 +1,51 @@
|
|||||||
# govoplan-files
|
# govoplan-files
|
||||||
|
|
||||||
GovOPlaN Files module.
|
GovOPlaN Files is the managed file module. It bundles backend storage APIs and the Files WebUI package so file features can be installed as one module.
|
||||||
|
|
||||||
This repository owns the Files module backend manifest, API router, schemas, storage service layer, SQLAlchemy model definitions, migration registration path, and Files WebUI source bundle. Runtime access to auth/session/settings and cross-module models is provided by govoplan-core and the installed module packages.
|
## Ownership
|
||||||
|
|
||||||
The WebUI bundle is exposed as the local npm package `@govoplan/files-webui` from `webui/`. It depends on `@govoplan/core-webui` for shared API/CSRF/auth helpers, core types, generic UI components and shell primitives.
|
This repository owns:
|
||||||
|
|
||||||
|
- backend module manifest `files`
|
||||||
|
- file permissions such as `files:file:read`, `files:file:upload`, `files:file:download`, `files:file:organize`, and `files:file:delete`
|
||||||
|
- file-space, file metadata, share, upload, download, pattern matching, and transfer APIs
|
||||||
|
- SQLAlchemy file models and module migration registration
|
||||||
|
- WebUI package `@govoplan/files-webui`
|
||||||
|
- `/files` route and IconRail navigation contribution
|
||||||
|
|
||||||
|
Core owns auth, tenants, RBAC evaluation, database/session primitives, CSRF/API helpers, and shell layout.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
Install the backend module through the core development environment:
|
Install through the core environment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /mnt/DATA/git/govoplan-core
|
cd /mnt/DATA/git/govoplan-core
|
||||||
./.venv/bin/python -m pip install -r requirements-dev.txt
|
./.venv/bin/python -m pip install -r requirements-dev.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
Install the WebUI host dependencies from the core WebUI runner:
|
Run the WebUI from the core host:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /mnt/DATA/git/govoplan-core/webui
|
cd /mnt/DATA/git/govoplan-core/webui
|
||||||
PATH=/home/zemion/.nvm/versions/node/v22.22.3/bin:$PATH /home/zemion/.nvm/versions/node/v22.22.3/bin/npm install
|
PATH=/home/zemion/.nvm/versions/node/v22.22.3/bin:$PATH /home/zemion/.nvm/versions/node/v22.22.3/bin/npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
The backend module is registered through the `govoplan.modules` entry point `files`.
|
## Module integration
|
||||||
|
|
||||||
|
Backend entry point:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[project.entry-points."govoplan.modules"]
|
||||||
|
files = "govoplan_files.backend.manifest:get_manifest"
|
||||||
|
```
|
||||||
|
|
||||||
|
Frontend package:
|
||||||
|
|
||||||
|
```text
|
||||||
|
@govoplan/files-webui
|
||||||
|
```
|
||||||
|
|
||||||
|
The campaign module can integrate with files when both modules are installed, for example for managed attachment selection and campaign file sharing.
|
||||||
|
|
||||||
|
Platform RBAC and governance rules are documented in `govoplan-core/docs/`.
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
import { Folder } from "lucide-react";
|
import { Folder } from "lucide-react";
|
||||||
|
import { createElement, lazy } from "react";
|
||||||
import type { PlatformWebModule } from "@govoplan/core-webui";
|
import type { PlatformWebModule } from "@govoplan/core-webui";
|
||||||
|
const FilesPage = lazy(() => import("./features/files/FilesPage"));
|
||||||
|
|
||||||
|
const fileRead = ["files:file:read"];
|
||||||
|
|
||||||
export const filesModule: PlatformWebModule = {
|
export const filesModule: PlatformWebModule = {
|
||||||
id: "files",
|
id: "files",
|
||||||
label: "Files",
|
label: "Files",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
dependencies: ["access"],
|
dependencies: ["access"],
|
||||||
navItems: [{ to: "/files", label: "Files", icon: Folder, anyOf: ["files:file:read"], order: 40 }]
|
navItems: [{ to: "/files", label: "Files", icon: Folder, anyOf: fileRead, order: 40 }],
|
||||||
|
routes: [
|
||||||
|
{ path: "/files", anyOf: fileRead, order: 40, render: ({ settings, auth }) => createElement(FilesPage, { settings, auth }) }
|
||||||
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
export default filesModule;
|
export default filesModule;
|
||||||
|
|||||||
Reference in New Issue
Block a user