Create badges for present view count of your webpages.
|
|
Main export of the project |
|
|
Live website — You can create your own |
Clone the project
git clone git@github.com:femrek/request-tracker.gitGo to the project directory
cd request-trackerCreate GitHub OAuth2 app.
- Create a GitHub OAuth2 application. https://github.com/settings/developers. Then, create a secret.
- Enter your apps information (
GITHUB_CLIENT_IDandGITHUB_CLIENT_SECRET) into.envor.env.propertiesfiles.
Create JAR file
./mwnw clean packageCreate .env file. (lines starting with # are optional)
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
SPRING_PORT=8181
SHIELD_URL=http://shield:80
POSTGRES_PASSWORD=
POSTGRES_HOST=db
#POSTGRES_DB=
#REQUEST_TRACKER_URL=Run docker compose
docker compose upCreate .env.properties file to configure spring app.
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
SPRING_PORT=8181
POSTGRES_PASSWORD=
POSTGRES_HOST=db
#POSTGRES_DB=
#SHIELD_URL=http://localhost:8380
#REQUEST_TRACKER_URL=Run Postgres and Shield
docker compose up db shieldRun the application
./mwnw spring-boot:run- Connect the application (
localhost:8181by default). - Login via GitHub.
- Create a new subscription with the button in the subscriptions section.
- Copy one of the links and try to connect. (counter must be increased after connection)
The app is built as MVC app. But, for embed the service to webpages, following end-points exist.
GET /request/{uuid}Increases the counter of the subscription by one and responds with the new subscription.
GET /no-request/{uuid}Returns the subscription without increasing the counter.
| Parameter | Type | Description |
|---|---|---|
uuid |
string |
Required. The id of the related subscription |
Return json in form of following example.
{
"id": "0e9a0a0a-40af-4361-a205-67ab239ec368",
"name": "Subscription Name",
"count": 42,
"restEndpoint": "/api/subscriptions/request/0e9a0a0a-40af-4361-a205-67ab239ec368",
"svgEndpoint": "/api/subscriptions/request/badge/0e9a0a0a-40af-4361-a205-67ab239ec368",
"createdAt": "2025-07-08T18:15:30.012+00:00"
} GET /request/badge/{uuid}?label=Views&color=blueIncreases the counter of the subscription by one and responds shield image as svg.
GET /no-request/badge/{uuid}?label=Views&color=blueReturns the shield image as svg without increasing the counter.
| Parameter | Type | Description |
|---|---|---|
uuid |
string |
Required. The id of the related subscription |
| Get Parameter | Type | Description |
|---|---|---|
label |
string |
Optional. The text shown at the left side of the badge |
color |
color |
Optional. The color of the right sid of the badge |
Note: all shield static parameters are allowed. Can generate query here.
Returns svg image. (generated by shield)
