iranti-control-plane 0.4.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 +131 -0
- package/bin/iranti-cp.js +3 -0
- package/dist/server/bundle.cjs +39565 -0
- package/migrations/001_create_staff_events.sql +65 -0
- package/migrations/002_create_archive_flags.sql +46 -0
- package/migrations/003_staff_events_metrics_index.sql +16 -0
- package/package.json +59 -0
- package/public/control-plane/assets/index-FDSDCWEl.css +1 -0
- package/public/control-plane/assets/index-oM_6VuRn.js +77 -0
- package/public/control-plane/favicon.svg +12 -0
- package/public/control-plane/index.html +17 -0
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Iranti Control Plane
|
|
2
|
+
|
|
3
|
+
Local-first operator dashboard for [Iranti](https://github.com/nfemmanuel/iranti) - inspect memory, watch Staff activity, manage instances, and diagnose your setup without raw SQL.
|
|
4
|
+
|
|
5
|
+
## Status
|
|
6
|
+
|
|
7
|
+
Current package version: `0.4.0`.
|
|
8
|
+
The operator surface is live and under active UX hardening.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
For the packaged control-plane CLI path (after npm publish, or from a locally packed tarball):
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g iranti-control-plane
|
|
16
|
+
iranti-cp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
That path uses the bundled server and picks the first free port in `3000-3010` unless `CONTROL_PLANE_PORT` is set.
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
**Prerequisites**: Node.js 20+, a running Iranti instance with a PostgreSQL database.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# 1. Clone
|
|
27
|
+
git clone https://github.com/nfemmanuel/iranti-control-plane
|
|
28
|
+
cd iranti-control-plane
|
|
29
|
+
|
|
30
|
+
# 2. Make sure the repo root has a project binding file (.env.iranti)
|
|
31
|
+
# created by `iranti setup` or `iranti configure project .`
|
|
32
|
+
|
|
33
|
+
# 3. Install all dependencies (server, client, and root workspace tools)
|
|
34
|
+
bash scripts/dev-setup.sh # macOS/Linux
|
|
35
|
+
# or: .\scripts\dev-setup.ps1 # Windows PowerShell
|
|
36
|
+
# or manually: npm install && npm run setup
|
|
37
|
+
|
|
38
|
+
# 4. Run the migration (creates required tables)
|
|
39
|
+
npm run migrate
|
|
40
|
+
|
|
41
|
+
# 5. Start the dev servers (server + client together)
|
|
42
|
+
npm run dev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Open http://localhost:5173 for the frontend dev server.
|
|
46
|
+
|
|
47
|
+
### Port model
|
|
48
|
+
|
|
49
|
+
The control plane has two common local startup modes:
|
|
50
|
+
|
|
51
|
+
- **From source (`npm run dev`)**: the control-plane server listens on `3002` by default and the Vite frontend listens on `5173`.
|
|
52
|
+
- **From the packaged CLI (`iranti-cp`)**: the control plane picks the first free port in `3000-3010` unless you set `CONTROL_PLANE_PORT`.
|
|
53
|
+
|
|
54
|
+
Iranti runtimes themselves still typically start on `3001`, and local PostgreSQL defaults remain on `5432`.
|
|
55
|
+
|
|
56
|
+
### Local PostgreSQL with Docker
|
|
57
|
+
|
|
58
|
+
No system PostgreSQL? Spin one up:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
docker compose up -d
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This starts a `pgvector/pgvector:pg16` instance on port 5432 with database `iranti`, user `iranti`, password `iranti`. Then set in `.env.iranti`:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
DATABASE_URL=postgresql://iranti:iranti@localhost:5432/iranti
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Project Structure
|
|
71
|
+
|
|
72
|
+
| Path | Contents |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `docs/prd/` | Product requirements |
|
|
75
|
+
| `docs/specs/` | Architecture and design specs |
|
|
76
|
+
| `docs/tickets/` | Ticket breakdown |
|
|
77
|
+
| `docs/implementation/` | Backend implementation plans |
|
|
78
|
+
| `src/server/` | Express API server (TypeScript) |
|
|
79
|
+
| `src/client/` | React frontend (Vite + TypeScript) |
|
|
80
|
+
| `scripts/` | Dev setup scripts |
|
|
81
|
+
| `public/control-plane/` | Client build output (generated) |
|
|
82
|
+
|
|
83
|
+
## Development
|
|
84
|
+
|
|
85
|
+
### Root workspace scripts
|
|
86
|
+
|
|
87
|
+
The root `package.json` provides convenience scripts that orchestrate both server and client. Run these from the repo root:
|
|
88
|
+
|
|
89
|
+
| Script | Command | Description |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| `dev` | `npm run dev` | Start server and client concurrently with labeled output |
|
|
92
|
+
| `build` | `npm run build` | Build client then server for production |
|
|
93
|
+
| `start` | `npm run start` | Start the compiled server (production mode) |
|
|
94
|
+
| `migrate` | `npm run migrate` | Run database migrations |
|
|
95
|
+
| `setup` | `npm run setup` | Install server and client dependencies |
|
|
96
|
+
|
|
97
|
+
> `npm run dev` uses `concurrently` (a root devDependency). Run `npm install` at the repo root — or use `dev-setup.sh` / `dev-setup.ps1` — before using it.
|
|
98
|
+
|
|
99
|
+
### Run processes individually
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Server (port 3002 in source dev, hot-reloaded via tsx watch)
|
|
103
|
+
npm run dev --prefix src/server
|
|
104
|
+
|
|
105
|
+
# Client (port 5173, Vite HMR)
|
|
106
|
+
npm run dev --prefix src/client
|
|
107
|
+
|
|
108
|
+
# Build for production
|
|
109
|
+
npm run build --prefix src/client # outputs to public/control-plane/
|
|
110
|
+
npm run build --prefix src/server # outputs to src/server/dist/
|
|
111
|
+
|
|
112
|
+
# Run migrations
|
|
113
|
+
npm run migrate --prefix src/server
|
|
114
|
+
|
|
115
|
+
# Type check
|
|
116
|
+
cd src/server && npx tsc --noEmit
|
|
117
|
+
cd src/client && npx tsc --noEmit
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Architecture
|
|
121
|
+
|
|
122
|
+
The control plane is a standalone Express server + React SPA that connects to the same PostgreSQL database as your Iranti instance. It never writes to Iranti's core tables — all state changes go through Iranti's API.
|
|
123
|
+
|
|
124
|
+
- **Server**: Express on port `3002` in source development; the packaged binary auto-selects the first free port in `3000-3010` unless `CONTROL_PLANE_PORT` is set
|
|
125
|
+
- **Client**: React 18 + Vite, proxies `/api` to the control-plane server at `localhost:3002` in development
|
|
126
|
+
- **Database**: Shares the Iranti PostgreSQL instance; reads core tables, writes only to control-plane-owned tables
|
|
127
|
+
|
|
128
|
+
See `docs/specs/control-plane-api.md` for the full API spec and `docs/prd/control-plane.md` for product requirements.
|
|
129
|
+
|
|
130
|
+
For release and manual publish checks, see [`docs/guides/releasing.md`](docs/guides/releasing.md).
|
|
131
|
+
|
package/bin/iranti-cp.js
ADDED