@programinglive/dev-workflow-mcp-server 1.7.11 โ†’ 1.7.12

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/.dockerignore ADDED
@@ -0,0 +1,60 @@
1
+ # Node modules - will be installed in container
2
+ node_modules
3
+ npm-debug.log
4
+ yarn-error.log
5
+
6
+ # Git files
7
+ .git
8
+ .gitignore
9
+ .gitattributes
10
+
11
+ # Environment files
12
+ .env
13
+ .env.local
14
+ .env.*.local
15
+
16
+ # Development files
17
+ *.log
18
+ *.pid
19
+ *.seed
20
+ *.pid.lock
21
+
22
+ # IDE files
23
+ .vscode
24
+ .idea
25
+ *.swp
26
+ *.swo
27
+ *~
28
+
29
+ # Test files
30
+ tests
31
+ *.test.js
32
+ coverage
33
+
34
+ # Documentation
35
+ docs
36
+ *.md
37
+ !README.md
38
+
39
+ # CI/CD
40
+ .github
41
+ .husky
42
+
43
+ # Build artifacts
44
+ dist
45
+ build
46
+ .cache
47
+
48
+ # OS files
49
+ .DS_Store
50
+ Thumbs.db
51
+
52
+ # Web frontend (if not needed in container)
53
+ web/node_modules
54
+ web/dist
55
+ web/.next
56
+
57
+ # Docker files
58
+ Dockerfile
59
+ docker-compose*.yml
60
+ .dockerignore
package/.env.example CHANGED
@@ -5,6 +5,7 @@ DEV_WORKFLOW_DB_TYPE=sqlite
5
5
  # Connection URLs
6
6
  # MySQL Example: mysql://user:password@localhost:3306/database
7
7
  # Postgres Example: postgres://user:password@localhost:5432/database
8
+ # Postgres Docker Example: postgres://devworkflow:password@postgres:5432/devworkflow
8
9
  DEV_WORKFLOW_DB_URL=
9
10
 
10
11
  # Optional: Override user ID
