RunWatch is a real-time monitoring application for GitHub Actions workflows. It provides an interactive dashboard to track GitHub Action runs, including their status, execution time, and performance trends.
- 🔄 Real-time monitoring of GitHub Actions workflow runs
- 📊 Dashboard displaying current and historical workflow runs
- 🔍 Detailed view of individual workflow runs and jobs
- 📈 Statistics and analytics on workflow performance
- 🔔 WebSocket-based real-time updates
- Node.js & Express - API and webhook handling
- MongoDB with Mongoose - Data storage
- Socket.IO - Real-time communication
- @octokit/webhooks - GitHub webhook processing
- React - UI framework
- Material UI - Component library
- React Router - Navigation
- Chart.js - Data visualization
- Socket.IO Client - Real-time updates
The application is structured as follows:
-
GitHub Webhook Integration: The backend receives webhook events from GitHub when workflow runs start, update, and complete.
-
Data Processing Pipeline: Incoming webhook data is processed, normalized, and stored in the database.
-
Real-time Communication: Updates are broadcast to connected clients via WebSockets.
-
Dashboard UI: The React frontend displays current and historical workflow data.
- Node.js (v14+)
- MongoDB
- GitHub repository with Actions workflows
- Ability to configure GitHub webhooks
-
Copy the example environment file:
cp .env.example .env
-
Configure the following environment variables in
.env
:# Node environment NODE_ENV=development # Application environment (development/production) # Server Configuration PORT=5001 # Port where the backend server will run MONGODB_URI=mongodb://mongodb:27017/runwatch # MongoDB connection string # GitHub Configuration GITHUB_WEBHOOK_SECRET=your_github_webhook_secret # Generated webhook secret GITHUB_APP_ID=your_github_app_id # GitHub App ID GITHUB_APP_PRIVATE_KEY_PATH=./path/to/private-key.pem # Path to GitHub App private key # Client Configuration CLIENT_URL=http://localhost # Base URL for the client application REACT_APP_API_URL=http://localhost/api # API endpoint URL for the client REACT_APP_WEBSOCKET_URL=ws://localhost # WebSocket URL for real-time updates
-
Generate a webhook secret:
node scripts/generate-webhook-secret.js
-
Set up your GitHub App:
- Create a GitHub App in your organization's settings
- Note down the App ID
- Generate and download the private key
- Place the private key file in your project directory
- Update the GITHUB_APP_ID and GITHUB_APP_PRIVATE_KEY_PATH in your .env file
-
Navigate to the server directory:
cd server
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Navigate to the client directory:
cd client
-
Install dependencies:
npm install
-
Start the development server:
npm start
-
In your GitHub repository, go to Settings > Webhooks > Add webhook
-
Configure the webhook:
- Payload URL:
https://your-server-url/api/webhooks/github
- Content type:
application/json
- Secret: Use the same secret as in your
.env
file - Events: Select "Workflow runs" and any other events you want to track
- Payload URL:
-
Save the webhook
-
After setting up the application and configuring the webhooks, visit
http://localhost:3000
to access the dashboard. -
When GitHub Actions workflows run in your repositories, you'll see real-time updates on the dashboard.
-
Click on individual workflow runs to view detailed information about the jobs and steps.
-
Check the Statistics page for insights on workflow performance and trends.
For development, you can run both the backend and frontend servers simultaneously:
-
In one terminal, start the backend server:
cd server && npm run dev
-
In another terminal, start the frontend:
cd client && npm start
The application can be deployed using Docker and Docker Compose. This will create three containers:
- MongoDB database
- Node.js backend server
- Nginx serving the React frontend
- Docker
- Docker Compose
- Git
-
Clone the repository:
git clone <repository-url> cd RunWatch
-
Create a
.env
file in the root directory:# Node environment NODE_ENV=production # Server Configuration PORT=5001 MONGODB_URI=mongodb://mongodb:27017/runwatch # GitHub Configuration GITHUB_WEBHOOK_SECRET=your_github_webhook_secret GITHUB_APP_ID=your_github_app_id GITHUB_APP_PRIVATE_KEY_PATH=./path/to/private-key.pem # Client Configuration CLIENT_URL=http://localhost REACT_APP_API_URL=http://localhost/api REACT_APP_WEBSOCKET_URL=ws://localhost
-
Use the deployment script to manage the application:
# Start all services ./deploy.sh start # View logs ./deploy.sh logs # Stop all services ./deploy.sh stop # Rebuild services ./deploy.sh build # Check status ./deploy.sh status
-
Access the application:
- Frontend: http://localhost
- Backend API: http://localhost/api
- WebSocket: ws://localhost/socket.io
./deploy.sh start
- Start all services./deploy.sh stop
- Stop all services./deploy.sh restart
- Restart all services./deploy.sh logs
- Show logs from all services./deploy.sh build
- Rebuild all services./deploy.sh clean
- Remove all containers and volumes./deploy.sh status
- Show status of all services
The Docker setup includes:
- Automatic container restart on failure
- Volume persistence for MongoDB data
- Nginx reverse proxy configuration
- Network isolation between services
- Health checks and dependency management
- Authentication and multi-user support
- More advanced filtering and search capabilities
- Custom notifications for workflow failures
- Integration with other CI/CD platforms
MIT