Prerequisites
Before you begin, make sure you have the following installed:- Java 17+ — check with
java -version - Maven — bundled via the Maven wrapper (
./mvnw), no separate install needed - Redis — a local instance works fine for getting started
Steps
Clone and build
Clone the repository and build the JAR, skipping tests for speed:Maven downloads dependencies on the first run. Subsequent builds are faster.
Set required environment variables
The service reads its Redis connection URL from the If you are pushing metrics to Grafana Cloud, also export
REDIS_URL environment variable. Export it before starting:GRAFANA_CLOUD_ZONE, GRAFANA_CLOUD_INSTANCE_ID, and GRAFANA_CLOUD_API_KEY. Those variables are optional for local testing.Run the service
Start the service using the Maven wrapper:The service starts on port
8080 by default. You should see Spring Boot’s startup banner followed by a line confirming the application started successfully.Make your first request
In a new terminal, call the The service increments Alice’s counter in Redis and returns
/check endpoint with a userId:200 User is allowed.The default configuration allows 5 requests per 60-second sliding window. See the configuration page to change the algorithm, window size, or request limit.
Next steps
Configuration
Adjust the algorithm, window size, and Redis connection.
Algorithms
Understand the difference between fixed-window and sliding-window counters.
API reference
Full reference for the
GET /check endpoint.