Skip to content

femrek/request-tracker

Repository files navigation

Request Tracker

Create badges for present view count of your webpages.

View Count Badge Main export of the project
Live Site Badge Live website — You can create your own

req-tra-demo-low-res

Run The Application

Clone the project

  git clone git@github.com:femrek/request-tracker.git

Go to the project directory

  cd request-tracker

Create GitHub OAuth2 app.

  1. Create a GitHub OAuth2 application. https://github.com/settings/developers. Then, create a secret.
  2. Enter your apps information (GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET) into .env or .env.properties files.

a. For Docker Run

Create JAR file

  ./mwnw clean package

Create .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 up

b. For Native Run (only the Spring app runs natively)

Create .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 shield

Run the application

./mwnw spring-boot:run

After Run

  1. Connect the application (localhost:8181 by default).
  2. Login via GitHub.
  3. Create a new subscription with the button in the subscriptions section.
  4. Copy one of the links and try to connect. (counter must be increased after connection)

API Reference

The app is built as MVC app. But, for embed the service to webpages, following end-points exist.

Get Subscription Data (includes count)

  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 Badge

  GET /request/badge/{uuid}?label=Views&color=blue

Increases the counter of the subscription by one and responds shield image as svg.

  GET /no-request/badge/{uuid}?label=Views&color=blue

Returns 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)

Technologies Used

About

Track when someone accessed your web page.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors