This project is a web-based virtual machine (VM) management platform with role-based access control, automation features, and payment integration. It's built using React.js for the frontend, Node.js for the backend, and MongoDB as the database.
- Prerequisites
- Installation
- Configuration
- Running the Application
- Testing
- Deployment
- CI/CD Pipeline
- Project Structure
- Contributing
- License
Before you begin, ensure you have the following installed:
- Node.js (v14.x or later)
- npm (v6.x or later)
- MongoDB (v4.x or later)
- Docker (for containerization and Kubernetes deployment)
- Kubernetes CLI (kubectl)
- Git
-
Clone the repository:
git clone https://github.com/cyprianndemo/vmmanager.git cd vm-management-platform
-
Install backend dependencies:
cd backend npm install
-
Install frontend dependencies:
cd ../systemapplication npm install
-
Backend configuration:
- Create a
.env
file in thebackend
directory with the following content:PORT=5000 MONGODB_URI=mongodb://localhost:27017/vm_management JWT_SECRET=your_jwt_secret_here SSO_CLIENT_ID=your_sso_client_id SSO_CLIENT_SECRET=your_sso_client_secret
- Create a
-
Frontend configuration:
- Create a
.env
file in thefrontend
directory with the following content:REACT_APP_API_URL=http://localhost:5000/api REACT_APP_SSO_CLIENT_ID=your_sso_client_id
- Create a
-
Start the MongoDB server:
mongod
-
Start the backend server:
cd backend npm run start
-
Start the frontend development server:
cd systemapplication npm start
-
Open your browser and navigate to
http://localhost:3000
to access the application.
-
Run backend tests:
cd backend npm test
-
Run frontend tests:
cd systemapplication npm test
To deploy the application to a Kubernetes cluster:
-
Build and push Docker images:
docker build -t vm-management-backend ./backend docker build -t vm-management-frontend ./systemapplication docker push your-registry/vm-management-backend docker push your-registry/vm-management-systemapplication
-
Apply Kubernetes manifests:
kubectl apply -f k8s/
-
Configure SSL:
- Install and configure cert-manager in your Kubernetes cluster
- Apply the necessary Certificate and Ingress resources
The project uses GitHub Actions for CI/CD. The pipeline is configured in .github/workflows/main.yml
and includes the following steps:
- Run tests
- Build Docker images
- Push images to a container registry
- Deploy to Kubernetes cluster
To set up the CI/CD pipeline:
-
Configure secrets in your GitHub repository settings:
DOCKER_USERNAME
DOCKER_PASSWORD
KUBE_CONFIG
-
Push changes to the
main
branch to trigger the pipeline
vm-management-platform/
├── backend/
│ ├── src/
│ │ ├── controllers/
│ │ ├── models/
│ │ ├── routes/
│ │ ├── services/
│ │ └── app.js
│ ├── tests/
│ └── package.json
├── frontend/
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ ├── utils/
│ │ └── App.js
│ ├── tests/
│ └── package.json
├── k8s/
│ ├── backend-deployment.yaml
│ ├── frontend-deployment.yaml
│ ├── ingress.yaml
│ └── services.yaml
├── .github/
│ └── workflows/
│ └── main.yml
└── README.md
- Fork the repository
- Create a new branch:
git checkout -b feature-branch-name
- Make changes and commit:
git commit -am 'Add new feature'
- Push to the branch:
git push origin feature-branch-name
- Submit a pull request
This project is licensed under the MIT License.