Code Monkey home page Code Monkey logo

hunting-grounds-web's Introduction

Database of Ukrainian Hunting Grounds

Requirements:

  • Java 19
  • PostgreSQL 15

Installation:

Set next environment variables before application start:

  • PORT - Application port. Default: 8080
  • JDBC_DATABASE_URL - Database name. Default: jdbc:postgresql://localhost:5432/hg
  • JDBC_DATABASE_USERNAME - Database username. Default: postgres
  • JDBC_DATABASE_PASSWORD - Database password. Default: postgres
  • GOOGLE_MAPS_API_KEY - Api Key for an interactive map. Provider: Google

Default users:

Login Password
admin admin
user user

Csv Loader

To import new grounds (also modify or delete) you can use 2 requests

First request can send csv files in request body

curl -X POST '{host}/api/batch' \
-F 'file=@/path_to_batch_1.csv' \
-F 'file=@/path_to_batch_2.csv'

Second request will take csv files for processing from directory {project_root}/batch/to_process/

curl -X POST '{host}/api/batchJob'

Filename pattern should be next: .*.csv

Csv file structure

First line is header. Second and others - grounds data.

Header Field Data Type Required
operation Enum
Values: CREATE, UPDATE, DELETE
yes
alias String yes
name String yes - for CREATE operation
no - for other operations
area BigDecimal no
kmlPath String no
description String no
city String no
street String no
zipCode String no
latitude BigDecimal no
longitude BigDecimal no
info String no
countryId Long yes - for CREATE operation
no - for other operations
regionId Long yes - for CREATE operation
no - for other operations
subRegionId Long no

Example:

operation,alias,name,area,kmlPath,description,city,street,zipCode,latitude,longitude,info,countryId,regionId,subRegionId
CREATE,hunting-ground-alias,"Hunting Ground Name",50000,/path_to_kml_file.kml,Hunting ground description,City,Street and Building number,15000,50.123456,30.123456,Additional address info,1,2,3
UPDATE,hunting-ground-alias,"Hunting Ground Name",50000,/path_to_kml_file.kml,Hunting ground description,City,Street and Building number,15000,50.123456,30.123456,Additional address info,1,2,3
DELETE,hunting-ground-alias,,,,,,,,,,,,,

Successfully processed csv files will be moved to the directory {project_root}/batch/processed/

Failed files will stay in folders {project_root}/batch/to_process/ and {project_root}/batch/web/

hunting-grounds-web's People

Contributors

vlad-yavorsky avatar

Stargazers

Marius avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.