Ruby app backed by a Postgres/Postgis database stored in a Docker Container.
Docker
Docker-Compose
PSQL
Ruby
Rack
-
POST
- Accepts GeoJSON point(s) to be inserted into a database table params: Array of GeoJSON Point objects or Geometry collection -
GET
- Responds w/GeoJSON point(s) within a radius around a point params: GeoJSON Point and integer radius in feet/meters -
GET
- Responds w/GeoJSON point(s) within a geographical polygon params: GeoJSON Polygon with no holes
git clone https://github.com/luisgcenci/ruby-app-buspatrol.git
bundle install
export DB_ADDRESS=localhost
export DB_PORT=5432
export DB_NAME=gps_collector
export DB_USER=postgres
export DB_PASSWORD=mudeiasenha
docker-compose up -d db
docker-compose run db bash
psql --host=db --username=postgres --dbname=gps_collector
CREATE TABLE GEOMETRIES(
geometries_id SERIAL,
geometries_type varchar(30) not null,
geometries_geom geometry not null
);
rubocop
ruby ./test/db_test.rb
ruby ./test/points_test.rb
ruby app.rb
cd doc
start index.html