ggondim / turf-sandbox

Playground environment for Turfjs

Home Page:https://turf-sandbox.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 authorizes 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 env variables in .env.

Make sure you have Netlify CLI installed globally.

Run netlify dev.

About

Playground environment for Turfjs

https://turf-sandbox.netlify.app


Languages

Language:JavaScript 82.0%Language:SCSS 12.3%Language:HTML 5.8%