Skip to content

stebogit/turf-sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netlify Status

Turf Sandbox

Playground environment allowing users to try out Turf's features and create (hopefully) easy to debug examples for issues they encountered using any Turf package.
The app is currently hosted at https://turf-sandbox.netlify.app.

Usage

Write your code on the editor and return a valid GeoJSON object, it will be rendered on the map on the right.

TODOs

  • Add package selection We'll just use the latest version from https://npmcdn.com/@turf/turf

  • Allow the user to save code snippets and create links to share the examples

  • Add instructions on how to use the tool

  • Evaluate strategies to improve system security

Credits

This project has been inspired by Try Carbon (alt text), the test environment for Carbon PHP.

The following articles and projects were very useful for the development of this project:

Login process

GitHub

Process flow Steps:

  • Register the app on GitHub to obtain the ClientID and ClientSecret for the app
  • From the browser the client makes a request to the https://github.com/login/oauth/authorize with the appropriate app's ClientID
  • The above operation allows the user to authorize the client to access the user's GitHub data and redirects the user to the callback URL we defined when registering app
  • Now (here on the server) with the use of the obtained RequestToken in addition to ClientID and ClientSecret we call https://github.com/login/oauth/access_token to request an API AccessToken
  • If all the values we've provided are valid, the API will respond with the AccessToken for client to make authorised requests to the GitHub API, which we store in the Local Storage.

Development

  • Set your local env variables in .env

    if the production environment is linked the environment variables will be pulled from the production server; any variable in .env overrides the production value

  • Make sure you have Netlify CLI installed globally.

  • Run netlify dev (or npm run dev) will serve the project on a webpack dev server (also execute the serve script)

  • netlify build will execute the build command (the same it will in production) locally

    this requires to run netlify link once, which will link the service to your repo (also creating a .netlify folder in the project root)

About

Playground environment for Turfjs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published