58ca4e68db
- Go backend API with full CRUD for all modules (CRM, Sales, Finance, HR, Legal, Marketing, Support, Purchase, Inventory, Projects, Automation, Analytics) - Rust analytics service with parallel report generation - C runtime with POSIX shared memory IPC - PostgreSQL schema with 30+ tables, full migrations - Redis cache, sessions, pub/sub - Kafka event streaming with Zookeeper - WebSocket hub for real-time updates - Automation engine with cron jobs, workflows, event triggers - JWT authentication, multi-tenant from start - Docker Compose with all services - Nginx reverse proxy with rate limiting - Integration tests passing - Feature gap analysis against Fortnox/Odoo/Visma Refs: BOC-001
VIMS - Visual Infrastructure Monitoring System
Overview
Production-ready AI-driven visual monitoring for critical infrastructure. Detects anomalies and changes in ATMs, charging stations, parking meters, and more.
Quick Start
# Clone and setup
git clone https://github.com/landvex/vims-backend.git
cd vims-backend
# Run setup script
./scripts/setup.sh
# Start services
docker-compose up -d
# Run tests
npm test
# Start development
npm run dev
Architecture
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ quiXzoom │────→│ VIMS API │────→│ PostgreSQL │
│ App │ │ (3450) │ │ (Database) │
└─────────────┘ └──────┬──────┘ └─────────────┘
│
┌──────▼──────┐
│ Redis │
│ (Queue) │
└──────┬──────┘
│
┌────────────┼────────────┐
▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌──────────┐
│ Object │ │ Change │ │ Risk │
│Detection│ │Detection │ │Classifier│
└─────────┘ └──────────┘ └──────────┘
Features
- Object Detection: YOLO-based component detection (card readers, PIN pads, etc.)
- Change Detection: Compare observations with baseline images
- Risk Classification: Green/Yellow/Orange/Red levels
- Real-time Alerts: Email, SMS, webhook, push notifications
- Dashboard: Map view, timeline, statistics
- API: RESTful API with JWT authentication
API Endpoints
Authentication
POST /api/v1/auth/register- Register new userPOST /api/v1/auth/login- LoginPOST /api/v1/auth/refresh- Refresh tokenGET /api/v1/auth/me- Get current user
Objects
GET /api/v1/objects- List monitored objectsPOST /api/v1/objects- Create new objectGET /api/v1/objects/:id- Get object detailsPOST /api/v1/objects/:id/baseline- Set baseline images
Observations
POST /api/v1/observations- Upload observation imagesGET /api/v1/observations/:id- Get observationPOST /api/v1/observations/:id/process- Reprocess observation
Detections
GET /api/v1/detections- List AI detectionsPOST /api/v1/detections/:id/verify- Verify detection
Alerts
GET /api/v1/alerts- List alertsPUT /api/v1/alerts/:id/status- Update alert statusPOST /api/v1/alerts/:id/escalate- Escalate alert
Dashboard
GET /api/v1/dashboard/overview- Dashboard statisticsGET /api/v1/dashboard/objects- Objects for map viewGET /api/v1/dashboard/timeline- Activity timeline
AI Training
Data Collection
# Generate synthetic training data
node src/training/data-collection.js atm 1000
# Validate dataset
node src/training/data-collection.js atm --validate
Model Training
# Install Python dependencies
pip install ultralytics
# Train YOLO model
python src/training/train-yolo.py atm --epochs 100
# Validate model
python src/training/train-yolo.py atm --validate
Deployment
Docker Compose (Development)
docker-compose up -d
Kubernetes (Production)
# Apply configurations
kubectl apply -f k8s/
# Check status
kubectl get pods -n vims
AWS
# Setup AWS infrastructure
./scripts/setup-aws.sh
# Deploy
./scripts/deploy-aws.sh
Configuration
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
NODE_ENV |
Yes | development | Environment mode |
PORT |
No | 3450 | API port |
DB_HOST |
Yes | - | PostgreSQL host |
DB_PASSWORD |
Yes | - | Database password |
REDIS_HOST |
Yes | - | Redis host |
JWT_SECRET |
Yes | - | Secret for JWT tokens |
S3_BUCKET |
Yes | - | S3 bucket for images |
AWS_ACCESS_KEY_ID |
Yes | - | AWS access key |
AWS_SECRET_ACCESS_KEY |
Yes | - | AWS secret key |
See .env.example for all options.
Testing
# Run all tests
npm test
# Run with coverage
npm run test:coverage
# Run specific test
npm test -- objectDetection.test.js
Monitoring
Health Checks
GET /health- Basic healthGET /health/ready- Readiness probeGET /health/live- Liveness probe
Metrics
- Prometheus metrics at
/metrics - Grafana dashboards
- CloudWatch integration
Documentation
Support
- Email: support@landvex.com
- Documentation: https://docs.landvex.com/vims
- Issues: https://github.com/landvex/vims/issues
License
Proprietary - Landvex AB