Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

🔖 Checkpoint: Edit /workspaces/claude-code-flow/user-service/src/routes/user.routes.ts

rUv34d94c29e20e
diff --git a/.claude/checkpoints/1754488958.json b/.claude/checkpoints/1754488958.json
new file mode 100644
index 0000000000..967c4eae44
--- /dev/null
+++ b/.claude/checkpoints/1754488958.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250806-140238", "file": "/workspaces/claude-code-flow/user-service/src/middleware/error.middleware.ts", "timestamp": "2025-08-06T14:02:38Z", "type": "pre-edit", "original_branch": "alpha-88"}
diff --git a/.claude/checkpoints/1754488959.json b/.claude/checkpoints/1754488959.json
new file mode 100644
index 0000000000..602cb3ff0c
--- /dev/null
+++ b/.claude/checkpoints/1754488959.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250806-140239", "file": "/workspaces/claude-code-flow/user-service/src/middleware/error.middleware.ts", "timestamp": "2025-08-06T14:02:39Z", "type": "post-edit", "branch": "alpha-88", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 2532 +++++++++++++++++++++- .claude-flow/metrics/task-metrics.json | 6 +- .claude/checkpoints/1754488941.json | 1 + .claude/checkpoints/1754488943.json | 1 + benchmark/.claude-flow/metrics/performance.json | 2 +- benchmark/.claude-flow/metrics/task-metrics.json | 6 +- claude-flow-wiki | 0 user-service/src/middleware/error.middleware.ts | 67 + 9 files changed, 2555 insertions(+), 62 deletions(-) "}
diff --git a/user-service/src/routes/user.routes.ts b/user-service/src/routes/user.routes.ts
new file mode 100644
index 0000000000..63a6a5c8bf
--- /dev/null
+++ b/user-service/src/routes/user.routes.ts
@@ -0,0 +1,74 @@
+import { Router } from 'express';
+import { userController } from '../controllers/user.controller';
+import { authenticate, authorize, authorizeOwner } from '../middleware/auth.middleware';
+import { validateBody, validateParams, validateQuery } from '../middleware/validation.middleware';
+import { schemas } from '../utils/validation';
+import { UserRole } from '../types/user.types';
+
+const router = Router();
+
+// Public routes
+router.post('/register',
+ validateBody(schemas.createUser),
+ userController.register
+);
+
+router.post('/login',
+ validateBody(schemas.login),
+ userController.login
+);
+
+// Protected routes - require authentication
+router.get('/profile',
+ authenticate,
+ userController.getProfile
+);
+
+router.post('/change-password',
+ authenticate,
+ validateBody(schemas.changePassword),
+ userController.changePassword
+);
+
+router.post('/verify-email',
+ authenticate,
+ userController.verifyEmail
+);
+
+// User management routes
+router.get('/users',
+ authenticate,
+ authorize(UserRole.ADMIN, UserRole.MODERATOR),
+ validateQuery(schemas.pagination.concat(schemas.userFilter)),
+ userController.listUsers
+);
+
+router.get('/users/stats',
+ authenticate,
+ authorize(UserRole.ADMIN),
+ userController.getUserStats
+);
+
+router.get('/users/:id',
+ authenticate,
+ authorizeOwner('id'),
+ validateParams(schemas.userId),
+ userController.getUserById
+);
+
+router.put('/users/:id',
+ authenticate,
+ authorizeOwner('id'),
+ validateParams(schemas.userId),
+ validateBody(schemas.updateUser),
+ userController.updateUser
+);
+
+router.delete('/users/:id',
+ authenticate,
+ authorize(UserRole.ADMIN),
+ validateParams(schemas.userId),
+ userController.deleteUser
+);
+
+export default router;
\ No newline at end of file