An useful solution to find the pharmacies closest to you
For now available only for Campania region.
Step to follow:
-
Clone the project as follow:
git clone git@github.com:gsaraceno92/pharmacies_finder.git
-
Copy .env.example into .env
Note: edit docker .env file only if build fail; that probably means that your user id (in ubuntu system) is different from this one. In this case update with your own id.
These are the instructions to follow to set up the project on your local environment.
-
Build the Docker image
docker-compose up --build -d
-
Use
docker image ls
anddocker container ls
(ordocker ps
) to see your images and the running containers -
Enter into the container with
docker exec -it finder_pharmacies bash
Once created, the containers can be started anytime with the following command:
`docker-compose -f up -d`
To stop the containers, use instead:
`docker-compose stop`
Sometimes Flask application could not reload automatically the changes (since the binding volume e the work type used to run the app); in this case just restart the container with docker-compose restart
.
Note: the above commands must be used in the same folder of the project. If you want to use the commands anywhere use -f to specify the docker-compose file position, e.g.:
`docker-compose -f ./docker-compose.yml up -d`
Run the files inside tests directory as follow:
`docker exec -it finder_pharmacies python3 tests/test_pharmacy.py`
The app will run through http://localhost:5000. In particular you can visit http://localhost:5000/api/browse; here can be used the JSON-RPC method.
Use the method SearchNearestPharmacy to retrieve the nearest position to the location set by latitude
and longituted
in currentLocation
parameter.
Define the range
(in meters) in which you want to search and set the result size with the limit
.