Skip to content

HamzaMansouri7/SentrixFm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2,751 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SentrixFM Platform

Multi-Tenant CAFM Platform with 8 microservices, AI-powered assistance, and unified deployment infrastructure.

Package manager: pnpm only. Do not run npm install; keep using pnpm install in each service (no package-lock.json).

πŸ“– Full Architecture: See PLATFORM_ARCHITECTURE.md for detailed system design, routing, and deployment workflows.

πŸ—οΈ Microservices Structure

SentrixFm/ (Monorepo)
β”œβ”€β”€ sentrix-promo/              # Next.js Promo Website (Port 3010) πŸšͺ FIRST GATE
β”œβ”€β”€ sentrix-api/                # NestJS Backend API (Port 3000)
β”œβ”€β”€ sentrix-manager/            # Angular Web App (Port 4200)
β”œβ”€β”€ sentrix-admin/              # Angular Admin Panel (Port 4000)
β”œβ”€β”€ sentrix-mobile/             # React Native + Expo (iOS/Android)
β”œβ”€β”€ sentrix-ai/                 # Python FastAPI AI Service (Port 8000)
β”œβ”€β”€ sentrix-api-documentation/  # Docusaurus API Docs (Port 3002)
β”œβ”€β”€ sentrix-deployment/         # πŸš€ Deployment Scripts & Configs
β”œβ”€β”€ docs/                       # Comprehensive documentation
β”œβ”€β”€ scripts/                     # Automation scripts
└── ecosystem.config.js          # PM2 process management (Legacy/Alternative)

🌐 Production Routing (sentrixfm.com)

