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.
Write your code on the editor and return a valid GeoJSON object, it will be rendered on the map on the right.
-
Add package selectionWe'll just use the latest version fromhttps://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
This project has been inspired by Try Carbon (), the test environment for Carbon PHP.
The following articles and projects were very useful for the development of this project:
- Build your own interactive JavaScript playground
- How to Write Your Own JSFiddle
- Best practices for building your own live paste bin
- Register the app on GitHub to obtain the
ClientID
andClientSecret
for the app - From the browser the client makes a request to the
https://github.com/login/oauth/authorize
with the appropriate app'sClientID
- 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 toClientID
andClientSecret
we callhttps://github.com/login/oauth/access_token
to request an APIAccessToken
- 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.
-
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
(ornpm run dev
) will serve the project on a webpack dev server (also execute theserve
script) -
netlify build
will execute the build command (the same it will in production) locallythis requires to run
netlify link
once, which will link the service to your repo (also creating a.netlify
folder in the project root)