Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Server
PORT=8001
NODE_ENV=development

# GitHub OAuth
GITHUB_CLIENT_ID=your_client_id_here
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Carmel Judgment Protocol 😼🧪

on:
pull_request:
branches: ["main"]
push:
branches: ["main"]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
judgment:
name: Carmel Reviews Your Work
runs-on: ubuntu-latest

steps:
- name: 😼 Checkout for Inspection
uses: actions/checkout@v4

- name: 🧶 Set Up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"

- name: 🐾 Install Dependencies
run: npm ci

- name: 🔍 Run Test Suite
run: npm test

- name: 🟢 Carmel Verdict
if: success()
run: echo "😼✨ Acceptable. You may proceed."

- name: 🔴 Carmel Displeased
if: failure()
run: echo "😾❌ Unacceptable. Fix it."
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/.env
/package-lock.json
/.idea/
/dist/
/node_modules/
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,69 @@ Uses Jest + Supertest for API validation.
- **Process manager**: PM2

------------------------------------------------------------------------
## Operations (PM2)

This API is intended to run under **PM2** in production.

### Quick Commands (Shell Aliases)

On the VPS, add these to `~/.bashrc` (or `~/.zshrc`):

``` bash
# ── Human Pattern Lab · API ─────────────────────────────
alias lab-api-start='pm2 start ecosystem.config.cjs --env production'
alias lab-api-restart='pm2 restart lab-api'
alias lab-api-stop='pm2 stop lab-api'
alias lab-api-logs='pm2 logs lab-api'
alias lab-api-status='pm2 status'
```

Reload your shell:

``` bash
source ~/.bashrc
```

Usage:

``` bash
lab-api-start
lab-api-logs
lab-api-restart
```

### NPM Scripts (Portable Ops)

These scripts live in `package.json` so the operational workflow is
discoverable:

``` bash
npm run pm2:start
npm run pm2:restart
npm run pm2:stop
npm run pm2:logs
npm run pm2:status
```

### Notes

- Prefer **`pm2 restart lab-api`** for routine deploys once the
process exists.
- `pm2 start ecosystem.config.cjs --env production` is ideal for first
bootstrapping.
- After the first successful production start, persist the process
list:

``` bash
pm2 save
pm2 startup
```

(Then run the one-line command PM2 prints to enable startup on reboot.)


------------------------------------------------------------------------


## License

Expand Down
77 changes: 0 additions & 77 deletions api/admin/login.tsx

This file was deleted.

3 changes: 2 additions & 1 deletion cli/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const publish = new Command('publish')
const client = new LabClient(options.url, options.token);

const payload = {
...metadata,
title: metadata.title,
slug: metadata.slug,
content,
tags: metadata.tags || [],
artifacts: metadata.artifacts || []
Expand Down
Loading