Skip to content
Working on a new version of Brainspell (an open-source platform for neuroimaging literature) to make a public JSON API that collaborators can contribute to, switch out the stack for better scalability, and provide statistical features to better conduct meta-analyses.
PLpgSQL Python HTML JavaScript CSS Jupyter Notebook
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status

Working on a new version of Brainspell. This platform allows users to curate neuroimaging literature, and version-control their meta-analyses on GitHub.

Clients can make requests to the JSON API directly, or access Brainspell through the web interface. A running Heroku instance is available at

To view a list of all JSON API endpoints, take a look at If you're unsure about the parameters for an endpoint, add /help to the end of the URL (e.g., the documentation for is available at Alternatively, you can try our API via Swagger.

Running Brainspell

To run Brainspell locally:

  1. Clone the Git repo with git clone
  2. Install Postgres (if not already installed). If you have Homebrew installed, you can use brew install postgres.
  3. Make sure that you're using Python 3.5.
  4. Enter the repo with cd brainspell-neo/, and install the Python dependencies with pip install -r requirements.txt.

Now you can run Brainspell with python3 brainspell/ Brainspell should be running at http://localhost:5000.

Having difficulty getting Brainspell running? Install Conda, and create an environment for Python 3.5.

Running Brainspell with Docker

First, make sure that you have Docker installed. Then:

  1. Navigate into the Brainspell directory. (cd brainspell-neo/)
  2. Build the Docker image with docker build -t brainspell .
  3. Create the Docker container and run with docker run --name brainspell -ti -p 5000:5000 brainspell

Brainspell should be running at http://localhost:5000/. The next time that you want to run the Docker container, simply execute docker start -a brainspell, and stop the Docker container with docker stop brainspell.

Running Brainspell on a Server

In this section, we'll describe the steps required to start Brainspell automatically on boot, and to monitor the Brainspell process with Supervisor so that it doesn't get killed.

  1. First, enter the Brainspell directory with cd brainspell-neo/.

  2. Next, check that you can generate a valid supervisor.conf file with python3 server/ `which python` `pwd` .

  3. If the previous command worked, then execute the setup script with ./ Now, Supervisor should be installed on your computer, and there should be a valid .conf file in server/supervisor.conf.

  4. Now we need to set Supervisor to automatically launch on startup.

    • If you're on macOS, you can do so by adding a .plist file to launchd.
      • First, execute python3 server/ `which supervisord` `pwd` > ~/Library/LaunchAgents/brainspell.plist.
      • Then, launch the process with launchctl load ~/Library/LaunchAgents/brainspell.plist. Brainspell will automatically be running at port 5000 on startup.
      • If you use this script, you won’t be able to kill supervisord, since launchd will keep it alive. (You can make it so that you can kill supervisord by modifying the script, and removing the “KeepAlive” key in .plist file text.)
    • If you're on Linux, you can use init.d.
      • First, make sure that you have an init.d folder at /etc/init.d/.
      • Next, execute:
        • sudo python3 server/ `which supervisord` `pwd` > /etc/init.d/
        • sudo chmod +x /etc/init.d/
        • sudo update-rc.d defaults
  5. Now Brainspell should be running at port 5000, it should automatically start, and it should reboot automatically if an error occurs. Here’s an article from Namecheap on mapping that port to a domain name, once the port is publicly accessible from your server’s IP.

Code Organization

brainspell/ runs the Tornado main event loop.
Handlers go in one of three files:

  1., which contains JSON API endpoints that do not make GitHub API requests,
  2., which contains all handlers that render Tornado HTML templates, or
  3., which contains all API endpoints and handlers that communicate with GitHub.

Our naming convention is to use [*]EndpointHandler for API endpoint handlers, and [*]Handler for web interface handlers.

brainspell/ contains helper functions for adding articles to the database.
brainspell/ is our abstract handler, which provides various helper functions. All handlers should subclass BaseHandler.
brainspell/ is a module for deploying to a remote server using Git.
brainspell/ is for our ORM, PeeWee, which lets us treat our database like a Python object.
brainspell/ contains helper functions for searching articles in the database.
brainspell/ is our suite of continuous integration tests.
brainspell/ contains helper functions for accessing and mutating user information.
brainspell/ contains a WebSocket that allows developers to connect to the API using the WebSockets protocol.
brainspell/static/ contains the HTML, CSS, images, fonts, and Javascript code for the website.

Our official Postgres database is hosted on AWS, but we have a static database available on Heroku. The full database is available in the database_dumps folder.

Former website for Brainspell:

You can’t perform that action at this time.