Husky Maps
An educational web app for mapping the world, searching for places, and navigating around Seattle. The app is designed to highlight 3 components: Autocomplete, Priority Queues, and Shortest Paths. Each of these components not only implement features in Husky Maps, but also implement 3 other socially-motivated applications of computing: social genomics, content moderation, and seam carving for content-aware image resizing.
Setup
This project is pre-configured for IntelliJ IDEA.
- Install IntelliJ IDEA.
- Download or clone this project and open it in IntelliJ.
- Run the
MapServerclass to start the web app.
To see the map images, sign up for a free MapBox account to get an access token. Once you have your access token, in the IntelliJ toolbar, select the "MapServer" dropdown, Edit Configurations..., under Environment variables write TOKEN= and then paste your token. Re-run the MapServer class to launch the web app and enjoy the "Ice Cream" map style by Maya Gao.
Deployment
One way to share Java apps is by distributing them as a JAR that bundles all your code together into a single file. This project is already configured to make it easy for you to create a JAR that runs anywhere.
- Open IntelliJ. From the Build menu, select Build Artifacts and build huskymaps.
- Test your JAR by running it from the terminal. In IntelliJ, open the terminal, and run
TOKEN=... java -jar out/artifacts/huskymaps/huskymaps.jar.
To deploy the app to the web, we'll share this JAR file with a web hosting provider such as fly.io. fly.io provides a free web hosting service where anyone can sign-up to deploy their apps to the internet at no cost (no payment method needed).
- Install flyctl and sign up.
- Start (but don't complete!) the process for deploying your application via Dockerfile. For the app name, use the name
huskymaps-with your UW NetID after the dash. When it asks you to deploy, don't do so just yet! - Open the
fly.tomlfile in a text editor and set theforce_httpsoption to false. - Share your MapBox access token with fly as an app secret with the terminal command
fly secrets set TOKEN=.... - Finally, deploy the app with the terminal command
fly deploy.