This work is part of a challenge.
The intention is to create an application where the user can search and obtain the address data along with the latitude and longitude through the Google Maps API, register it in a database and do research by displaying the markers on the map with the name, cnpj and address of the clinic
- REST API backend is powered by Express.js, Node.js with Typescript and PostgreSQL database
- The front-end is developed with React.js library
- Docker is required to run the application (Note: My docker version - 4.5.1)
- Add a google maps api key:
app > .env | REACT_APP_GOOGLE_MAPS_APIKEY=apikey
- To start go to the project root directory and run the following command in your terminal
docker-compose up -d
- After completing open the browser and access:
localhost:3000
Insert a new clinic - HTTP /POST
- cURL
curl --location --request POST 'localhost:3001/api/clinics' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Clinica vida",
"cnpj": "46563575000113",
"address": {
"place": "Avenida Dois de Abril",
"number": "208",
"district": "Urupa",
"city": "Ji-Parana",
"postalCode": "76900213",
"state": "Roraima",
"country": "Brasil",
"lat": -10.867678,
"lng": -61.970721
}
}'
Get all clinic - HTTP /GET
- cURL
curl --location --request GET 'localhost:3001/api/clinics'