Code Monkey home page Code Monkey logo

adventure-pass-locator's Introduction

Adventure Pass Locator

Description

The government forest service website does not provide a way to find the nearest forest recreation pass vendor. This web app provides a way to find recreation pass vendors near you.

Demo

Features

  • Mobile first, responsive design

Tech Stack

  • React

APIs

Changelog

To do

  • Figure out why Prettier doesn't work on js files
  • Create vertex, graph class, vertices, graphs
  • Sorting algorithm: Timsort, Heapsort, Mergesort, Quicksort
  • Show 25 locations at a time, with arrows that allow users to see next 25.
  • Add type annotation
  • Add Redux
  • Add tests
  • Option to sort alphabetically, by zipcode and city
  • Show map with markers for vendors
  • Create classes to package methods with data

LATER

  • Create my own zipcode and latitude/longitude database
  • Create a relational database
  • Figure out Google Maps Distance Matrix API / Bing maps API
  • v. 1.0 - straight line distance between two zip codes
  • v. 2.0 - route distance between two zip codes
  • Scrape website with Python and create JSON file

Setup

Move into project folder

cd adventure-pass-setup

Install dependendies

npm install

Run project

npm run dev

Build static site

npm run build

Preview build

npm run preview

Attribution

This app was scaffolded with Vite and the react-ts template preset.

The adventure pass vendor data was obtained by saving a webpage as an html file and parsing it.

NOTES

How to use fetch() to put data into Context?

One way is to define a function that calls fetch() inside of Provider. Then call the fetch function inside of useEffect's callback function. useEffect's callback function is where we perform actions with side effects. By default, useEffect's callback function runs after every render. Limit re-renders by providing a dependency array. An empty dependency array means the side effect is run only after first render.

How to use Context?

  1. Import React, useContext and any other hooks you'll use.
  2. Create a Context object with createContext(). It will have a Provider property.
  3. Define your Provider function component.
  4. Use useState to create a state variable and stateSetter function.
  5. Return a HOC Context.Provider component that wraps around its props.children.
  6. Pass the Context.Provider a value prop that holds an object of "global" data.
  7. Export Context object and Provider function component.
  8. In your entry file (index.js, main.js), import your Provider function component.
  9. Call it and wrap it around your app. Don't forget this step.
  10. Use data in context by calling useContext(Context) and destructuring the value object in your function component.

Refresh page after form submit / update table after form submit?

React automatically re-renders when state changes.

Fetch/get text data with

  • html string in js file
  • local html file
  • url

adventure-pass-locator's People

Contributors

eunicode avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.