Skip to content

pvgomes/beer-delivery

Repository files navigation

Beer Delivery

We are a delivery app which takes care to delivery beers quickly and to do it we must find Points of Sale closest to our customers

Build Status

UbiquitousLanguage

Beer Delivery = Our app name

PDV = Point-of-sale

Set up environment

Install Docker and Docker-compose

docker-compose up -d

Tests (Unit and Integration)

docker exec -it app npm test

Endpoints

Search

curl -X GET 'http://127.0.0.1/api/search?lng=-46.474983&lat=-23.610245'

Create PDV

curl -X POST \
  http://127.0.0.1/api/pdvs/ \
  -H 'Content-Type: application/json' \
  -d '{
	"tradingName": "Adega do Java",
	"ownerName": "Joaquina Jalenta",
	"document": "04.210.017/0001-09",
	"coverageArea": {
	 "type": "MultiPolygon",
	 "coordinates": [
	    [
	       [
	          [
	             -8.164418,
	             -70.351778
	          ]
	       ]
	    ]
	 ]
	},
	"address": {
	 "type": "Point",
	 "coordinates": [
	    -8.164418,
	    -70.351778
	 ]
	}
}'

Get By Id

curl -X GET http://127.0.0.1/api/pdvs/{ID}

Deployment

WIP The idea here is to use AWS Lambda with API Gateway, thats why we use serverless framework

  • Install serverless framework with npm
  • Make sure that your aws credentials is defined
  • Update the config to your MongoDB place

Deploy

sls deploy

About

a beer delivery api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published