@@ -0,0 +1,16 @@
1
+ # Production Environment Configuration for Docker Deployment
2
+ # Copy this file to .env on your GCP instance
3
+
4
+ # Database Configuration
5
+ DEV_WORKFLOW_DB_TYPE=postgres
6
+ DEV_WORKFLOW_DB_URL=postgres://devworkflow:YOUR_SECURE_PASSWORD_HERE@postgres:5432/devworkflow
7
+
8
+ # PostgreSQL Password (used by docker-compose)
9
+ # IMPORTANT: Change this to a secure password!
10
+ POSTGRES_PASSWORD=YOUR_SECURE_PASSWORD_HERE
11
+
12
+ # Optional: User ID for multi-user environments
13
+ # DEV_WORKFLOW_USER_ID=your-username
14
+
15
+ # Node Environment
16
+ NODE_ENV=production
package/CHANGELOG.md CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.7.12](https://github.com/programinglive/dev-workflow-mcp-server/compare/v1.7.11...v1.7.12) (2025-12-17)
6
+
7
+
8
+ ### ๐Ÿ“ Documentation
9
+
10
+ * post-release cleanup v1.7.11 ([c2ee733](https://github.com/programinglive/dev-workflow-mcp-server/commit/c2ee733bb9ec21e6ad39e564aa1fc315ca79cff6))
11
+
12
+
13
+ ### โœจ Features
14
+
15
+ * add authentication system with login page and protected routes ([2acb20e](https://github.com/programinglive/dev-workflow-mcp-server/commit/2acb20efb25cddb3d2b6ee80427310c3315582dc))
16
+ * add Docker deployment support with PostgreSQL for GCP ([3adb4cb](https://github.com/programinglive/dev-workflow-mcp-server/commit/3adb4cb9ace571faf7f2138634481362c24f2730))
17
+ * expose PostgreSQL port for remote access ([b1d4066](https://github.com/programinglive/dev-workflow-mcp-server/commit/b1d40665a1c01960184508d53c0bec0b5c051e4b))
18
+ * revamp history page UI and remove history from landing ([a9d0e4e](https://github.com/programinglive/dev-workflow-mcp-server/commit/a9d0e4e70b8aa5ed3457f661cb3dbdca2d8d2a30))
19
+ * simplify docker-compose to only PostgreSQL, improve logout button UI ([4530862](https://github.com/programinglive/dev-workflow-mcp-server/commit/4530862b33178d6391ee294f74ef222843f5d5a4))
20
+
21
+
22
+ ### ๐Ÿ› Bug Fixes
23
+
24
+ * suppress 401 auth errors in console ([b63e63b](https://github.com/programinglive/dev-workflow-mcp-server/commit/b63e63b60a4ba8236db1848a77d2f39f49e644b3))
25
+ * **web:** resolve 500 error on history API and auth sync ([88bbff0](https://github.com/programinglive/dev-workflow-mcp-server/commit/88bbff043f99e06a7b8ed9b9789d87d22e1f9035))
26
+
27
+
28
+ ### ๐Ÿงน Chores
29
+
30
+ * configure commitlint and husky via commiter setup ([4de6c84](https://github.com/programinglive/dev-workflow-mcp-server/commit/4de6c8400b6869503bee8407bb23266779133144))
31
+ * update website to v1.7.11 and fix dependencies ([da80b1c](https://github.com/programinglive/dev-workflow-mcp-server/commit/da80b1c9d5bdf10e1387d4b2d1e98b8d2fee5e92))
32
+
5
33
  ### [1.7.11](https://github.com/programinglive/dev-workflow-mcp-server/compare/v1.7.10...v1.7.11) (2025-12-16)
6
34
 
7
35
 
package/Dockerfile ADDED
@@ -0,0 +1,32 @@
1
+ # Multi-stage build for dev-workflow MCP server
2
+ FROM node:20-alpine AS base
3
+
4
+ # Install build dependencies for native modules (better-sqlite3, pg)
5
+ RUN apk add --no-cache python3 make g++ postgresql-client
6
+
7
+ WORKDIR /app
8
+
9
+ # Copy package files
10
+ COPY package*.json ./
11
+
12
+ # Install dependencies (skip postinstall since we don't need state files at build time)
13
+ RUN npm ci --only=production --ignore-scripts
14
+
15
+ # Copy application code
16
+ COPY . .
17
+
18
+ # Create data directory for workflow state
19
+ RUN mkdir -p /app/data && \
20
+ chown -R node:node /app
21
+
22
+ # Switch to non-root user
23
+ USER node
24
+
25
+ # Set environment variables
26
+ ENV NODE_ENV=production
27
+ ENV DEV_WORKFLOW_DB_TYPE=postgres
28
+
29
+ # The MCP server runs on stdio, no port exposure needed
30
+ # Communication happens via stdin/stdout
31
+
32
+ CMD ["node", "index.js"]
package/README.md CHANGED
@@ -62,6 +62,26 @@ Plesk supports Node.js applications through its Node.js extension. To deploy the
62
62
 
63
63
  > **Important:** MCP clients (Windsurf, Claude Desktop, etc.) must launch the server process locally via stdio. Hosting the dashboard on a public domain does **not** expose the MCP interface. Without SSH or another way to execute `node index.js` on the server, users cannot connect their MCP clients to the hosted instance.
64
64
 
65
+ ### Option 4: Deploy with Docker on Google Cloud
66
+
67
+ Deploy the MCP server to Google Cloud Compute Engine using Docker and PostgreSQL for a production-ready, cloud-hosted setup.
68
+
69
+ **Quick Start:**
70
+ 1. SSH into your GCP instance
71
+ 2. Run the setup script: `bash scripts/setup-gcp-instance.sh`
72
+ 3. Clone the repository and configure `.env`
73
+ 4. Start containers: `docker-compose up -d`
74
+ 5. Update your local MCP client config to connect via SSH
75
+
76
+ **Benefits:**
77
+ - โœ… PostgreSQL database for robust data persistence
78
+ - โœ… Containerized deployment for consistency
79
+ - โœ… Remote access via SSH tunneling
80
+ - โœ… Easy updates and rollbacks
81
+
82
+ See the [GCP Deployment Guide](./docs/GCP_DEPLOYMENT.md) for complete step-by-step instructions.
83
+
84
+
65
85
  #### Two Usage Modes
66
86
 
67
87
  - **Local (source)**: Point your MCP client to `index.js`. This runs directly from source and requires no build step. Recommended for MCP usage.
@@ -0,0 +1,22 @@
1
+ -- Create users table for authentication
2
+ CREATE TABLE IF NOT EXISTS users (
3
+ id SERIAL PRIMARY KEY,
4
+ username VARCHAR(255) UNIQUE NOT NULL,
5
+ password_hash VARCHAR(255) NOT NULL,
6
+ email VARCHAR(255),
7
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
8
+ last_login TIMESTAMP
9
+ );
10
+
11
+ -- Create index on username for faster lookups
12
+ CREATE INDEX IF NOT EXISTS idx_users_username ON users(username);
13
+
14
+ -- Create sessions table for express-session
15
+ CREATE TABLE IF NOT EXISTS "session" (
16
+ "sid" varchar NOT NULL COLLATE "default",
17
+ "sess" json NOT NULL,
18
+ "expire" timestamp(6) NOT NULL,
19
+ CONSTRAINT "session_pkey" PRIMARY KEY ("sid")
20
+ );
21
+
22
+ CREATE INDEX IF NOT EXISTS "IDX_session_expire" ON "session" ("expire");
@@ -0,0 +1,14 @@
1
+ -- Create workflow_history table
2
+ CREATE TABLE IF NOT EXISTS workflow_history (
3
+ id SERIAL PRIMARY KEY,
4
+ task_type VARCHAR(50) NOT NULL,
5
+ description TEXT NOT NULL,
6
+ commit_message TEXT,
7
+ completed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
8
+ tests_passed BOOLEAN DEFAULT FALSE,
9
+ documentation_type VARCHAR(50),
10
+ user_id INTEGER REFERENCES users(id)
11
+ );
12
+
13
+ -- Create index on completed_at for faster sorting
14
+ CREATE INDEX IF NOT EXISTS idx_workflow_history_completed_at ON workflow_history(completed_at DESC);
@@ -0,0 +1,3 @@
1
+ -- Add missing columns for frontend compatibility
2
+ ALTER TABLE workflow_history ADD COLUMN IF NOT EXISTS tests_passed BOOLEAN DEFAULT FALSE;
3
+ ALTER TABLE workflow_history ADD COLUMN IF NOT EXISTS documentation_type VARCHAR(50);
@@ -0,0 +1,24 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ postgres:
5
+ image: postgres:16-alpine
6
+ container_name: dev-workflow-postgres
7
+ restart: unless-stopped
8
+ environment:
9
+ POSTGRES_USER: devworkflow
10
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-devworkflow_secure_password_change_me}
11
+ POSTGRES_DB: devworkflow
12
+ ports:
13
+ - "5432:5432"
14
+ volumes:
15
+ - postgres_data:/var/lib/postgresql/data
16
+ healthcheck:
17
+ test: [ "CMD-SHELL", "pg_isready -U devworkflow" ]
18
+ interval: 10s
19
+ timeout: 5s
20
+ retries: 5
21
+
22
+ volumes:
23
+ postgres_data:
24
+ driver: local
@@ -0,0 +1,298 @@
1
+ # Deploying to Google Cloud Platform with Docker
2
+
3
+ This guide walks you through deploying the dev-workflow MCP server to Google Cloud Compute Engine using Docker and PostgreSQL.
4
+
5
+ ## Prerequisites
6
+
7
+ - Google Cloud Platform account with a Compute Engine instance running
8
+ - SSH access to your GCP instance
9
+ - Git installed locally and on GCP instance
10
+ - Basic familiarity with Docker and SSH
11
+
12
+ ## Architecture Overview
13
+
14
+ The deployment consists of two Docker containers:
15
+ - **MCP Server**: Node.js application running the dev-workflow MCP server
16
+ - **PostgreSQL**: Database for persistent workflow state storage
17
+
18
+ Communication between your local MCP client and the cloud server happens via SSH tunneling.
19
+
20
+ ## Step 1: Prepare Your GCP Instance
21
+
22
+ ### 1.1 SSH into Your Instance
23
+
24
+ ```bash
25
+ ssh your-username@YOUR_GCP_IP
26
+ ```
27
+
28
+ ### 1.2 Run the Setup Script
29
+
30
+ From your local machine, copy the setup script to your GCP instance:
31
+
32
+ ```bash
33
+ scp scripts/setup-gcp-instance.sh your-username@YOUR_GCP_IP:~/
34
+ ssh your-username@YOUR_GCP_IP 'bash ~/setup-gcp-instance.sh'
35
+ ```
36
+
37
+ This script will:
38
+ - Install Docker and Docker Compose
39
+ - Install Git
40
+ - Create the application directory
41
+
42
+ **Note**: You may need to log out and back in for Docker group permissions to take effect.
43
+
44
+ ## Step 2: Deploy the Application
45
+
46
+ ### 2.1 Clone the Repository
47
+
48
+ On your GCP instance:
49
+
50
+ ```bash
51
+ cd ~/dev-workflow-mcp-server
52
+ git clone https://github.com/programinglive/dev-workflow-mcp-server.git .
53
+ ```
54
+
55
+ ### 2.2 Configure Environment Variables
56
+
57
+ Create a `.env` file from the production template:
58
+
59
+ ```bash
60
+ cp .env.production .env
61
+ nano .env
62
+ ```
63
+
64
+ Update the following values:
65
+ - `POSTGRES_PASSWORD`: Set a strong, unique password
66
+ - `DEV_WORKFLOW_DB_URL`: Update with the same password
67
+ - `DEV_WORKFLOW_USER_ID`: (Optional) Set your username
68
+
69
+ Example `.env`:
70
+ ```bash
71
+ DEV_WORKFLOW_DB_TYPE=postgres
72
+ DEV_WORKFLOW_DB_URL=postgres://devworkflow:MySecureP@ssw0rd@postgres:5432/devworkflow
73
+ POSTGRES_PASSWORD=MySecureP@ssw0rd
74
+ DEV_WORKFLOW_USER_ID=dhika
75
+ NODE_ENV=production
76
+ ```
77
+
78
+ ### 2.3 Start the Containers
79
+
80
+ ```bash
81
+ docker-compose up -d
82
+ ```
83
+
84
+ ### 2.4 Verify Deployment
85
+
86
+ Check that both containers are running:
87
+
88
+ ```bash
89
+ docker-compose ps
90
+ ```
91
+
92
+ You should see:
93
+ ```
94
+ NAME STATUS
95
+ dev-workflow-mcp Up
96
+ dev-workflow-postgres Up (healthy)
97
+ ```
98
+
99
+ View logs:
100
+ ```bash
101
+ docker-compose logs -f mcp-server
102
+ ```
103
+
104
+ ## Step 3: Configure Local MCP Client
105
+
106
+ Update your local MCP client configuration to connect via SSH.
107
+
108
+ ### Windows (Claude Desktop)
109
+
110
+ Edit `C:\Users\DHIKA\.gemini\antigravity\mcp_config.json`:
111
+
112
+ ```json
113
+ {
114
+ "mcpServers": {
115
+ "dev-workflow": {
116
+ "command": "ssh",
117
+ "args": [
118
+ "-i", "C:\\Users\\DHIKA\\.ssh\\id_rsa",
119
+ "your-username@34.50.121.142",
120
+ "docker", "exec", "-i", "dev-workflow-mcp", "node", "/app/index.js"
121
+ ]
122
+ }
123
+ }
124
+ }
125
+ ```
126
+
127
+ ### Linux/Mac
128
+
129
+ Edit your MCP config file:
130
+
131
+ ```json
132
+ {
133
+ "mcpServers": {
134
+ "dev-workflow": {
135
+ "command": "ssh",
136
+ "args": [
137
+ "-i", "/home/user/.ssh/id_rsa",
138
+ "your-username@34.50.121.142",
139
+ "docker", "exec", "-i", "dev-workflow-mcp", "node", "/app/index.js"
140
+ ]
141
+ }
142
+ }
143
+ }
144
+ ```
145
+
146
+ **Important**: Replace:
147
+ - `your-username` with your actual GCP username
148
+ - `34.50.121.142` with your actual GCP external IP
149
+ - SSH key path with your actual key location
150
+
151
+ ## Step 4: Test the Connection
152
+
153
+ ### 4.1 Test SSH Connection
154
+
155
+ From your local machine:
156
+
157
+ ```bash
158
+ ssh your-username@34.50.121.142 'docker exec -i dev-workflow-mcp node /app/index.js call get_workflow_status'
159
+ ```
160
+
161
+ You should see the workflow status output.
162
+
163
+ ### 4.2 Test via MCP Client
164
+
165
+ Restart your MCP client (e.g., Claude Desktop) and try using a dev-workflow command like `start_task`.
166
+
167
+ ## Updating the Deployment
168
+
169
+ ### Automated Deployment
170
+
171
+ Use the deployment script from your local machine:
172
+
173
+ ```bash
174
+ # Set environment variables
175
+ export GCP_USER=your-username
176
+ export GCP_HOST=34.50.121.142
177
+ export GCP_SSH_KEY=~/.ssh/id_rsa
178
+
179
+ # Run deployment
180
+ bash scripts/deploy-gcp.sh
181
+ ```
182
+
183
+ ### Manual Update
184
+
185
+ On your GCP instance:
186
+
187
+ ```bash
188
+ cd ~/dev-workflow-mcp-server
189
+ git pull origin main
190
+ docker-compose down
191
+ docker-compose build --no-cache
192
+ docker-compose up -d
193
+ ```
194
+
195
+ ## Database Management
196
+
197
+ ### Backup Database
198
+
199
+ ```bash
200
+ docker exec dev-workflow-postgres pg_dump -U devworkflow devworkflow > backup.sql
201
+ ```
202
+
203
+ ### Restore Database
204
+
205
+ ```bash
206
+ cat backup.sql | docker exec -i dev-workflow-postgres psql -U devworkflow devworkflow
207
+ ```
208
+
209
+ ### Access PostgreSQL Console
210
+
211
+ ```bash
212
+ docker exec -it dev-workflow-postgres psql -U devworkflow devworkflow
213
+ ```
214
+
215
+ Common commands:
216
+ - `\dt` - List tables
217
+ - `\d table_name` - Describe table
218
+ - `SELECT * FROM workflow_state;` - View workflow data
219
+
220
+ ## Troubleshooting
221
+
222
+ ### Container Won't Start
223
+
224
+ Check logs:
225
+ ```bash
226
+ docker-compose logs mcp-server
227
+ docker-compose logs postgres
228
+ ```
229
+
230
+ ### Database Connection Issues
231
+
232
+ Verify PostgreSQL is healthy:
233
+ ```bash
234
+ docker-compose ps
235
+ docker exec dev-workflow-postgres pg_isready -U devworkflow
236
+ ```
237
+
238
+ ### SSH Connection Fails
239
+
240
+ Test basic SSH:
241
+ ```bash
242
+ ssh -v your-username@YOUR_GCP_IP
243
+ ```
244
+
245
+ Check SSH key permissions:
246
+ ```bash
247
+ chmod 600 ~/.ssh/id_rsa
248
+ ```
249
+
250
+ ### MCP Client Can't Connect
251
+
252
+ 1. Verify SSH works: `ssh your-username@YOUR_GCP_IP 'echo test'`
253
+ 2. Test Docker exec: `ssh your-username@YOUR_GCP_IP 'docker ps'`
254
+ 3. Check MCP server: `ssh your-username@YOUR_GCP_IP 'docker logs dev-workflow-mcp'`
255
+
256
+ ## Security Best Practices
257
+
258
+ 1. **Change Default Passwords**: Always use strong, unique passwords in `.env`
259
+ 2. **Firewall Configuration**: Only expose necessary ports (SSH port 22)
260
+ 3. **SSH Key Authentication**: Disable password authentication, use SSH keys only
261
+ 4. **Regular Updates**: Keep Docker images and system packages updated
262
+ 5. **Backup Regularly**: Schedule automated database backups
263
+
264
+ ## Performance Optimization
265
+
266
+ ### Monitor Resource Usage
267
+
268
+ ```bash
269
+ docker stats
270
+ ```
271
+
272
+ ### Increase PostgreSQL Performance
273
+
274
+ Edit `docker-compose.yml` to add PostgreSQL tuning:
275
+
276
+ ```yaml
277
+ postgres:
278
+ environment:
279
+ POSTGRES_SHARED_BUFFERS: 256MB
280
+ POSTGRES_EFFECTIVE_CACHE_SIZE: 1GB
281
+ ```
282
+
283
+ ## Uninstalling
284
+
285
+ To completely remove the deployment:
286
+
287
+ ```bash
288
+ cd ~/dev-workflow-mcp-server
289
+ docker-compose down -v # -v removes volumes (deletes data!)
290
+ cd ~
291
+ rm -rf dev-workflow-mcp-server
292
+ ```
293
+
294
+ ## Support
295
+
296
+ For issues or questions:
297
+ - GitHub Issues: https://github.com/programinglive/dev-workflow-mcp-server/issues
298
+ - Documentation: https://devworkflow.programinglive.com/
@@ -4,7 +4,7 @@
4
4
  - **Product**: Development Workflow MCP Server
5
5
  - **Prepared by**: Cascade (AI assistant)
6
6
  - **Date**: 2025-12-16
7
- - **Status**: Live v1.7.10
7
+ - **Status**: Live v1.7.11
8
8
 
9
9
  ## 2. Problem Statement
10
10
  Developers need structured guidance to maintain disciplined workflows across projects. Existing tooling lacks enforcement of sequential best practices (testing, documentation, release hygiene) and offers limited visibility into historical task execution.
@@ -4,6 +4,7 @@ Authoritative history of user-visible changes for the Development Workflow MCP S
4
4
 
5
5
  | Version | Date | Notes |
6
6
  |---------|------|-------|
7
+ | 1.7.11 | 2025-12-17 | test: comprehensive DB adapter tests, env support, and warning fixes (64b029a) |
7
8
  | 1.7.10 | 2025-12-16 | update release notes and finalize ci config (92ac78a) |
8
9
  | 1.7.9 | 2025-12-16 | **ci:** apply official npm trusted publishing config (9256583) |
9
10
  | 1.7.8 | 2025-12-16 | **ci:** remove all token config for pure OIDC publishing (d4759cc) |
@@ -33,6 +34,22 @@ Authoritative history of user-visible changes for the Development Workflow MCP S
33
34
 
34
35
 
35
36
 
37
+
38
+ ## 1.7.11 โ€“ ๐Ÿ“ Documentation
39
+
40
+ Released on **2025-12-16**.
41
+
42
+ - fix version status in PRD (fa7912b)
43
+ - implement .env support and fix mysql date persistence (096797c)
44
+ ## 1.7.11 โ€“ ๐Ÿ“ Documentation & ๐Ÿงช Testing
45
+
46
+ Released on **2025-12-17**.
47
+
48
+ - test: comprehensive DB adapter tests for MySQL, PostgreSQL, and SQLite (64b029a)
49
+ - test: implemented env support verification (64b029a)
50
+ - test: fixed deprecation warnings and missing mock exports (64b029a)
51
+ - docs: updated PRD and README with testing guide (64b029a)
52
+
36
53
  ## 1.7.10 โ€“ ๐Ÿงน Chores
37
54
 
38
55
  Released on **2025-12-16**.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@programinglive/dev-workflow-mcp-server",
3
- "version": "1.7.11",
3
+ "version": "1.7.12",
4
4
  "description": "MCP server to enforce development workflow discipline",
5
5
  "homepage": "https://devworkflow.programinglive.com/",
6
6
  "mcpName": "io.github.programinglive/dev-workflow-mcp-server",
@@ -42,14 +42,19 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@modelcontextprotocol/sdk": "^1.0.0",
45
+ "bcrypt": "^5.1.1",
45
46
  "better-sqlite3": "^11.8.0",
47
+ "connect-pg-simple": "^9.0.1",
46
48
  "dotenv": "^17.2.3",
47
49
  "esbuild": "^0.25.0",
50
+ "express": "^4.18.2",
51
+ "express-session": "^1.18.0",
48
52
  "get-port": "^7.1.0",
49
53
  "marked": "^12.0.2",
50
54
  "mysql2": "^3.15.3",
51
55
  "pg": "^8.16.3",
52
- "vite": "^7.1.12"
56
+ "vite": "^7.1.12",
57
+ "ws": "^8.16.0"
53
58
  },
54
59
  "publishConfig": {
55
60
  "access": "public"
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+ import 'dotenv/config';
3
+ import pg from 'pg';
4
+ import { createUser } from '../web/lib/auth.js';
5
+
6
+ const { Pool } = pg;
7
+
8
+ // Get database configuration from environment
9
+ const dbUrl = process.env.DEV_WORKFLOW_DB_URL;
10
+
11
+ if (!dbUrl) {
12
+ console.error('Error: DEV_WORKFLOW_DB_URL environment variable is not set');
13
+ process.exit(1);
14
+ }
15
+
16
+ const pool = new Pool({ connectionString: dbUrl });
17
+
18
+ async function addUser() {
19
+ const username = process.argv[2];
20
+ const password = process.argv[3];
21
+ const email = process.argv[4];
22
+
23
+ if (!username || !password) {
24
+ console.error('Usage: node scripts/add-user.js <username> <password> [email]');
25
+ process.exit(1);
26
+ }
27
+
28
+ try {
29
+ // Check if user already exists
30
+ const existing = await pool.query('SELECT id FROM users WHERE username = $1', [username]);
31
+
32
+ if (existing.rows.length > 0) {
33
+ console.log(`โœ— User '${username}' already exists`);
34
+ process.exit(1);
35
+ }
36
+
37
+ // Create user
38
+ const user = await createUser(pool, username, password, email);
39
+ console.log(`โœ“ Created user: ${user.username}`);
40
+ if (user.email) {
41
+ console.log(` Email: ${user.email}`);
42
+ }
43
+
44
+ } catch (error) {
45
+ console.error('Error creating user:', error.message);
46
+ process.exit(1);
47
+ } finally {
48
+ await pool.end();
49
+ }
50
+ }
51
+
52
+ addUser();