Skip to content

Latest commit

 

History

History
85 lines (50 loc) · 2.92 KB

DEVELOPMENT.md

File metadata and controls

85 lines (50 loc) · 2.92 KB

👩🏽‍💻 JSON Hero Local Development Guide

Welcome to JSON Hero development and thanks for being here! If you'd like to run JSON Hero locally, please use the following guide to get started. If you have any issues with this guide please feel free to email me at [email protected] or come leave a message in our open Discord Channel.

For more information about contributing to JSON Hero please see the Contributing doc.

Install dependencies

Before you can run JSON Hero locally, you will need to install the following dependencies on your machine:

Git

You most likely already have git installed on your machine, but if not, you can install it from the Git website.

Node.js 16

Even though JSON Hero runs on Cloudflare Workers, which isn't a Node.js environment, you will still need Node.js 16 to run it locally. The recommended way to install Node.js is to download a pre-built package from the Node.js website

NPM

If you install Node.js through the above link, you should also have NPM automatically installed as well. To make sure, run the following command in your preferred Terminal:

npm ---version

Fork JSON Hero on GitHub (optional)

To contribute code to JSON Hero, you should first create a fork of the jsonhero-web repository on GitHub. Follow these instructions on repository forking.

Clone the repo

In your terminal, issue the following command to clone the repository to your local machine:

git clone https://github.com/triggerdotdev/jsonhero-web.git

Or if you've forked the repository:

git clone https://github.com/<github username>/jsonhero-web.git

Then cd into the repository:

cd jsonhero-web

Prepare the repo

First, install npm dependencies:

npm install

Run the following command to create the .env file with a new SESSION_SECRET environment variable:

echo "SESSION_SECRET=$(openssl rand -hex 32)" > .env

Then, run npm run build or npm run dev to build.

Start the development server:

npm start

You should now be able to access your local JSON Hero server on localhost:8787

Note JSON documents created locally are not persisted across server restarts

Previewing URLs

We currently use Peekalink to power some of the Preview URL functionality. This feature is disabled unless there is a valid PEEKALINK_API_KEY environment variable set in your .env file created above.

If you'd like to enable this functionality locally, signup for Peekalink and set the PEEKALINK_API_KEY

Deploying to Cloudflare

Coming Soon