Skip to content

Developer getting started guide

Marisa DeMeglio edited this page Feb 26, 2022 · 5 revisions

Pre-requisites

Getting the sources

  1. Make a project folder epubtest.org
  2. Into that folder, clone the database repository (no need to fork it, for the time being)
  3. Fork the main repository and clone it, too

The rest of these instructions assume your local folder structure is:

  • epubtest.org
  • epubtest.org/epubtest-db: the database repo
  • epubtest.org/epubtest-site: the main repo

Another note, the scripts referenced below are set up for bash environments (mac/linux/cygwin).

Running setup

  1. From epubtest.org/epubtest-db/setup-testdb, run the script run-to-init-testdb.sh
  2. From epubtest.org/epubtest-site, run npm install

Testing the setup

  1. From epubtest.org/epubtest-site, run npm test:data
  2. From epubtest.org/epubtest-site, run npm test:ui

If all the tests pass, then the site should run on your machine without issues.

Initialize the test database for development

I forget if the testing steps above leave data in the database or if it gets wiped. So just to be sure (also, for any time you want to reset the data):

From epubtest.org/epubtest.site, run npm run load-test-data

Running the site locally

From epubtest.org/epubtest-site, run npm run dev:testdb

This will start the site with the data from the test database. You can access the site at http://localhost:8000

If you are not logged in, you'll see just the public-facing pages.

If you are logged in as a user, you'll be able to access the user pages "Dashboard" and "Profile". From Dashboard, you may add test results for anything you've been assigned by an admin.

And, if you are logged in as an admin, in addition to the user pages, you'll see the "Admin" page, which lets you manage all the testing that's going on, including creating new testing environments (reading system + assistive tech + OS) and assigning testing tasks to users.

You can use these logins for testing locally:

Making changes

The UI files are in epubtest.org/epubtest-site/src/pages and consist of a series of server-side nunjucks templates plus CSS and a little javascript (esp for the data tables).

You can push any changes by making a branch for your feature or change on your fork, and then submitting a PR.