A comprehensive, modern data center infrastructure management system with a React frontend, PHP backend API, and robust authentication system.
This project represents a complete modernization of the legacy openDCIM system, featuring:
- Modern React SPA with TypeScript and Mantine UI
- RESTful API v2 with JWT authentication and RBAC
- Unified SSO supporting SAML, OIDC, LDAP, and Apache auth
- Containerized deployment with Docker and Kubernetes
- Comprehensive testing with CI/CD pipelines
- Security hardening with modern best practices
- Features
- Architecture
- Quick Start
- Development
- API Documentation
- Deployment
- Testing
- Contributing
- License
- JWT-based authentication with access and refresh tokens
- Unified SSO integration (SAML, OIDC, LDAP, Apache)
- Role-based access control (RBAC) with granular permissions
- Security headers and CSP protection
- Password hardening with Argon2id hashing
- Session management with secure cookies
- React 18 with TypeScript
- Mantine UI for beautiful, accessible components
- React Query for efficient data fetching
- Real-time charts with Recharts
- Responsive design with mobile-first approach
- Form validation with Zod schemas
- PHP 8.1 with modern features
- Slim Framework for API routing
- PDO database abstraction with prepared statements
- Comprehensive middleware (CORS, Rate Limiting, Security)
- OpenAPI documentation with Swagger UI
- Database migrations with Doctrine
- Docker containerization with multi-stage builds
- Kubernetes deployment ready
- GitHub Actions CI/CD with automated testing
- Security scanning with Trivy
- Performance monitoring with Lighthouse CI
- Health checks and monitoring
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β React SPA β β PHP API v2 β β MySQL DB β
β (Frontend) βββββΊβ (Backend) βββββΊβ (Database) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
β βββββββββββββββββββ β
β β Redis Cache β β
β βββββββββββββββββββ β
β β
βββββββββββββββββββ β
β SSO Providers β β
β (SAML/OIDC) β β
βββββββββββββββββββ β
β
βββββββββββββββββββ βββββββββββββββββββ β
β Nginx Proxy β β Monitoring β β
β (Load Bal.) β β & Logging β β
βββββββββββββββββββ βββββββββββββββββββ β
| Component | Technology | Version |
|---|---|---|
| Frontend | React + TypeScript | 18.2.0 |
| UI Library | Mantine | 6.0.0 |
| State Management | React Query | 4.29.5 |
| Backend | PHP + Slim | 8.1+ |
| Database | MySQL | 8.0+ |
| Cache | Redis | 7.0+ |
| Container | Docker | 20.10+ |
| CI/CD | GitHub Actions | Latest |
| Testing | Vitest + PHPUnit | Latest |
- Docker & Docker Compose
- Node.js 18+ (for development)
- PHP 8.1+ (for development)
- MySQL 8.0+ (for development)
-
Clone the repository
git clone https://github.com/adampaulsen/adamsdcim.git cd adamsdcim -
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Start the application
docker-compose up -d
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
- API Documentation: http://localhost:8080/api/docs
- PHPMyAdmin: http://localhost:8081 (dev profile)
-
Backend Setup
# Install PHP dependencies composer install # Set up database php migrations/migrate.php # Start PHP server php -S localhost:8080 -t .
-
Frontend Setup
cd app npm install npm run dev
adamsdcim/
βββ app/ # React frontend application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ contexts/ # React contexts
β β βββ lib/ # Utility libraries
β β βββ pages/ # Page components
β β βββ types/ # TypeScript definitions
β βββ package.json
β βββ vite.config.ts
βββ api/ # API endpoints
β βββ v1/ # Legacy API (deprecated)
β βββ v2/ # Modern API
β βββ docs/ # API documentation
βββ classes/ # PHP classes
β βββ Api/ # API controllers and middleware
β βββ Database/ # Database abstraction
β βββ Security/ # Security utilities
βββ tests/ # Backend tests
βββ docker/ # Docker configuration
βββ .github/ # CI/CD workflows
βββ docs/ # Documentation
# Run tests
vendor/bin/phpunit
# Static analysis
vendor/bin/phpstan analyse
# Code style check
vendor/bin/php-cs-fixer fix --dry-run
# Database migrations
php migrations/migrate.phpcd app
# Development server
npm run dev
# Run tests
npm run test
# Build for production
npm run build
# Linting
npm run lint# Database
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=adamsdcim
DB_USERNAME=adamsdcim
DB_PASSWORD=your_password
# Security
ADAMSDCIM_SECRET_KEY=your-secret-key
ADAMSDCIM_APP_URL=http://localhost:8080
ADAMSDCIM_SPA_URL=http://localhost:3000
# Development
ADAMSDCIM_DEV_INSECURE_SESSION=false
ADAMSDCIM_CSP=default-src 'self'VITE_API_BASE_URL=http://localhost:8080/api/v2
VITE_APP_TITLE=adamsDCIMThe modern API v2 provides RESTful endpoints with JWT authentication:
POST /api/v2/auth/login- User loginPOST /api/v2/auth/refresh- Refresh JWT tokenPOST /api/v2/auth/logout- User logoutPOST /api/v2/auth/sso/callback- SSO callback
GET /api/v2/devices- List devicesPOST /api/v2/devices- Create deviceGET /api/v2/devices/{id}- Get devicePUT /api/v2/devices/{id}- Update deviceDELETE /api/v2/devices/{id}- Delete device
GET /api/v2/stats/overview- Overview statisticsGET /api/v2/stats/datacenters/{id}- Data center statistics
Access the interactive API documentation at:
- Swagger UI: http://localhost:8080/api/docs
- OpenAPI Spec: http://localhost:8080/api/docs/openapi.yaml
# Build and run with Docker Compose
docker-compose -f docker-compose.prod.yml up -d
# Or build individual images
docker build -f Dockerfile.backend -t opendcim/backend .
docker build -f app/Dockerfile -t opendcim/frontend ./app# Apply Kubernetes manifests
kubectl apply -f k8s/
# Check deployment status
kubectl get pods -n opendcim
kubectl get services -n opendcim- Set secure environment variables
- Configure SSL/TLS certificates
- Set up monitoring and logging
- Configure backup strategy
- Set up CI/CD pipelines
- Configure security scanning
- Set up performance monitoring
# Run all tests
vendor/bin/phpunit
# Run specific test suite
vendor/bin/phpunit --testsuite=Unit
vendor/bin/phpunit --testsuite=Integration
vendor/bin/phpunit --testsuite=Feature
# Generate coverage report
vendor/bin/phpunit --coverage-html tests/coveragecd app
# Run tests
npm run test
# Run tests with UI
npm run test:ui
# Run tests in watch mode
npm run test -- --watch- Backend: PHPUnit with 80%+ coverage target
- Frontend: Vitest with React Testing Library
- E2E: Playwright (planned)
- Performance: Lighthouse CI
- Security: Trivy vulnerability scanning
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Make your changes
- Run tests
# Backend vendor/bin/phpunit # Frontend cd app && npm run test
- Submit a pull request
- PHP: PSR-12 coding standards
- JavaScript/TypeScript: ESLint configuration
- Git: Conventional commits
- Documentation: Markdown with examples
This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.
- Documentation: docs/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Wiki: GitHub Wiki
- Original openDCIM contributors
- Mantine UI team for the excellent component library
- Slim Framework team for the lightweight PHP framework
- All contributors and maintainers
Made with β€οΈ by the adamsDCIM community