https://github.com/c0debrain/data-diff
https://github.com/c0debrain/data-diff
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/c0debrain/data-diff
- Owner: c0debrain
- Created: 2020-03-10T02:17:43.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-10T02:19:50.000Z (almost 6 years ago)
- Last Synced: 2025-01-01T17:42:23.552Z (about 1 year ago)
- Language: Java
- Size: 16.9 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Uno Coding Challenge
## Tasks
Deploy a microservice using ECS or EKS (AWS).
Microservice should have a single HTTP endpoint. Request should provide two date values:
fromDate (DD.MM.YYYY)
toDate (DD.MM.YYYY)
Response should be the number of days between the two dates (exclusive). Both dates will be greater than 01.01.1900. Dates may be in the future.
The result for each call should be stored in a DynamoDB table.
Please explicitly calculate the number of days between the two dates - do not use any built-in functions.
Example 1
fromDate = 01.01.2020
toDate = 03.01.2020
daysDiff = 1
Example 2
fromDate = 01.01.2020
toDate = 01.01.2030
daysDiff = 3652
## Running DynamoDB locally
Open a command line first, and go to the project root.
```
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
```
Open another command line window and create a new table, if you don't have it,
and run the below command in a single line:
```
aws dynamodb create-table --table-name DatesCalculatorHistory
--attribute-definitions AttributeName=id,AttributeType=S --key-schema AttributeName=id,KeyType=HASH
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 --endpoint-url http://localhost:8000
```
## Build
```
mvn clean package
```
## Run ( command line or using your favorite IDE )
```
mvn spring-boot:run
```
## Docker build and push to ECR
```
aws ecr get-login-password | docker login --username AWS --password-stdin 796202935654.dkr.ecr.us-east-1.amazonaws.com/uno
docker build -t uno .
docker tag uno:latest 796202935654.dkr.ecr.us-east-1.amazonaws.com/uno:latest
docker push 796202935654.dkr.ecr.us-east-1.amazonaws.com/uno:latest
```
## Contributing
I would love to have a chat about the project.
## License
[MIT](https://choosealicense.com/licenses/mit/)