Taking you back through the history of National Parks. Built using Svelte and ZEIT Now API routes.
When working with Twin Pines it is important to note a few required environment variables:
NPS_API_KEY
: National Parks Service API key, required for API work. This is not required for the mock API/api/mock/*
LOCATIONIQ_API_KEY
: required for reverse geocoding service/api/service/reverse-geocode
AUTH0_DOMAIN
: required for Auth0 authentication serviceAUTH0_CLIENT_ID
: required for Auth0 authentication serviceAUTH0_CLIENT_SECRET
: required for Auth0 authentication service
- Clone or download this repo
- Rename
.env.sample
to.env
- populate fields with your secrets
- Install dependencies with
yarn
oryarn install
- Run the app's dev server with
yarn dev
- Run the ZEIT Now dev server to enable API routes (must be a part of TwinPines Now Team)
- Install ZEIT Now CLI globally with
yarn global add now
- Sign up for a ZEIT Now account and login locally
- Set up the Now project with
now
- Step through the prompts, scoping
Twin Pines
- It will ask to link to existing project, select
y
- Link to existing twin pines (this will give necessary configuration)
- It will ask to link to existing project, select
- Run the Now development server with
now dev
- Install ZEIT Now CLI globally with
- set up IndexedDB interface
- design client-based caching mechanism for NPS API calls
- most likely stringified JSON in localStorage
- look into indexeddb in case this data exceeds 10MB
- this will help cut down on API usage, especially since the data is relatively static except for a few endpoints:
- alerts
- Add Fauna for user settings
- store settings in indexeddb for intermediate