Backyard Birder is an app for casual bird enthusiasts that enjoy birdwatching, but don't have the best memory. This app provides the user a tool where they can record a bird sighting, lookup a bird by type and color, and view their bird sightings on a map. Backyard Birder is written using the React framework.
To run Backyard Birder locally, create an empty directory and clone the project by running the following command in your terminal:
Once you have the project cloned in your terminal run:
This will install the libraries and other dependencies used by Backyard Birder.
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
Don't forget to run the JSON server in another instance of your terminal so you will have access to the data that Backyard Birder is capturing.
Make sure while in the new terminal window you
cd into the
api directory for Backyard Birder. Once you are there run the following command:
json-server -p 5002 -w birdnerd.json
Markers are added to the map based on the location that the user is adding to their Bird Sighting entry. The google geocoder is able to take the name of that location and look up the longitude and latitude. I then post those coordinates to the database of bird sightings. If the location is updated the geocoder with find the new coordinates and I then patch those to the database.
Markers are displayed on the map by iterating over the bird sighting database, finding the coordinates, filtering to just the logged in user's data, and then rendering them on the map.
The map itself uses the computer's location for the initial center. So if the user is in Chicago that's the center of the map. Likewise, if the user is in Nashville, that will be the center of the map.
To use the Google mapping resources you will need to sign up to recieve a unique API key. You will also need to tell Google a little about the project using your API key.
To learn more about the Google Maps Platform visit The Google Cloud Developer Portal
To learn more about Reactstrap vist their documentation reactstrap
Check out Canva
When using moment.js in react make sure to use the following npm command
npm install --save moment react-moment