Travelp is a hotel finder application that displays hotels nearby.
- React/Redux
- TypeScript
- Flask
- Google Places API
- Geolocation API
- Geocoding API
- Go to https://travelp-review.herokuapp.com/
- Turn your browser location on.
Travelp is a web application where users can browse hotels by geolocation or select their destination in a search box.
The Google API was used to collect this data.
If users turn their browser's location on, we make a call to Google Places API with their location's latitude and longitude with the type set to lodging. The radius is set to 5000 meters. We make second call to Places API with the placeid to collect data on the hotel's reviews.
For users who choose to block their location, we collect their latitude and longitude by Geocoding the location they type into a search box. Users type into a search box which displays a dropdown of autocomplete locations by making a call to https://maps.googleapis.com/maps/api/js?key=${api_key}&libraries=places.
Here is the route for collecting hotel data for a user's location if they have their browser's location turned on:
The greatest challenge was...
This app uses the MVC architencture pattern and uses the following technologies:
Model - In this iteration of the app, we do not have databaseGoogle API View - The user interface is rendered by ReactJS. Controller - The middle man, interacts with the user, gets data from the model
- Implement light mode & dark mode
- Add aria
- Add loading spinner to the Enter by Destination option
- Allow users to press enter to search Enter by Destination
-
Clone repo
git clone https://github.com/mimike/mapstest.git .
-
Install dependencies
pipenv install --dev -r dev-requirements.txt && pipenv install -r requirements.txt
-
Create a .env file based on the example with proper settings for your development environment
-
Create a .env file based on the example with proper settings for your development environment
- Install packages
npm install
- Start dev server
npm start
- Note: The Google API was used to collect this data. Create a
.env
file in root dir and add your Google API key asREACT_APP_API_KEY
- Install packages
##Deploy to Heroku
To run the React App in development, checkout the README inside the react-app
directory.
IMPORTANT! If you add any python dependencies to your pipfiles, you'll need to regenerate your requirements.txt before deployment. You can do this by running:
pipenv lock -r > requirements.txt
ALSO IMPORTANT! psycopg2-binary MUST remain a dev dependency because you can't install it on apline-linux. There is a layer in the Dockerfile that will install psycopg2 (not binary) for us.
-
Create a new project on Heroku
-
Install the Heroku CLI
-
Run
heroku login
-
Login to the heroku container registry
heroku container:login
-
Update the
REACT_APP_BASE_URL
variable in the Dockerfile. This should be the full URL of your Heroku app: i.e. "https://flask-react-aa.herokuapp.com" -
Push your docker container to heroku from the root directory of your project. This will build the dockerfile and push the image to your heroku container registry
heroku container:push web -a {NAME_OF_HEROKU_APP}
-
Release your docker container to heroku
heroku container:release web -a {NAME_OF_HEROKU_APP}
-
Under Settings find "Config Vars" and add any additional/secret .env variables.