Commit Graph

138 Commits

Author SHA1 Message Date
c926f15aab Fix circular dependency breaking ncc bundle
Don't export authRoutes from barrel file to break the cycle:
services.ts → auth/index.ts → auth/routes.ts → services.ts

Import authRoutes directly from ./auth/routes instead.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 14:24:53 -06:00
39cd93c81e Move services.ts 2026-01-03 14:12:27 -06:00
c246e0384f Add authentication system with session-based auth
Implements full auth flows with opaque tokens (not JWT) for easy revocation:
- Login/logout with cookie or bearer token support
- Registration with email verification
- Password reset with one-time tokens
- scrypt password hashing (no external deps)

New files in express/auth/:
- token.ts: 256-bit token generation, SHA-256 hashing
- password.ts: scrypt hashing with timing-safe verification
- types.ts: Session schemas, token types, input validation
- store.ts: AuthStore interface + InMemoryAuthStore
- service.ts: AuthService with all auth operations
- routes.ts: 6 auth endpoints

Modified:
- types.ts: Added user field to Call, requireAuth/requirePermission helpers
- app.ts: JSON body parsing, populates call.user, handles auth errors
- services.ts: Added services.auth
- routes.ts: Includes auth routes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 13:59:02 -06:00
788ea2ab19 Add User class with role and permission-based authorization
Foundation for authentication/authorization with:
- Stable UUID id for database keys, email as human identifier
- Account status (active/suspended/pending)
- Role-based auth with role-to-permission mappings
- Direct permissions in resource:action format
- Methods: hasRole(), hasPermission(), can(), effectivePermissions()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 12:59:47 -06:00
6297a95d3c Reformat more files 2026-01-01 21:20:45 -06:00
63cf0a670d Update todo list 2026-01-01 21:20:38 -06:00
5524eaf18f ? 2026-01-01 21:12:55 -06:00
03980e114b Add basic template rendering route 2026-01-01 21:12:38 -06:00
539717efda Add todo item 2026-01-01 21:11:28 -06:00
8be88bb696 Move TODOs re logging to the end 2026-01-01 21:11:10 -06:00
ab74695f4c Have master start and manage the logger process
Master now:
- Starts logger on startup with configurable port and capacity
- Restarts logger automatically if it crashes
- Stops logger gracefully on shutdown

New flags:
- --logger-port (default 8085)
- --logger-capacity (default 1000000)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 20:53:29 -06:00
dc5a70ba33 Add logging service
New Go program (logger/) that:
- Accepts POSTed JSON log messages via POST /log
- Stores last N messages in a ring buffer (default 1M)
- Retrieves logs via GET /logs with limit/before/after filters
- Shows status via GET /status

Also updates express/logging.ts to POST messages to the logger service.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 20:45:34 -06:00
4adf6cf358 Add another TODO item 2026-01-01 20:37:16 -06:00
bee6938a67 Add some logging related stubs to express backend 2026-01-01 20:18:37 -06:00
b0ee53f7d5 Listen by default on port 3500
The master process will continue to start at port 3000.  In practice, this
ought to make conflicts between master-superviced processes and ones run by
hand less of an issue.
2026-01-01 20:17:26 -06:00
5c93c9e982 Add TODO items 2026-01-01 20:17:15 -06:00
5606a59614 Note that you need docker as well as docker compose 2026-01-01 17:36:22 -06:00
22dde8c213 Add wrapper script for master program 2026-01-01 17:35:56 -06:00
30463b60a5 Use CLI flags instead of environment variables for master config
Replace env var parsing with Go's flag package:
- --watch (default: ../express)
- --workers (default: 1)
- --base-port (default: 3000)
- --port (default: 8080)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 17:31:08 -06:00
e2ea472a10 Make biome happier 2026-01-01 17:22:04 -06:00
20e5da0d54 Teach fixup.sh to use biome 2026-01-01 17:16:46 -06:00
13d02d86be Pull in and set up biome 2026-01-01 17:16:02 -06:00
d35e7bace2 Make shfmt happier 2026-01-01 16:53:19 -06:00
cb4a730838 Make go fmt happier 2026-01-01 16:53:00 -06:00
58f88e3695 Add check.sh and fixup.sh scripts 2026-01-01 16:47:50 -06:00
7b8eaac637 Add TODO.md and instructions 2026-01-01 15:45:43 -06:00
f504576f3e Add first cut at a pool 2026-01-01 15:43:49 -06:00
8722062f4a Change process names again 2026-01-01 15:12:01 -06:00
9cc1991d07 Name backend process 2026-01-01 14:54:17 -06:00
5d5a2430ad Fix arg in build script 2026-01-01 14:37:11 -06:00
a840137f83 Mark build.sh as executable 2026-01-01 14:34:31 -06:00
c330da49fc Add rudimentary command line parsing to express app 2026-01-01 14:34:16 -06:00
db81129724 Add build.sh 2026-01-01 14:17:09 -06:00
43ff2edad2 Pull in nunjucks 2026-01-01 14:14:03 -06:00
Michael Wolf
ad95f652b8 Fix bogus path expansion 2026-01-01 14:10:57 -06:00
Michael Wolf
51d24209b0 Use build.sh script 2026-01-01 14:09:51 -06:00
Michael Wolf
1083655a3b Add and use a simpler run script 2026-01-01 14:08:46 -06:00
Michael Wolf
615cd89656 Ignore more node_modules directories 2026-01-01 13:24:50 -06:00
Michael Wolf
321b2abd23 Sort of run node app 2026-01-01 13:24:36 -06:00
Michael Wolf
642c7d9434 Update CLAUDE.md 2026-01-01 13:06:21 -06:00
Michael Wolf
8e5b46d426 Add first cut at a CLAUDE.md file 2026-01-01 12:31:35 -06:00
Michael Wolf
a178536472 Rename monitor to master 2026-01-01 12:30:58 -06:00
Michael Wolf
3bece46638 Add first cut at golang monitor program 2026-01-01 12:26:54 -06:00
Michael Wolf
4257a9b615 Improve wording in a few places 2025-12-05 19:47:58 -06:00
Michael Wolf
b0eaf6b136 Add stub nomenclature doc 2025-11-17 19:54:53 -06:00
Michael Wolf
8ca89b75cd Rewrite README.md 2025-11-17 19:54:35 -06:00
Michael Wolf
a797cae0e6 Add placeholder files for docs to come 2025-11-17 19:54:10 -06:00
Michael Wolf
666f1447f4 Add first cut at docs to create a new project 2025-11-17 19:53:57 -06:00
Michael Wolf
bd3779acef Fill out http codes object 2025-11-17 18:06:59 -06:00
Michael Wolf
c21638c5d5 Fill out content types object 2025-11-17 18:06:42 -06:00