Interview assignment for CleverFarm.
Full text of assignment is available here.
PostgreSQL
database withPostGis
extension installed- Local / Remote (Amazon RDS) / Docker container (postgis/postgis)
Maven
for building applicationJRE
for running application- (Optional)
Docker
for running integration tests
- Clone this repository and access the application directory
git clone https://gitlab.com/njuro/farm-assignment.git FarmAssignment
cd FarmAssignment
- Open file
src/main/resources/application.properties
and edit following properties to match your database:spring.datasource.url
- database connection url (includes name of the database)spring.datasource.username
- database userspring.datasource.password
- password for database user
- Build the application with Maven
mvn clean install
- (Optional) skip tests by adding
-DskipTests
parameter
- Launch application
java -jar target/*.jar
- Open your browser and head to
http://localhost:8081
- You will be redirected to
/login
page and log in- Username:
user
- Password:
password
- Username:
- You will be redirected to
/swagger-ui/index.html
where you can try different API endpoints. Sample farms are inserted to database at first launch - Alternatively you can import endpoint collection into Postman
- To log out head to
/logout
page
- First run of integration tests may take a bit longer, as
postgis
docker image must be downloaded if it is not present in the system already - Several sample farms are inserted to database at first launch
- Field borders are represented as WKT
- To generate WKT from map area you can use this utility - https://arthur-e.github.io/Wicket/sandbox-gmaps3.html
- Each farm belongs to one country (represented by ISO3 code). Fields of this farm must be located entirely within that country and cannot overlap with other fields