Skip to content

Self-improving AI Employees for everyone

update npm scripts.

trohitg440c76f6f12c
diff --git a/.env.template b/.env.template
index 1c1347dd..150b6b66 100644
--- a/.env.template
+++ b/.env.template
@@ -1,4 +1,68 @@
-# Port Configuration
+# Service Ports (used by start.js and vite)
VITE_CLIENT_PORT=3000
PYTHON_BACKEND_PORT=3010
WHATSAPP_RPC_PORT=9400
+
+# Server Configuration
+HOST=127.0.0.1
+PORT=3010
+DEBUG=true
+WORKERS=1
+
+# Security (Development keys - MUST CHANGE FOR PRODUCTION)
+SECRET_KEY=dev-secret-key-12345678901234567890123456789012
+API_KEY_ENCRYPTION_KEY=dev-encryption-key-12345678901234567890123456
+
+# Authentication
+# AUTH_MODE: "single" (local deploy - first user is owner) or "multi" (cloud - open registration)
+AUTH_MODE=single
+JWT_SECRET_KEY=dev-jwt-secret-key-12345678901234567890
+JWT_EXPIRE_MINUTES=10080
+JWT_COOKIE_NAME=machina_token
+JWT_COOKIE_SECURE=false
+JWT_COOKIE_SAMESITE=lax
+
+# CORS Configuration - Allow all common dev ports
+CORS_ORIGINS=["http://localhost:3000","http://localhost:3001","http://localhost:3002","http://localhost:3003","http://localhost:3004","http://localhost:3005","http://localhost:3006","http://127.0.0.1:3000","http://127.0.0.1:3001","http://127.0.0.1:3002","http://127.0.0.1:3003","http://127.0.0.1:3004","http://127.0.0.1:3005","http://127.0.0.1:3006","http://localhost:5173"]
+
+# Database Configuration
+DATABASE_URL=sqlite+aiosqlite:///./data/workflow.db
+DATABASE_ECHO=false
+DATABASE_POOL_SIZE=5
+DATABASE_MAX_OVERFLOW=10
+
+# Cache Configuration (Disabled for development)
+REDIS_ENABLED=false
+CACHE_TTL=300
+
+# Logging
+LOG_LEVEL=DEBUG
+LOG_FORMAT=text
+
+# Rate Limiting (Relaxed for development)
+RATE_LIMIT_ENABLED=false
+RATE_LIMIT_REQUESTS=1000
+RATE_LIMIT_WINDOW=60
+
+# Service Timeouts (Extended for debugging)
+AI_TIMEOUT=60
+AI_MAX_RETRIES=1
+AI_RETRY_DELAY=0.5
+
+MAPS_TIMEOUT=30
+
+# Health Check
+HEALTH_CHECK_INTERVAL=60
+
+# WebSocket Configuration (For remote Android device connections)
+WEBSOCKET_URL=
+WEBSOCKET_API_KEY=
+
+# WhatsApp Service URL
+WHATSAPP_SERVICE_URL=http://localhost:5000
+
+# External API Keys (managed through UI, these are optional defaults)
+OPENAI_API_KEY=
+GOOGLE_MAPS_API_KEY=
+ANTHROPIC_API_KEY=
+GOOGLE_AI_API_KEY=
diff --git a/README.md b/README.md
index 32788164..e864185e 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ Visual workflow automation platform. Build workflows by connecting nodes - like
## Quick Start
-**Prerequisites:** Node.js 18+, Python 3.10+
+**Prerequisites:** Node.js 18+, Python 3.10+, Go 1.21+
```bash
git clone https://github.com/user/MachinaOs.git
diff --git a/package.json b/package.json
index 43ba8671..743cb8c8 100644
--- a/package.json
+++ b/package.json
@@ -15,7 +15,7 @@
"whatsapp:status": "cd server/whatsapp-rpc && npm run status",
"whatsapp:api": "cd server/whatsapp-rpc && npm run api",
"whatsapp:build": "cd server/whatsapp-rpc && npm run build",
- "build": "node -e \"const fs=require('fs'),p='server/.env';if(!fs.existsSync(p))fs.copyFileSync('server/.env.template',p)\" && npm install && cd client && npm install && npm run build && cd ../server && python -m pip install -r requirements.txt && cd whatsapp-rpc && npm install",
+ "build": "node -e \"const fs=require('fs'),p='.env';if(!fs.existsSync(p))fs.copyFileSync('.env.template',p)\" && npm install && cd client && npm install && npm run build && cd ../server && python -m pip install -r requirements.txt && cd whatsapp-rpc && npm install",
"clean": "node scripts/clean.js",
"start": "node scripts/start.js",
"stop": "node scripts/stop.js",
diff --git a/scripts/clean.js b/scripts/clean.js
index 30f62384..18e89b5d 100644
--- a/scripts/clean.js
+++ b/scripts/clean.js
@@ -14,7 +14,7 @@ const dirsToRemove = [
];
const filesToRemove = [
- 'server/.env'
+ '.env'
];
const filePatternsToRemove = [
diff --git a/scripts/start.js b/scripts/start.js
index 708f6a04..b02cf00f 100644
--- a/scripts/start.js
+++ b/scripts/start.js
@@ -65,11 +65,11 @@ process.env.PYTHONUTF8 = '1';
console.log('\n=== MachinaOS Starting ===\n');
// Step 1: Create .env if not exists
-const envPath = resolve(ROOT, 'server', '.env');
-const templatePath = resolve(ROOT, 'server', '.env.template');
+const envPath = resolve(ROOT, '.env');
+const templatePath = resolve(ROOT, '.env.template');
if (!existsSync(envPath) && existsSync(templatePath)) {
copyFileSync(templatePath, envPath);
- log('Created server/.env from template');
+ log('Created .env from template');
}
// Step 2: Free ports
diff --git a/server/.env.template b/server/.env.template
index cdd776d2..54d4d387 100644
--- a/server/.env.template
+++ b/server/.env.template
@@ -4,6 +4,11 @@ PORT=3010
DEBUG=true
WORKERS=1
+# Service Ports (used by start.js and vite)
+VITE_CLIENT_PORT=3000
+PYTHON_BACKEND_PORT=3010
+WHATSAPP_RPC_PORT=9400
+
# Security (Development keys - MUST CHANGE FOR PRODUCTION)
SECRET_KEY=dev-secret-key-12345678901234567890123456789012
API_KEY_ENCRYPTION_KEY=dev-encryption-key-12345678901234567890123456
diff --git a/server/core/config.py b/server/core/config.py
index 00b6b2a8..254cf1fb 100644
--- a/server/core/config.py
+++ b/server/core/config.py
@@ -101,7 +101,7 @@ class Settings(BaseSettings):
return not self.debug
model_config = {
- "env_file": ".env",
+ "env_file": "../.env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
"extra": "forbid",