PingPatrol is a web-based uptime monitoring service, designed to offer basic functionalities similar to UptimeRobot. It aims to provide users with the capability to monitor the availability of their websites and receive notifications in case of downtime. The project's goal is to deepen knowledge in Java Spring Boot, ReactJS, and cloud technologies, while creating a functional and user-friendly service.
- Website Monitoring: Regular checks of user-specified websites to determine availability.
- Alerts: Notification system to inform users of downtime incidents.
- User Dashboard: For adding and managing monitored websites.
- User Authentication: Secure login for users and admins.
- Admin Panel: For administrative functions and user management.
- Reporting: Basic reporting on website uptime and performance.
- Backend: Java Spring Boot (latest version).
- Frontend: ReactJS with Material UI or Tailwind for styling.
- Identity Management: Keycloak for Single Sign-On (SSO) and user management.
- Database: MariaDB.
- Testing: JUnit, Mockito for backend; React Testing Library for frontend; Plawright for e2e.
- CI/CD: GitHub Actions or Jenkins.
- Cloud Services: AWS/Azure for hosting and related cloud services.
- Backend: Modular monolith using clean architecture principles to ensure maintainability and scalability.
- Frontend: Simple, user-friendly UI, utilizing pre-built UI components from Material UI or Tailwind.
- Integration: RESTful services for frontend-backend communication, Keycloak integration for authentication and authorization.
- Testing: Comprehensive testing strategy including unit, acceptance, and E2E tests.
For now external services are consisted of:
- Database
- Keycloak
Navigate to scripts/local-setup
directory and run:
./local-setup.sh restart ping-patrol-db
./local-setup.sh restart keycloak --rebuild
- Build Service
cd keycloakconfigurer
./gradlew bootRun
- Build Service
cd ping-patrol-service
./gradlew clean build
./gradlew bootRun
- Build Service
cd ping-patrol-web-client
npm install
npm run dev
Application | URL | Credentials |
---|---|---|
ping-patrol-api | http://localhost:8080/v1/swagger-ui/index.html | Access Token |
movie-ui | http://localhost:3000 | admin@test.com/admin or user@test.com/user |
Keycloak | http://localhost:9080/admin | admin/admin |
- Ping Patrol Landing Page
- Login Page
- Dashboard Overview
- Dashboard Monitors
You can manage ping-patrol by accessing directly ping-patrol-rest-api endpoints using the Swagger website or curl.
However, for the
secured endpoints like POST /v1/monitors
, PUT /v1/monitors/{id}
, PUT /v1/monitors/{id}/resume
, etc, you need to
inform an
access token issued by Keycloak.
ACCESS_TOKEN="$(curl --location 'http://localhost:9080/realms/pingpatrol/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'client_id=pingpatrol-webapp' \
--data-urlencode 'username=admin@test.com' \
--data-urlencode 'password=admin' \
--data-urlencode 'scope=openid' | jq -r '.access_token')"
echo $ACCESS_TOKEN
- Create a monitor
curl --location 'http://localhost:8080/v1/monitors' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--data '{
"name": "kudostech",
"type": "HTTPS",
"url": "https://kudostech.ro",
"monitoringInterval": 60,
"monitorTimeout": 100
}'