Governed substrate for autonomous agents: scoped identity (passports), audited actions, MCP workspace. Infra IPs and secrets redacted for public release.
5.2 KiB
5.2 KiB
🚀 Quick Start Guide - Business CRM
📋 Credentials
Admin user:
Email: gera69lvl@gmail.com
Password: admin123
Role: admin
Existing businesses:
- SIXTYNINE (ID: 1)
- HOLETRON (ID: 2)
🏃 Quick start
1. Start the server
cd /root/business-crm
node backend/server.js
2. Open in browser
http://localhost:5000
3. Log in
- Email:
gera69lvl@gmail.com - Password:
admin123
🔧 Useful commands
Server
# Start
cd /root/business-crm && node backend/server.js
# In the background
cd /root/business-crm && node backend/server.js &
# Stop
pkill -f "node server.js"
# Check status
curl http://localhost:5000/api/health
Database
# Location
/var/lib/business-crm-data/crm.db
# View
sqlite3 /var/lib/business-crm-data/crm.db
# Backup
cp /var/lib/business-crm-data/crm.db \
/var/lib/business-crm-data/crm.db.backup-$(date +%Y%m%d)
Password reset
cd /root/business-crm/backend
node reset-password.js <email> <new-password>
# Example
node reset-password.js gera69lvl@gmail.com newpass123
📡 API Endpoints
Authentication
# Login
POST /api/auth/login
Body: {"email": "...", "password": "..."}
# Get current user
GET /api/auth/me
Header: Authorization: Bearer <token>
Businesses
# List businesses
GET /api/businesses
Header: Authorization: Bearer <token>
# Create business
POST /api/businesses
Body: {"name": "...", "description": "..."}
# Update business
PUT /api/businesses/:id
# Delete business
DELETE /api/businesses/:id
Database Integrations (NEW!)
# Detect database type
POST /api/integrations/detect-database-type
Body: {"path": "localhost:3306"}
# Test connection
POST /api/integrations/test-direct-connection
Body: {
"type": "mysql2",
"host": "localhost",
"port": 3306,
"database": "neometal",
"user": "root",
"password": ""
}
# Discover schema
POST /api/integrations/discover-schema-direct
Body: {...same as test-connection...}
# List all integrations
GET /api/integrations/list
Header: Authorization: Bearer <token>
🗂️ Project structure
/root/business-crm/
├── backend/
│ ├── server.js # Entry point
│ ├── database/
│ │ └── init.js # DB initialization
│ ├── routes/
│ │ ├── auth.js
│ │ ├── business.js
│ │ ├── integrations.js # NEW!
│ │ └── ...
│ ├── services/
│ │ ├── DatabaseTypeDetector.js # NEW!
│ │ └── DirectDatabaseConnector.js # NEW!
│ └── middleware/
│ └── auth.js
├── src/ # Frontend
│ ├── components/
│ │ ├── Integrations/ # NEW!
│ │ │ ├── DirectConnectionForm.jsx
│ │ │ └── DirectConnectionForm.css
│ │ └── ...
│ └── ...
├── .env # Environment config
├── package.json
└── docs/
├── IMPLEMENTATION-COMPLETE.md
├── DATABASE-MIGRATION.md
└── BUGFIX-REACT-ERRORS.md
📊 Database
Location: /var/lib/business-crm-data/crm.db
Tables:
users- Usersbusinesses- Businessesemployees- Employeesemployee_businesses- Employee-to-business relationshipsservices- Services/passwordsmodules- CRM modulesmodule_permissions- Access permissionsaudit_log- Action auditemployee_invitations- Employee invitations
🔍 Debugging
Server logs
# Run with logs
cd /root/business-crm && node backend/server.js
# Logs to a file
cd /root/business-crm && node backend/server.js > server.log 2>&1 &
tail -f server.log
Port checks
# Which process is using port 5000
lsof -i:5000
# Kill the process on port 5000
lsof -ti:5000 | xargs kill -9
Database check
sqlite3 /var/lib/business-crm-data/crm.db "
SELECT 'Users:' as info, COUNT(*) as count FROM users
UNION ALL
SELECT 'Businesses:', COUNT(*) FROM businesses
UNION ALL
SELECT 'Employees:', COUNT(*) FROM employees
UNION ALL
SELECT 'Services:', COUNT(*) FROM services;
"
🎯 What works
✅ JWT authentication
✅ Business management
✅ Employee management
✅ Password Manager (with encryption)
✅ Modules and access permissions
✅ NEW: Direct Database Connection (MySQL/PostgreSQL/SQLite)
✅ NEW: Schema Discovery
✅ NEW: Database Type Auto-detection
📚 Documentation
- IMPLEMENTATION-COMPLETE.md - Full Direct Connection implementation
- DATABASE-MIGRATION.md - DB migration to /var/lib
- BUGFIX-REACT-ERRORS.md - React error fixes
- PROMPT-DIRECT-CONNECTION.md - Direct Connection architecture
- PROMPT-DEVELOPER.md - Developer guide
🚀 Done!
The system is fully configured and ready to use!
Next steps:
- Log in to the system
- Check the businesses
- Add an integration with an external DB (via /integrations)
- Set up data synchronization
Good luck! 🎉