DevZone
DevZone is a web application where developers can register and post their favourite article/video posts.
Features
- Users can register and login
- Authenticated user can create a new post under a category
- Authenticated user can delete own posts
- Admin user can delete any post
- Any user(including guest users) can view posts with pagination
- sort by posted date desc (default)
- by category
- by searching for a keyword in title
Tech Stack
How to run?
Run application locally
$ ./gradlew bootRun
Run application using docker-compose
$ ./run.sh start_app
Deploying on kubernetes
$ cd deployment
$ ./kind/kind-cluster.sh create
$ ./run.sh k8sdeploy
$ curl http://localhost:30090/actuator
$ curl http://localhost/actuator
$ ./run.sh k8sundeploy
$ ./kind/kind-cluster.sh destroy
Development using Skaffold
$ skaffold dev --port-forward --skip-tests=true
$ curl http://localhost:8080/actuator
Run Gatling Tests
$ ./gradlew gatlingRun
Run PlayWright E2E Tests
$ ./gradlew :playwright-e2e-tests:e2eTest
$ export CONFIG_FILE=dev.json
$ ./gradlew :playwright-e2e-tests:e2eTest
ELK Stack
- Start ELK stack using
$ ./run.sh start_elk
- Go to http://localhost:5601/
- Analytics -> Discover -> create a data view -> Name: "devzone", Index pattern: "devzone*", Timestamp field: "@timestamp"
Note: Logstash is configured to read log files, so in order to initialize the index make few requests to devzone application to generate some logs.
Monitoring
- Start Prometheus, Grafana, Loki using
$ ./run.sh start_monitoring
- Few Dashboards are already pre-configured to show SpringBoot application Metrics
Loki - Log management
- Navigate to http://localhost:3000/datasources
- Click on Add datasource -> Select Loki
- Enter URL as http://loki:3100 (Host "loki" is based on name given to loki container in docker-compose-monitoring.yml file)
- Click on Save & Test
- Click on Explore in the Left Nav and Select Loki
- In Log browser input text enter
{job="devzone"}
Important Links