Dockerneeds to be installed- Clone or checkout the project from version control system (
git) and follow below steps - For local development only (not needed for Docker-based workflows):
Java 25+needs to be installedexport JAVA_HOME=$(/usr/libexec/java_home -v 25)Mavenneeds to be installed (or use the included Maven wrapper./mvnw)- Install any Java IDE (
Eclipse,STS,Intellijetc..)
- The Dockerfile uses a multi-stage build with Maven cache mounts and a jlink custom runtime, so you do not need to build the JAR locally first. Docker handles the full build (compile + package) inside the container.
- Tests are skipped during the Docker build because Testcontainers requires a Docker daemon which is not available
inside
docker build. Run tests on the host before building. - The
start_applicationprofile builds the app image and starts it together with all infrastructure services (Redis, Kafka, Elasticsearch, ActiveMQ, Mailpit, Zipkin, Jaeger, etc.). Services with healthchecks (Elasticsearch, Kafka) must be healthy before the app starts. Docker->Preferences->Resources->File sharing-> click add button and selectprometheusfolder under the/src/main/resourcesor just add/etc/prometheuspath ->Apply & Restart
cd live-data-service
# Run tests on the host (requires Docker for Testcontainers)
mvn clean verify
# Build and start the application together with all infrastructure services
docker compose --profile start_application up -d --build
# Start only infrastructure services (Redis, Kafka, Elasticsearch, etc.)
docker compose up -d
# For local development without Docker (requires infrastructure services running via docker compose up -d)
./mvnw spring-boot:run # or: mvn spring-boot:run-
Java 25 -
Spring Boot 4 -
H2 Database(Default values are provided below)Default H2 Database Url: http://localhost:8080/h2-consoleusername:sapassword:saurl:jdbc:h2:mem:mb_test;DB_CLOSE_DELAY=-1
-
Flywayfor database migration -
Centralize exception handling by
ControllerAdvice -
Mapstructto map different type of objects to each other -
Micrometerdependencies were added to track the logs easily -
Testcontainersdependencies were added for integration tests -
docker-compose.ymlcontainsGrafana,PrometheusandZipkinto track metrics,Kafkafor event-driven architecture,Redisfor caching,Elasticsearch,Kibana, andLogstashfor search, analytics engine and logs,PostgreSQLandMongoDBfor data storage.- Kafka and its UI are included for message streaming, while the Elastic Stack (Elasticsearch, Logstash, Kibana) is set up for log management and visualization.
- All services are connected through
bridgenetworks, ensuring communication between containers. Actuator: http://localhost:8080/actuatorKafka UI: http://localhost:9999/RedisInsight: http://localhost:5540/Redis Host:redisRedis Port:6379
activemq-artemis Web Console: http://localhost:8161Grafana- Login Credentials
- Url: http://localhost:3000/
- Email or username:
admin - Password:
admin
- Add
PrometheusDatasource - Add Dashboards
- Login Credentials
PrometheusActuator: http://localhost:8080/actuator/prometheusPrometheus: http://localhost:9090/graph
Zipkin UI: http://localhost:9411Elasticsearch: http://localhost:9200/Kibana: http://localhost:5601/app/home#/- Connect Spring Boot to
Elasticsearch(TESTED FOR SPRING BOOT 4) - Run Spring Boot project
- Open http://localhost:5601/app/home#/ -->
Discover-->Create data view->Name should be Index name-->Save date view to Kibana
- Connect Spring Boot to
Database credentialsPostgreSQLurl:jdbc:postgresql://localhost:5432/localdbusername:testpassword:test
MongoDBurl:mongodb://localhost:27017/testdb?authSource=adminusername:rootpassword:example
- GraphQL endpoint: http://localhost:8080/graphiql?path=/graphql
- GraphQL API Documentation in Swagger UI:
- Swagger UI: http://localhost:8080/swagger-ui/index.html - Select
graphql-apifrom the dropdown - GET /api/graphql/schema - Returns the GraphQL schema (SDL)
- GET /api/graphql/info - Provides API documentation with available queries and mutations
- GET /api/graphql/examples/queries - Example query payloads
- GET /api/graphql/examples/mutations - Example mutation payloads
- Swagger UI: http://localhost:8080/swagger-ui/index.html - Select
- GraphQL API Documentation in Swagger UI:
- gRPC API Documentation in Swagger UI:
- Swagger UI: http://localhost:8080/swagger-ui/index.html - Select
live-data-servicefrom the dropdown
- Swagger UI: http://localhost:8080/swagger-ui/index.html - Select
- Mailpit UI: http://localhost:8025/
username:adminpassword:admin- Mailpit is a local SMTP server for testing email sending functionality without actually sending emails to real addresses. It captures and displays emails sent by the application, allowing developers to verify email content and functionality during development.
-
Test via
Postman(OPTIONAL):- Import Postman Collection
- Right-click the imported Postman Collection and click Run Collection section.
- On the right panel choose Functional or Performance section, edit Run configuration and click run to test the application.
-
The following command returns all matched data by
'keyPattern:*'patternredis-cli --scan --pattern 'keyPattern:*'
-
The following command deletes all matched data by
'keyPattern:*'patternredis-cli KEYS 'keyPattern:*' | xargs redis-cli DEL
-
The following command finds
TYPEin redis withKEYTYPE key->TYPE xxx:hashedIdOrSomethingElse
-
The following commands search by
TYPE- for
"string" TYPE:get key - for
"hash" TYPE:hgetall key - for
"list" TYPE:lrange key 0 -1 - for
"set" TYPE:smembers key - for
"zset" TYPE:zrange key 0 -1 withScores
- for
- Setup Firebase or Just follow the following steps
to Initialize the SDK, Create and Download Firebase Credentials JSON File
- After JSON file is downloaded, copy the content of downloaded file and replace
play-integrity-credentials.jsoncontent with that copied text - Replace
application-namevalue in application.yml file withproject_idvariable that is inplay-integrity-credentials.json - HELPFUL LINK BUT IT SHOULD NOT BE NEEDED
- After JSON file is downloaded, copy the content of downloaded file and replace
- Metrics Made Easy Via Spring Actuator, Docker, Prometheus, and Grafana
- https://prometheus.io/docs/prometheus/latest/installation/#volumes-bind-mount
- Spring Boot Rest Controller Unit Test with @WebMvcTest
- Redis Commands
- 🚀 Set Up Redis with RedisInsight Using Docker for Local Development
- Google Play Integrity API
- A Guide to Querydsl with JPA
- Ahead of Time Optimizations
- Spring GRPC

