https://github.com/puneethkumarck/eurovision-voting-api
VotingAPI
https://github.com/puneethkumarck/eurovision-voting-api
java kubernetes spring-boot
Last synced: about 1 year ago
JSON representation
VotingAPI
- Host: GitHub
- URL: https://github.com/puneethkumarck/eurovision-voting-api
- Owner: Puneethkumarck
- Created: 2022-06-06T12:05:57.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-07-01T11:45:37.000Z (almost 4 years ago)
- Last Synced: 2025-01-29T22:46:11.694Z (over 1 year ago)
- Topics: java, kubernetes, spring-boot
- Language: Java
- Homepage:
- Size: 942 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/Puneethkumarck/eurovision-voting-api/actions/workflows/main.yml)
[](https://sonarcloud.io/summary/new_code?id=Puneethkumarck_eurovision-voting-api)
[](https://sonarcloud.io/summary/new_code?id=Puneethkumarck_eurovision-voting-api)
[](https://sonarcloud.io/summary/new_code?id=Puneethkumarck_eurovision-voting-api)
[](https://sonarcloud.io/summary/new_code?id=Puneethkumarck_eurovision-voting-api)
[](https://sonarcloud.io/summary/new_code?id=Puneethkumarck_eurovision-voting-api)
[](https://sonarcloud.io/summary/new_code?id=Puneethkumarck_eurovision-voting-api)
[](https://sonarcloud.io/summary/new_code?id=Puneethkumarck_eurovision-voting-api)
# eurovision-voting-api
Assumptions
* Database of our choice (For Simplicity selected H2 database)
* Build Database schema as per functional requirement
* Build 3 client facing endpoints as per functional requirements
* Build Service and repository layers to fetch data and perform business logic
* Write tests for each layer (Web/service/repository)
* Add Input validation and exception handlers
* Add API documentation with Spring Rest Docs
* Add Docker file to create docker image and deploy in a kubernetes env
* Create an helm chart to deploy voting app (which contains K8s Manifests)
* No Specific requirements for API security.
### Pre requisite installation
* Java 11
* Gradle
* kubernetes docker for desktop/minikube
* Helm
### Tech
* Java 11
* Springboot
* Spring-Data-Jpa
* Spring-Boot-Actuator
* Spring-rest-docs
* Lombok
* Gradle
* kubernetes
* Docker
* Helm
### Build
```
Build application which produces snapshot Jar
./gradlew build
Build docker image
docker build -t api/votingapi:v1 .
```
### Run
```
without Docker/helm -
./gradlew bootRun
With Docker/Helm
helm template charts
helm lint charts
helm install votingapirelease charts
helm upgrade -i votingapirelease . (incremental deployments)
```
## Postman
App is deployed in heroku and available under https://eurovision-voting-api.herokuapp.com
[](https://god.gw.postman.com/run-collection/685178-9a661b0a-87f7-4b9e-a6c2-67834043ed0a?action=collection%2Ffork&collection-url=entityId%3D685178-9a661b0a-87f7-4b9e-a6c2-67834043ed0a%26entityType%3Dcollection%26workspaceId%3De03b2ab3-447a-4a5f-8818-be163b36a6e7)
## Spring rest docs



## Sql Queries and Results with initial data setup
```
SELECT VOTED_FOR,count(VOTED_FOR) as total FROM VOTE WHERE VOTING_YEAR = '2022' group by VOTED_FOR order by count(VOTED_FOR) DESC limit 3
SELECT VOTED_FOR , count(VOTED_FOR) as total FROM VOTE WHERE VOTING_YEAR ='2022' and COUNTRY_FROM='Netherlands' group by VOTED_FOR order by count(VOTED_FOR) DESC limit 3
```
### Top three countries with maximum votes for given year

### Top three Fav songs from each country and given year
