A simple Spring Boot MVC application that analyzes user-submitted reviews for sentiment (positive/negative), persists results, and allows users to provide feedback for retraining.
| Path | Method | Description |
|---|---|---|
/ |
GET |
Renders the homepage with a review form, version info, and past inferences. |
/ |
POST |
Submits a review for sentiment inference. Result is stored and shown on page. |
/train |
POST |
Submits corrections (disagreed predictions). Flips sentiment and stores feedback. |
/train |
GET |
Returns all user feedback entries as JSON for retraining or inspection. |
/actuator/prometheus |
GET |
Exposes Prometheus-formatted metrics via Micrometer for observability. |
| Feature | Details |
|---|---|
| Review Submission | Users enter a review via a form. It is sent to the model API (/predict via MODEL_URL) and classified. |
| Result Display | All prior predictions are shown on the homepage, along with version info and a feedback checkbox. |
| Feedback Submission | Users can select incorrect predictions and submit feedback. The system stores flipped sentiments. |
| Feedback API | Accessible at /train (GET) as JSON. Useful for training data collection. |
| Metrics | Inference time, failure counts, and stored review counts are tracked and exposed via Prometheus. |
- Java 17+
- Maven 3.6+
- A running sentiment model REST endpoint at
/predict
- Download app package from the repository or from ghcr.io/remla25-team6/app
- Run it with docker
docker run -p 8080:8080 -e MODEL_URL='<MODEL_URL>' app
- Clone the repository:
git clone https://github.com/remla25-team6/app.git cd app - Configure the following environment variable:
MODEL_URL=<YOUR MODEL URL>
- Authenticate Maven to GitHub repository via PAT:
// in /.m2/settings.xml <settings> <servers> <server> <id>github</id> <username>YOUR USERNAME</username> <!-- your GitHub username --> <password>YOUR PAT</password> <!-- your PAT --> </server> </servers> </settings> - Build the project with Maven:
mvn clean package
Micrometer metrics are available at /actuator/prometheus and can be scraped by Prometheus. Custom metrics are configured via WebMetrics.java and MetricsConfig.java.
This project uses GitHub Actions to automate testing and versioned releases.
Every commit and pull request triggers the cicd.yml workflow, which:
- Builds the application using Maven
- Runs unit tests
- Verifies build and integration success
To publish an official release:
- Ensure all changes are committed and pushed to a release-ready branch.
- Tag the commit with a semantic version like
v0.1.0and push:
git tag v0.1.0
git push origin v0.1.0- This triggers the release.yml workflow, which:
- Builds the application
- Publishes a GitHub Release with the JAR file attached
To publish a pre-release:
- Push a commit to the
mainbranch (e.g. through a pull request tomain). - The
prerelease.ymlworkflow runs automatically on each commit to main:
- Builds and packages the app
- Publishes a pre-release on GitHub with a timestamped version (e.g.,
v0.1.0-pre.20250625.185600)