# Atlas CMMS - Enterprise Facilities Management System A complete enterprise-grade CMMS (Computerized Maintenance Management System) built with Vue.js 3 frontend and Atlas CMMS backend, orchestrated with Docker Compose and Nginx Proxy Manager. ## πŸ—οΈ Architecture Overview ``` β”Œβ”€β”€β”€ Nginx Proxy Manager (SSL/Reverse Proxy) ───┐ β”‚ β”œβ”€β”€ Frontend (Vue.js 3 + Vuetify) β”‚ β”‚ β”œβ”€β”€ Backend API (Atlas CMMS Spring Boot) β”‚ β”‚ β”œβ”€β”€ MinIO Console (Object Storage) β”‚ β”‚ └── Admin Interface β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β” β”‚PostgreSQLβ”‚ β”‚ MinIO β”‚ β”‚Database β”‚ β”‚ Storage β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## πŸš€ Quick Start ### Prerequisites - Docker and Docker Compose - Domain name (for SSL certificates) - Ports 80, 443, and 81 available ### 1. Clone and Setup ```bash git clone cd atlas-cmms cp .env.example .env ``` ### 2. Configure Environment Edit `.env` file with your settings: ```env # Domain configuration PUBLIC_API_URL=https://api.your-domain.com PUBLIC_FRONT_URL=https://your-domain.com # Database credentials DB_USER=rootUser DB_PASSWORD=your-secure-password # JWT secret (minimum 32 characters) JWT_SECRET_KEY=your-very-secure-jwt-secret-key-here ``` ### 3. Start Services ```bash # Production deployment docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d # Development setup docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d ``` ### 4. Configure Nginx Proxy Manager 1. Access admin interface: `http://your-server-ip:81` 2. Login with default credentials: - Email: `admin@example.com` - Password: `changeme` 3. **Change credentials immediately!** 4. Configure proxy hosts (see [Nginx Proxy Manager Setup](./nginx-proxy-manager-setup.md)) ## πŸ“ Project Structure ``` atlas-cmms/ β”œβ”€β”€ frontend/ # Vue.js 3 frontend application β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ components/ # Reusable Vue components β”‚ β”‚ β”œβ”€β”€ views/ # Page components β”‚ β”‚ β”œβ”€β”€ stores/ # Pinia state management β”‚ β”‚ β”œβ”€β”€ services/ # API services and repositories β”‚ β”‚ β”œβ”€β”€ composables/ # Vue composables β”‚ β”‚ └── utils/ # Utility functions β”‚ β”œβ”€β”€ Dockerfile # Production frontend container β”‚ β”œβ”€β”€ Dockerfile.dev # Development frontend container β”‚ └── nginx.conf # Nginx configuration β”œβ”€β”€ backend/ # Backend configuration and assets β”‚ β”œβ”€β”€ logos/ # Custom branding assets β”‚ β”œβ”€β”€ scripts/ # Database backup/restore scripts β”‚ └── README.md # Backend documentation β”œβ”€β”€ monitoring/ # Monitoring and logging configuration β”‚ β”œβ”€β”€ prometheus.yml # Metrics collection config β”‚ └── loki-config.yml # Log aggregation config β”œβ”€β”€ docker-compose.yml # Base Docker Compose configuration β”œβ”€β”€ docker-compose.dev.yml # Development overrides β”œβ”€β”€ docker-compose.prod.yml # Production overrides β”œβ”€β”€ .env.example # Environment variables template └── nginx-proxy-manager-setup.md # Proxy setup guide ``` ## πŸ› οΈ Services ### Core Services - **Nginx Proxy Manager**: SSL termination and reverse proxy - **Frontend**: Vue.js 3 application with Vuetify UI - **Backend API**: Atlas CMMS Spring Boot application - **PostgreSQL**: Primary database - **MinIO**: Object storage for files and documents ### Development Services - **Adminer**: Database administration interface - **MailHog**: Email testing server ### Production Services - **Watchtower**: Automatic container updates - **Prometheus**: Metrics collection - **Loki**: Log aggregation ## πŸ”§ Configuration ### Environment Variables | Variable | Description | Default | |----------|-------------|---------| | `PUBLIC_API_URL` | External API URL | `http://localhost:8080` | | `PUBLIC_FRONT_URL` | Frontend URL | `http://localhost:3000` | | `DB_USER` | Database username | `rootUser` | | `DB_PASSWORD` | Database password | `mypassword` | | `JWT_SECRET_KEY` | JWT signing key | Required (32+ chars) | | `MINIO_ROOT_USER` | MinIO admin username | `minioadmin` | | `MINIO_ROOT_PASSWORD` | MinIO admin password | `minioadmin123` | ### SSL Certificates Nginx Proxy Manager provides automatic Let's Encrypt certificates: 1. Configure proxy host in NPM admin interface 2. Request SSL certificate for your domain 3. Enable "Force SSL" and "HTTP/2 Support" ## πŸ“Š Features ### Frontend (Vue.js 3) - **Modern UI**: Vuetify 3 Material Design components - **State Management**: Pinia stores with TypeScript support - **Authentication**: JWT-based with role-based access control - **Repository Pattern**: Clean API abstraction layer - **Responsive Design**: Mobile-first approach - **Enterprise Architecture**: Separation of concerns, modular design ### Backend (Atlas CMMS) - **Work Order Management**: Complete lifecycle management - **Asset Management**: Asset tracking with history and files - **User Management**: Role-based permissions - **Inventory Control**: Stock management and tracking - **Maintenance Scheduling**: Preventive maintenance planning - **Reporting**: Comprehensive analytics and reports - **API Integration**: RESTful API with OpenAPI documentation ## πŸš€ Deployment ### Development ```bash # Start development environment docker-compose -f docker-compose.yml -f docker-compose.dev.yml up # Access services: # - Frontend: http://localhost:3000 # - API: http://localhost:8080 # - Database: localhost:5432 # - Adminer: http://localhost:8081 # - MailHog: http://localhost:8025 ``` ### Production ```bash # Start production environment docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d # Access services through Nginx Proxy Manager: # - Admin Interface: http://your-server:81 # - Frontend: https://your-domain.com # - API: https://api.your-domain.com ``` ## πŸ” Monitoring ### Health Checks - API health endpoint: `/api/health` - Frontend health endpoint: `/health` - Automatic container health monitoring ### Metrics (Production) - **Prometheus**: Metrics collection at `http://localhost:9090` - **Application Metrics**: API performance, database connections - **System Metrics**: CPU, memory, disk usage - **Custom Dashboards**: Grafana integration ready ### Logging - **Centralized Logging**: Loki log aggregation - **Application Logs**: API and frontend logs - **Access Logs**: Nginx request logs - **Error Tracking**: Structured error logging ## πŸ”’ Security ### Best Practices Implemented - **SSL/TLS**: Automatic certificate management - **JWT Authentication**: Secure token-based auth - **Role-Based Access**: Fine-grained permissions - **Security Headers**: CORS, XSS, and CSRF protection - **Container Security**: Non-root users, minimal images - **Network Isolation**: Docker network segmentation ### Security Checklist - [ ] Change all default passwords - [ ] Configure strong JWT secret key - [ ] Enable SSL certificates - [ ] Configure firewall rules - [ ] Set up regular backups - [ ] Enable monitoring and alerting - [ ] Review user permissions regularly ## πŸ“¦ Backup and Restore ### Database Backup ```bash # Create backup ./backend/scripts/backup-db.sh # Restore backup ./backend/scripts/restore-db.sh ./backups/atlas_backup_YYYYMMDD_HHMMSS.sql.gz ``` ### Configuration Backup ```bash # Backup Nginx Proxy Manager config docker exec nginx-proxy-manager tar -czf /tmp/npm-backup.tar.gz /data docker cp nginx-proxy-manager:/tmp/npm-backup.tar.gz ./backups/ ``` ## πŸ› οΈ Development ### Frontend Development ```bash cd frontend npm install npm run dev ``` ### API Development The backend uses the official Atlas CMMS Docker image. For custom development: 1. Fork the Atlas CMMS repository 2. Build custom Docker image 3. Update docker-compose.yml image reference ### Contributing 1. Follow established code patterns 2. Use TypeScript for new frontend code 3. Test all changes in development environment 4. Update documentation as needed ## πŸ“š Documentation - [Frontend Documentation](./frontend/README.md) - [Backend Documentation](./backend/README.md) - [Nginx Proxy Manager Setup](./nginx-proxy-manager-setup.md) - [Atlas CMMS User Guide](https://grashjs.github.io/user-guide/) ## πŸ†˜ Support ### Troubleshooting 1. Check container logs: `docker logs ` 2. Verify network connectivity: `docker network ls` 3. Review environment variables: `docker-compose config` 4. Check service health: `docker-compose ps` ### Getting Help - **Atlas CMMS Issues**: https://github.com/Grashjs/cmms/issues - **Atlas CMMS Email**: contact@atlas-cmms.com - **Documentation**: https://grashjs.github.io/user-guide/ ## πŸ“„ License This project is licensed under the MIT License. See the LICENSE file for details. --- **Atlas CMMS** - Enterprise Facilities Management Made Simple