EPUB reading experience testing: epubtest.org
This is a website and database to record accessibility evaluations of EPUB reading systems.
Developer getting started guide
Back end: Express + nunjucks + graphql queries
Front end: static HTML + web component enhanced tables
Back end's back end: Postgresql database and a postgraphile db api (graphql)
src
actions
Multipart processes, such as:
epub-parser
Parse a test book into a JSON structure
l10n
Experimental
pages
Entire front-end
books
: test books available for downloadcss
: stylesheetsimages
js
: front-end js, mostly data table stufftemplates
: nunjucks templatesqueries
GraphQL queries. Of note is queries/crudGenerator.js
, which generates basic CRUD operation queries, given a few parameters.
routes
admin.js
: GET admin pagesadmin-forms.js
: POST routes for admin formspublic.js
: GET public pagespublic-forms.js
: POST routes for public forms (login, forgot password)user.js
: GET user pages. Note that some (set password, accept invitation) are restricted by token and will not display unless the token in the query string is correct.user-forms.js
: POST routes for user formsdatabase.js
: sends a query to the database api serveremails.js
: Text for emails that get sent to useresmiddleware.js
: Various custom middlewareutils.js
: Various utility functionsdisplayUtils.js
: Largely redundant display utilities which are often duplicates of front-end js table logic. Used here for creating static noscript tables.test
Workflow tests; run with mocha.
Postgraphile does not support column-level grants, which is why there is a separate logins vs users table. Otherwise the login information would be theoretically visible to anyone who could view the user information (which, some of it could be viewable, for example, if the user has chosen to get credited for their work, then the results page must display their creditAs
value, so their credits must be publicly accessible).
Since we are controlling database access via the server, no outside querying is allowed, and the pages are tightly controlled. To be forward-thinking, however, the database API was setup with the possibility to one day have more client-side querying supported, therefore security tokens, row level security, and design decisions such as what's described above are in place.
Note that one exception to this lies with the use of "private link" tokens. The server (express layer) verifies specific resource access permissions; the database layer gives blanket (table(s)-wide) read-only permission. If we ever created a public database endpoint, we would have to keep this in mind.
Another exception is the "create temporary token" function, which is right now only called by the server but again, if we ever created a public database endpoint, access to this this should be restricted.
Token-based authentication