@promakeai/cli 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,7 +25,7 @@ promake doctor
25
25
 
26
26
  | Command | Description |
27
27
  |---------|-------------|
28
- | `promake create <name>` | Scaffold a new React project |
28
+ | `promake create <name>` | Scaffold a new React project (generates admin token) |
29
29
  | `promake add <items...>` | Add modules, components, or pages |
30
30
  | `promake remove <modules...>` | Remove installed modules |
31
31
  | `promake sync` | Install missing modules from promake.json |
@@ -35,18 +35,52 @@ promake doctor
35
35
  | `promake init` | Initialize promake.json |
36
36
  | `promake zip / unzip` | Archive utilities |
37
37
 
38
- ## Documentation
39
-
40
- - **[Docs Index](./docs/index.md)** - Full documentation hub
41
- - **[Workflow Guide](./docs/workflow.md)** - Branching, versioning & publish workflow
42
- - **[AI Agent Guide](./docs/ai-agent-guide.md)** - Integrating modules with DB + i18n
43
-
44
38
  ## Data Layer
45
39
 
46
40
  Projects generated by Promake include `@promakeai/dbreact` with a JSON schema
47
- (`src/db/schema.json`) and a prebuilt SQLite database (`public/data/database.db`).
41
+ (`src/db/schema.json`) and support for both SQLite and REST API modes.
48
42
  Use `@/db` hooks (`useDbList`, `useDbGet`, etc.) for data access.
49
43
 
44
+ ### Database Modes
45
+
46
+ - **SQLite** (default) — Prebuilt `database.db` loaded via sql.js WASM in the browser
47
+ - **REST API** — Connects to a remote API with automatic Bearer auth for logged-in users
48
+
49
+ ### Auth Integration
50
+
51
+ When REST API mode is active, the template's `AppDbProvider` reads auth tokens from
52
+ localStorage (where auth-core's Zustand store persists under `"auth-storage"` key).
53
+ No direct dependency on auth-core module code.
54
+
55
+ ### Admin Token
56
+
57
+ During `promake create`, a UUID admin token is generated and written to `.env` as
58
+ `VITE_DB_ADMIN_TOKEN`. This token is used by `@promakeai/dbcli` for authenticated
59
+ REST API access when managing the project's database.
60
+
61
+ ### Schema Permissions
62
+
63
+ All template tables include `$permissions` metadata for role-based access control:
64
+
65
+ ```json
66
+ "$permissions": {
67
+ "anon": ["read"],
68
+ "user": ["read"],
69
+ "admin": ["read", "create", "update", "delete"]
70
+ }
71
+ ```
72
+
73
+ Roles: `anon`, `user`, `admin`. Actions: `create`, `read`, `update`, `delete`.
74
+
75
+ ## Available Presets
76
+
77
+ | Preset | Description |
78
+ |--------|-------------|
79
+ | `ecommerce` | Full e-commerce with products, categories, cart |
80
+ | `blog` | Blog with posts, categories, comments |
81
+ | `portfolio` | Portfolio with projects and sections |
82
+ | `empty` | Minimal template with no pre-installed modules |
83
+
50
84
  ## Development
51
85
 
52
86
  ```bash
@@ -66,6 +100,12 @@ bun test
66
100
  bun run typecheck
67
101
  ```
68
102
 
103
+ ## Related Packages
104
+
105
+ - [@promakeai/dbreact](https://www.npmjs.com/package/@promakeai/dbreact) — React database hooks (used in template)
106
+ - [@promakeai/dbcli](https://www.npmjs.com/package/@promakeai/dbcli) — Database CLI tool
107
+ - [@promakeai/orm](https://www.npmjs.com/package/@promakeai/orm) — Core ORM
108
+
69
109
  ## License
70
110
 
71
111
  MIT