This commit is contained in:
parent
bdb52d9faf
commit
a9de9c3a4c
18
README.md
18
README.md
@ -1,5 +1,7 @@
|
|||||||
# PTV Street Ressource Task
|
# PTV Street Ressource Task
|
||||||
|
|
||||||
|
This task was given as a Take-Home Assignment. The task description is the following:
|
||||||
|
|
||||||
1. Create a service in dotnet. It has a REST API that serves a resource 'street'. A street can be created and deleted. It has a name, a geometry and a capacity (= how many vehicles can use it within a minute).
|
1. Create a service in dotnet. It has a REST API that serves a resource 'street'. A street can be created and deleted. It has a name, a geometry and a capacity (= how many vehicles can use it within a minute).
|
||||||
2. The street data is stored in a Postgres database, and we use EF core to save data there.
|
2. The street data is stored in a Postgres database, and we use EF core to save data there.
|
||||||
3. Implement an endpoint to add a given single point to the geometry of an existing street on either the beginning or the end, whatever fits better.
|
3. Implement an endpoint to add a given single point to the geometry of an existing street on either the beginning or the end, whatever fits better.
|
||||||
@ -68,3 +70,19 @@ The following functions are supported:
|
|||||||
"usePostGIS": bool // Optional, default is 'false'
|
"usePostGIS": bool // Optional, default is 'false'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Notes about the Design
|
||||||
|
|
||||||
|
The application is written in a clean architecture style, seperating between Infrastructure (PostGIS-Db in this case), Domain, Application and the API layer.
|
||||||
|
|
||||||
|
The task was tackled in a test driven development, enforcing the API-behaviour with tests in the `/tests` folder. These tests use a test-database coming from a PostGIS testcontainer with the `testcontainer` package.
|
||||||
|
|
||||||
|
You can run these tests yourself with `dotnet test`.
|
||||||
|
|
||||||
|
## Trying it out yourself
|
||||||
|
|
||||||
|
This repo contains a Dockerfile to build the service as a container yourself. You can then supply a connection string to a PostGIS database via the `CONNECTION_STRING` environment variable. The containers serve their API on the port `8080`, bind it however you see fit.
|
||||||
|
|
||||||
|
Additionally, a functional Docker Compose setup also exists that spins up three such containers together with a function database. These then serve requests on ports `5001`,`5002` and `5003`.
|
||||||
|
|
||||||
|
Additionally, feel free to spin these up as kubernetes services. You still need to upload these images to a Hub and fill in the `image`-field in the k8s manifest though.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user