Skip to content

adampaulsen/adamsdcim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

adamsDCIM - Modern Data Center Infrastructure Management

A comprehensive, modern data center infrastructure management system with a React frontend, PHP backend API, and robust authentication system.

πŸš€ Modernization Overview

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

πŸ“‹ Table of Contents

✨ Features

πŸ” Authentication & Security

  • 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

πŸ–₯️ Modern Frontend

  • 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

πŸ”§ Robust Backend

  • 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

πŸš€ DevOps & Deployment

  • 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

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React SPA     β”‚    β”‚   PHP API v2    β”‚    β”‚   MySQL DB      β”‚
β”‚   (Frontend)    │◄──►│   (Backend)     │◄──►│   (Database)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”‚
         β”‚              β”‚   Redis Cache   β”‚              β”‚
         β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
         β”‚                                              β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                    β”‚
β”‚   SSO Providers β”‚                                    β”‚
β”‚  (SAML/OIDC)    β”‚                                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                    β”‚
                                                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚   Nginx Proxy   β”‚    β”‚   Monitoring    β”‚             β”‚
β”‚   (Load Bal.)   β”‚    β”‚   & Logging     β”‚             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚

Technology Stack

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

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose
  • Node.js 18+ (for development)
  • PHP 8.1+ (for development)
  • MySQL 8.0+ (for development)

Using Docker (Recommended)

  1. Clone the repository

    git clone https://github.com/adampaulsen/adamsdcim.git
    cd adamsdcim
  2. Set up environment variables

    cp .env.example .env
    # Edit .env with your configuration
  3. Start the application

    docker-compose up -d
  4. Access the application

Manual Setup

  1. Backend Setup

    # Install PHP dependencies
    composer install
    
    # Set up database
    php migrations/migrate.php
    
    # Start PHP server
    php -S localhost:8080 -t .
  2. Frontend Setup

    cd app
    npm install
    npm run dev

πŸ› οΈ Development

Project Structure

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

Development Commands

Backend

# 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.php

Frontend

cd app

# Development server
npm run dev

# Run tests
npm run test

# Build for production
npm run build

# Linting
npm run lint

Environment Variables

Backend (.env)

# 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'

Frontend (.env)

VITE_API_BASE_URL=http://localhost:8080/api/v2
VITE_APP_TITLE=adamsDCIM

πŸ“š API Documentation

API v2 Endpoints

The modern API v2 provides RESTful endpoints with JWT authentication:

Authentication

  • POST /api/v2/auth/login - User login
  • POST /api/v2/auth/refresh - Refresh JWT token
  • POST /api/v2/auth/logout - User logout
  • POST /api/v2/auth/sso/callback - SSO callback

Resources

  • GET /api/v2/devices - List devices
  • POST /api/v2/devices - Create device
  • GET /api/v2/devices/{id} - Get device
  • PUT /api/v2/devices/{id} - Update device
  • DELETE /api/v2/devices/{id} - Delete device

Statistics

  • GET /api/v2/stats/overview - Overview statistics
  • GET /api/v2/stats/datacenters/{id} - Data center statistics

Interactive Documentation

Access the interactive API documentation at:

πŸš€ Deployment

Docker Deployment

# 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

Kubernetes Deployment

# Apply Kubernetes manifests
kubectl apply -f k8s/

# Check deployment status
kubectl get pods -n opendcim
kubectl get services -n opendcim

Production Checklist

  • 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

πŸ§ͺ Testing

Running Tests

Backend Tests

# 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/coverage

Frontend Tests

cd app

# Run tests
npm run test

# Run tests with UI
npm run test:ui

# Run tests in watch mode
npm run test -- --watch

Test Coverage

  • Backend: PHPUnit with 80%+ coverage target
  • Frontend: Vitest with React Testing Library
  • E2E: Playwright (planned)
  • Performance: Lighthouse CI
  • Security: Trivy vulnerability scanning

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/your-feature-name
  3. Make your changes
  4. Run tests
    # Backend
    vendor/bin/phpunit
    
    # Frontend
    cd app && npm run test
  5. Submit a pull request

Code Standards

  • PHP: PSR-12 coding standards
  • JavaScript/TypeScript: ESLint configuration
  • Git: Conventional commits
  • Documentation: Markdown with examples

πŸ“„ License

This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments

  • 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

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors