Travel planner server
please follow official mongodb tutorial: https://docs.mongodb.com/manual/installation/#mongodb-community-edition-installation-tutorials
Recommend using Intellij: https://www.jetbrains.com/idea/download
Follow the installation guide to setup and set Java SDK (Recommend 1.8 version)
After cloning the repo, open the project with Intellij and add maven framework support:
- Right click root folder (travel-planner-server)
- Select the second item: Add Framework support
- In the open window, select Maven option from the left tab and click Ok.
After that, install Lombok plugin:
- Right click File Tab in your Intellij menu and click Setting (For Mac User click Intellij IDEA icon and select preference)
- In the left tab, find Plugins and click
- Search for Lombok and click Install button
- Restart your Intellij
- Get a Google Map API key: https://developers.google.com/maps/documentation/javascript/get-api-key
- Enable Place API and Distance Matrix API services.
Follow official tutorial: https://www.jetbrains.com/help/objc/add-environment-variables-and-program-arguments.html#add-environment-variables
Add "GOOGLE_MAP_API_KEY:{your google map API key}"
- First of all, run your local mongo database in default setting(localhost: 27017). Please refer to previous link guide to run your database: https://docs.mongodb.com/manual/installation/#mongodb-community-edition-installation-tutorials
- You can run through your IDE (should add your google map api key as environment variable)
- Run through your terminal under your project root:
// export your Google Map API key first
export GOOGLE_MAP_API_KEY={your google map API key}
// Build your project
mvn install
// Run your project locally
java -jar target/travelplanner_server-0.0.1-SNAPSHOT.jar
// Run your project remotely (in remote machine)
java -jar -Dspring.profiles.active=prod target/travelplanner_server-0.0.1-SNAPSHOT.jar