Installing h in a development environment

The code for the web service and API lives in a Git repo named h. This page will walk you through getting this code running in a local development environment.

See also

See also

Development environment troubleshooting if you run into any problems during installation

You will need

Before installing your development environment you’ll need to install each of these prerequisites:

Clone the Git repo

git clone

This will download the code into an h directory in your current working directory. You need to be in the h directory from the remainder of the installation process:

cd h

Run the services with Docker Compose

Start the services that h requires using Docker Compose:

make services

Create the development data and settings

Create the database contents and environment variable settings needed to get h working nicely with your local development instances of the rest of the Hypothesis apps:

make devdata

See also

make devdata requires you to have a git SSH key set up that has access to the private repo. Otherwise it’ll crash. If you can’t use make devdata (for example because you aren’t a Hypothesis team member and don’t have access to this repo, or because you’re setting up a production instance) then see Manually setting up the Hypothesis client integration.

Start the development server

make dev

The first time you run make dev it might take a while to start because it’ll need to install the application dependencies and build the client assets.

This will start the server on port 5000 (http://localhost:5000), reload the application whenever changes are made to the source code, and restart it should it crash for some reason.

That’s it! You’ve finished setting up your h development environment. Run make help to see all the commands that’re available for running the tests, linting, code formatting, Python and SQL shells, etc.