Path Service Type Description
/ sentrix-promo Dynamic Landing page (FIRST GATE)
/api/* sentrix-api Dynamic Backend REST API (includes AI)
/manager/* sentrix-manager Static Web application
/admin/* sentrix-admin Static Admin panel
/docs/* sentrix-api-docs Static API documentation

πŸš€ Recent Achievements (January 2026)

  • Jan 23, 2026: Enterprise Pivot & Feature Refactor - Migrated to a 19-flag strategic architecture. Simplified subscription model to Dual Enterprise Tiers (Enterprise Business & Enterprise Global). Added Analytics Dashboard and Enterprise IT Elite features (SSO, White-label, Governance).
  • Jan 13, 2026: Production Readiness & API Standardization - Complete migration to container-based databases and RESTful API naming conventions. Asset Lifecycle UX enhancement.
  • Jan 12, 2026: Multi-Asset Support & SOP Integration - Universal Working Items now support multiple assets per task with full SOP template integration.

πŸš€ Quick Start

Hybrid Deployment Approach

We use a hybrid deployment strategy for maximum reliability:

  • 🐳 Databases in Containers: PostgreSQL, Redis, MinIO run in Podman containers
  • πŸš€ Apps with PM2: Node.js applications run with PM2 process manager
  • πŸ”„ Simple Networking: No complex DNS, all connections via localhost
  • πŸ€– Zero Configuration: Automatic service discovery and health checks

Prerequisites

  • Development: Podman Desktop 4.0+ (or Docker Desktop), pnpm 8+, PM2
  • Production: Ubuntu VPS with Podman 4.0+, PM2, Nginx

Development (Local)

Hybrid Deployment (Recommended)

# Start everything with one command
cd /root/SentrixFm
./simple-hybrid-setup.sh

# Or start manually:
# 1. Start databases in containers
podman run -d --rm --name sentrix-postgres -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres docker.io/library/postgres:15-alpine
podman run -d --rm --name sentrix-redis -p 6379:6379 docker.io/library/redis:7-alpine
podman run -d --rm --name sentrix-minio -p 9000:9000 -p 9001:9001 -e MINIO_ROOT_USER=minioadmin -e MINIO_ROOT_PASSWORD=minioadmin docker.io/minio/minio:latest server /data --console-address ":9001"

# 2. Start apps with PM2
pm2 start pm2-hybrid.config.js

Individual Services (Alternative)

# 1. sentrix-api (Backend with AI Integration)
cd sentrix-api && pnpm run start:dev

# 2. sentrix-promo (Next.js Website)
cd sentrix-promo && pnpm run dev

# 3. sentrix-manager (Frontend)
cd sentrix-manager && pnpm start

# 4. sentrix-admin (Admin)
cd sentrix-admin && pnpm start

# 5. sentrix-ai (AI Service - Optional, for advanced AI features)
cd sentrix-ai && python main.py

Production (VPS)

# SSH into VPS
ssh root@your-vps-ip

# Deploy all services with hybrid setup
cd /root/SentrixFm
./simple-hybrid-setup.sh

# Verify everything is running
pm2 status
podman ps
curl -I https://sentrixfm.com

πŸ“˜ Deployment: See sentrix-deployment/README.md for complete deployment instructions.

🎯 Why Hybrid Deployment?

βœ… Benefits of PM2 + Containers Approach:

  • πŸš€ Faster Startup: Apps start instantly with PM2, no container overhead
  • πŸ”§ Simpler Debugging: Direct access to Node.js processes and logs
  • 🌐 No DNS Issues: All connections via localhost, no service discovery complexity
  • ⚑ Better Performance: No container networking overhead
  • πŸ›‘οΈ More Reliable: PM2 auto-restarts crashed applications
  • πŸ“Š Better Monitoring: PM2 provides real-time process monitoring

πŸ“‹ When to Use Which Approach:

Scenario Recommended Approach
Production VPS Hybrid (PM2 + Containers)
Development Hybrid or Individual Services
Testing Individual Services
CI/CD Container-First (for isolation)

πŸ“š Documentation

Core Documentation

Document Description
PLATFORM_ARCHITECTURE.md Complete system architecture, service interactions, and data flow
QUICK_REFERENCE.md Quick reference for common commands and configurations
sentrix-deployment/README.md Deployment guides for VPS and production

API & Development

Document Description
sentrix-api/docs/README.md API documentation structure
sentrix-ai/docs/README.md AI service documentation

Service-Specific

Document Description
sentrix-admin/README.md Admin panel setup and usage
sentrix-manager/README.md Manager web app documentation
docs/README.md Comprehensive platform documentation

πŸ§ͺ Testing

Automated Tests

  • E2E Tests: Playwright-based critical path testing
  • Unit Tests: Jest/Angular testing for individual components
  • API Tests: Postman/Newman collection for REST endpoints

Running Tests

# E2E Tests
cd sentrix-manager
npx playwright test --project=chromium --workers=1

# Unit Tests
cd sentrix-api
pnpm run test

πŸ“¦ Package Management

⚠️ IMPORTANT: Use pnpm exclusively. Never run npm install in any service directory.

# Install dependencies
pnpm install

# Add a new package
pnpm add <package-name>

# Remove a package
pnpm remove <package-name>

# Clean install
pnpm install --no-frozen-lockfile

πŸ”§ Configuration

Environment Variables

  • sentrix-api/.env: Backend API configuration
  • sentrix-ai/.env: AI service configuration
  • sentrix-manager/.env.development: Frontend dev config

Database Configuration

  • PostgreSQL: Port 5432 (Podman container)
  • Redis: Port 6379 (Podman container)
  • MinIO: Ports 9000/9001 (Podman container)

πŸ“Š Monitoring & Logs

PM2 Commands

# View all processes
pm2 status

# View logs
pm2 logs

# Restart all
pm2 restart all

# Restart specific app
pm2 restart sentrix-api

# Monitor resources
pm2 monit

Health Checks

# API Health
curl http://localhost:3000/api/health

# AI Service Health
curl http://localhost:8000/health

# Database Connection
psql -h localhost -U postgres -d SentrixFmDb -c "SELECT 1"

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is proprietary software. All rights reserved.


Built with ❀️ for Facility Management Excellence

About

SentrixFM

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors