The repository for the Skoda tender Connectivity Service Development
For database access these environment variables have to be set:
aws configure
and use the AWS secret key and key ID to authenticate. When prompted for the region name use eu-central-1
.aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 205930623194.dkr.ecr.eu-central-1.amazonaws.com
The output will look like this:
WARNING! Your password will be stored unencrypted in /home/<user>/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credential-stores
Login Succeeded
sudo docker build -t 205930623194.dkr.ecr.eu-central-1.amazonaws.com/connectivity-service-development/backend:latest .
sudo docker push 205930623194.dkr.ecr.eu-central-1.amazonaws.com/connectivity-service-development/backend:latest
You can use the following command to run the image locally:
sudo docker run --rm -it -p 8080:8080 205930623194.dkr.ecr.eu-central-1.amazonaws.com/connectivity-service-development/backend:latest
When the container is started, you can send HTTP requests to the container using cURL or a tool like Postman. Example:
curl http://localhost:8080/alive
OK%
The backend offers 3 end points as described below.
GET http://localhost:8080/alive
Returns "OK" and HTTP 200 if the service is up and running.
GET http://localhost:8080/products
Gives the list of products stored within the database as JSON without the image set (HTTP 200). The sort order is by product id to be able to enforce a particular order, e.g. by importance. In future there could be an extra id for this.
The result looks like this:
[
{
"id": 3,
"category": "Škoda Connect Dienste",
"name": "Care Connect - Fernzugriff ",
"description": "Um noch mehr Komfort zu genießen ist Care Connect - Remote Access genau das Richtige. Ihre persönlichen Assistenten ...",
"image": null
},
{
"id": 4,
"category": "Škoda Connect Dienste",
"name": "Infotainment Online",
"description": "Mit den Infotainment Online Diensten von Škoda Connect sind Sie unterwegs besser informiert. Suchen Sie nach spannenden Zielen ...",
"image": null
}
...
]
GET http://localhost:8080/products/image/{id}
This end point retrieves the PNG image for a given product id (HTTP 200). If there is no image or the product does not exist HTTP 404 is returned.
The database is named "csd" and contains one products table:
CREATE TABLE `product` (
`id` bigint NOT NULL,
`category` varchar(255) DEFAULT NULL,
`description` varchar(10000) DEFAULT NULL,
`image` longblob,
`name` varchar(2000) DEFAULT NULL,
PRIMARY KEY (`id`)
)
This table will be created automatically by JPA if the table does not exist when starting the application.
Due to App Store policies, we are unable to offer a bundle for iOS at this time. Please use XCode to run the app in emulation mode.