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/config/config.ts

rUv24ad62b9861d
diff --git a/.claude/checkpoints/1754488730.json b/.claude/checkpoints/1754488730.json
new file mode 100644
index 0000000000..04547a0c3a
--- /dev/null
+++ b/.claude/checkpoints/1754488730.json
@@ -0,0 +1 @@
+{"branch": "checkpoint/pre-edit-20250806-135850", "file": "/workspaces/claude-code-flow/user-service/src/types/user.types.ts", "timestamp": "2025-08-06T13:58:50Z", "type": "pre-edit", "original_branch": "alpha-88"}
diff --git a/.claude/checkpoints/1754488731.json b/.claude/checkpoints/1754488731.json
new file mode 100644
index 0000000000..1c1bc2c864
--- /dev/null
+++ b/.claude/checkpoints/1754488731.json
@@ -0,0 +1 @@
+{"tag": "checkpoint-20250806-135851", "file": "/workspaces/claude-code-flow/user-service/src/types/user.types.ts", "timestamp": "2025-08-06T13:58:51Z", "type": "post-edit", "branch": "alpha-88", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/task-metrics.json | 6 +- benchmark/.claude/checkpoints/task-1754488723.json | 1 + claude-flow-wiki | 0 user-service/src/types/user.types.ts | 87 ++++++++++++++++++++++ 5 files changed, 92 insertions(+), 4 deletions(-) "}
diff --git a/user-service/src/config/config.ts b/user-service/src/config/config.ts
new file mode 100644
index 0000000000..74d371ee6d
--- /dev/null
+++ b/user-service/src/config/config.ts
@@ -0,0 +1,66 @@
+import dotenv from 'dotenv';
+import path from 'path';
+
+// Load environment variables
+dotenv.config({ path: path.join(__dirname, '../../.env') });
+
+export const config = {
+ env: process.env.NODE_ENV || 'development',
+ port: parseInt(process.env.PORT || '3000', 10),
+ host: process.env.HOST || 'localhost',
+
+ jwt: {
+ secret: process.env.JWT_SECRET || 'default-secret-change-this',
+ expiresIn: process.env.JWT_EXPIRES_IN || '24h',
+ },
+
+ bcrypt: {
+ rounds: parseInt(process.env.BCRYPT_ROUNDS || '10', 10),
+ },
+
+ database: {
+ url: process.env.DATABASE_URL || '',
+ },
+
+ redis: {
+ url: process.env.REDIS_URL || '',
+ },
+
+ rateLimit: {
+ windowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS || '900000', 10),
+ maxRequests: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '100', 10),
+ },
+
+ logging: {
+ level: process.env.LOG_LEVEL || 'info',
+ file: process.env.LOG_FILE || 'logs/app.log',
+ },
+
+ cors: {
+ origin: process.env.CORS_ORIGIN || '*',
+ },
+
+ email: {
+ smtp: {
+ host: process.env.SMTP_HOST || '',
+ port: parseInt(process.env.SMTP_PORT || '587', 10),
+ user: process.env.SMTP_USER || '',
+ pass: process.env.SMTP_PASS || '',
+ },
+ from: process.env.EMAIL_FROM || '[email protected]',
+ },
+
+ isDevelopment: process.env.NODE_ENV === 'development',
+ isProduction: process.env.NODE_ENV === 'production',
+ isTest: process.env.NODE_ENV === 'test',
+};
+
+// Validate required configuration
+export function validateConfig(): void {
+ const required = ['JWT_SECRET'];
+ const missing = required.filter(key => !process.env[key]);
+
+ if (missing.length > 0 && config.isProduction) {
+ throw new Error(`Missing required environment variables: ${missing.join(', ')}`);
+ }
+}
\ No newline at end of file