This project consists of two parts: a ReactJS frontend and a NodeJS backend.
This ReactJS application provides the user interface for the application.
Clone the repository:
git clone https://github.com/Uj5Ghare/DevOps-Engineer-Project.git
Navigate to the frontend directory:
cd frontend
Install dependencies:
npm install
Run the application:
npm start
This will start the development server and open the application in your browser at http://localhost:3000/.
Build for Production To create an optimized build for production deployment.
run:
npm run build
This will create a production-ready build in the build directory.
This NodeJS application provides the backend logic and API endpoints for the application.
Clone the repository (if not already done):
git clone https://github.com/Uj5Ghare/DevOps-Engineer-Project.git
Navigate to the backend directory:
cd backend
Install dependencies:
npm install
Start the development server:
npm start
This will start the backend server and listen for API requests on http://localhost:8000/
The backend provides a new API endpoint at /status
that provides information about the application's current state and uptime.
The backend has integrated simple test case.
To run the tests:
npm test
This workflow automates building, testing, deploying, and securing of ReactJS frontend and NodeJS backend applications.
Pushes to branches main and dev that modify files in:
.github/workflows/main.yml
(the workflow itself)frontend/
directorybackend/
directoryk8s/manifests/**/*
directory- Pull requests to the main branch
Build-And-Test (runs on pull requests):
- Tests the backend code (requires
backend/
directory)
Push-To-DockerHub-Frontend (frontend changes):
- Builds and pushes a Docker image for the frontend application
Image-Vuln-Check-Frontend (frontend changes):
- Scans the built frontend Docker image for vulnerabilities
Update-ImgTag-Frontend (frontend changes):
- Updates the image tag in the Kubernetes deployment manifest based on the workflow run number
Deploy-On-Minikube-Frontend (frontend changes):
- Deploys the updated frontend image to a local Minikube cluster (for testing)
Slack-Notification-Frontend (frontend changes):
- Sends a notification to a Slack channel about the deployment result
- Similar jobs exist for backend changes (replace "frontend" with "backend")
- Docker and Docker Hub access (secrets:
DOCKER_TOKEN
,DOCKER_USER
) - GitHub personal access token (secrets:
GITHUB_TOKEN
) - optional - Slack communication (secrets:
SLACK_BOT_TOKEN
,SLACK_CHANNEL_ID
)
The workflow scans frontend Docker images for vulnerabilities using Trivy.