A little while ago I explained how to take the Stacks project and convert it to a bunch of small HTML files, which is the first step in setting up the new website for the Stacks project. In this post I'll explain the next two steps: creating the database behind the website, and setting up the website. For now, this part is not as streamlined as we'd want it to be, but in any case, it's not too hard.

I will assume you have performed plasTeX step with the most recent version of the Gerby renderer.

## Instructions on creating the database

To get Gerby website and the toolset:

1. run git clone https://github.com/pbelmans/gerby-website.git

2. install the following Python libraries: flask, peewee, pybtex (and apply this patch if you want to be exact), flask_profiler (or just delete this code from gerby/gerby.py), feedparser

3. inside the directory gerby/tools/ we'll link to the output (using ln -s) from the first step as follows:

• create a soft link to the output directory tags/tmp/book/ inside your clone of the Stacks project, named stacks
• create a soft link to the tags file tags/tags inside your clone of the Stacks project, named stacks.tags
• create a soft link to the file  tags/tmp/book.paux, named stacks.paux
4. run python3 update.py (sit back and relax, this takes a bit, but not as long as plasTeX)

5. create a soft link in gerby/ to gerby/tools/stacks.sqlite, named stacks.sqlite

All these filenames are governed by the file gerby/config.py, and can be changed. Eventually I should make a better configuration system.

## Instructions on serving the website

The following instructions are for running a local copy of the new Stacks project website. You could use this for having a local copy of the Stacks project (with the caveat that right now you'll need an internet connection for the JavaScript libraries). Eventually we'll make a standalone version, for which you don't need an internet connection.

Until then, it suffices to do the following:

1. set FLASK_APP=gerby in your path (in bash this is done by export FLASK_APP=gerby)

2. inside the directory gerby/ run flask run

3. open localhost:5000 in your browser

That's it. Enjoy! As you can tell if you have successfully performed these steps, it won't take too long (something on the order of 2 months) until we will use the new system for the actual Stacks project website. Until then, please give suggestions on the beta version.

If you are interested in running a Stacks-project like system for your own project, please get in touch with me.