Skip to content
JavaScript CSS HTML
Branch: master
Clone or download
chrisbrainerd and rmrice Merging in brainerd's fork 🍴 (#14)
* refactored

* refactored more, set up start and build scripts, accidentally added/removed node modules sorryyyyyy

* bunch of build scripting

* fixing broken ref, added css and js endpoints

* updated gitignore

* howtf did suggestion-form become a submodule

* fixed last conflict
Latest commit d4e38d6 Oct 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data Inline Markers Aug 15, 2019
markers Added a fun icon Aug 15, 2019
server
src Serverless (#13) Oct 8, 2019
suggestion-form Merging in brainerd's fork 🍴 (#14) Oct 18, 2019
suggestion-map
.gitignore Merging in brainerd's fork 🍴 (#14) Oct 18, 2019
README.md Merging in brainerd's fork 🍴 (#14) Oct 18, 2019
app.css Update gitignore + css Sep 6, 2019
constants.js Merging in brainerd's fork 🍴 (#14) Oct 18, 2019
index.html Use react map gl + add geocoder component Sep 3, 2019
package-lock.json Merging in brainerd's fork 🍴 (#14) Oct 18, 2019
package.json Merging in brainerd's fork 🍴 (#14) Oct 18, 2019
webpack.config.js Use react map gl + add geocoder component Sep 3, 2019

README.md

50 states map

This map involves a Serverless backend and a react frontend.

The backend is an API Gateway + Lambda that serves out a feature collection of geojson points.

The React frontend renders a map, where you can input points of interest that will be written to the backend and pinned to the map.

Start everything

In a new terminal, do

# make sure you're at the project base, ie ~/50-state-project
$ npm ci
$ npm run install # custom script that will install deps for the three sub-modules
$ npm start

This script will tell you it's starting a development server on port 3000, but in the background it's:

  • starting the suggestion map UI on port 3000
  • starting the suggestion form UI on port 3001
  • starting the server in dev mode on port 5000

Deploy the backend

To deploy, you will need to install Serverless and create an AWS account. Once your account is created, you will need to configure your AWS profile so that your Terminal has access to your AWS credentials.

npm i -g serverless
cd server
sls deploy

If you wish to take down your URL, run sls remove

Alternatively, you can run npm run deploy-server or npm run teardown-server to delpoy and teardown.

Data

Data points (places of interest) exist in server/places.json as a geojson feature collection. The backend writes to this file and serves it out based on the response handed to it from the frontend.

To remove points, you can simple delete features from the geojson and restart the server.

To do

  • polish form UI (remove twitter?)
  • add in "places to eat" place category
You can’t perform that action at this time.