Welcome to JASP stats modules web app!
A web application hosted at https://jasp-stats-modules.github.io/modules-app/ that allows you to search/filter all the available JASP modules and install them.
The web application is designed to be opened from inside JASP desktop application, but it can also be used as a standalone web application.
The JASP desktop application can tell the web application which version/architecture it is and which modules are installed by using search parameters (?key=val
) in the URL.
- v: the version of the JASP desktop application for example
0.95.0
- a: the architecture of the JASP desktop application for example
Windows_x86-64
- i: installed modules. A JSON object with the module names as keys and their versions as values. The object has to be URL encoded. For example,
{"22jaspEquivalenceTTests":"0.95.0","22jaspTTests":"0.94.0"}
becomes%7B%2222jaspEquivalenceTTests%22%3A%220.95.0%22%2C%2222jaspTTests%22%3A%220.94.0%22%7D
. - p: show pre-releases initially. Use
1
to show pre-releases and use0
to hide them initially. - c: URL for the catalog aka index.json.
When not set uses
index.json
(public/index.json
in local development or on deployed site useshttps://jasp-stats-modules.github.io/modules-app/index.json
). If URL is not a relative path aka other server then make sure correct CORS headers are returned on server that hosts index.json. - t: Theme. Use
dark
for dark theme,light
for light theme, andsystem
to match system theme (default).
A full URL could look like https://jasp-stats-modules.github.io/modules-app/?a=Windows_x86-64&v=0.95.0&i=%7B%22jaspEquivalenceTTests%22%3A%220.95.0%22%2C%22jaspTTests%22%3A%220.94.0%22%7D&p=0.
The list of modules can be updated by running the GitHub workflow at https://github.com/jasp-stats-modules/modules-app/actions/workflows/deploy.yml . Use the "Run workflow" button to trigger the workflow manually.
The web application is a single page application (SPA) with the following characteristics:
- Built with React and TypeScript
- Uses Vite as the build tool
- Uses pnpm as the package manager
- Uses Tailwind CSS for styling
- Uses TanStack Router for routing, with an initial file-based router setup in
src/routes
- Uses biome for linting and formatting
- Fetches data from the GitHub GraphQL API to get available JASP modules and their release assets
To get a list of available JASP modules, it does the following with the help of the src/scrape.ts
script:
- Fetches the git submodules of the https://github.com/jasp-stats-modules/modules-registry repository.
- the directory in which a submodule is located is the channel
- For each submodule fetches its releases
- Fetches the release data, paged per 100 repositories using GitHub GraphQL API
- Filter the release assets ending with
.JASPModule
extension - Looks in release description for the JASP version range the module is compatible with. The version range is specified in front matter header as for example:
--- jasp: '>=0.95.0' ---
- Split releases into latest release for each JASP version range and latest pre release.
- Saves data in
src/index.json
for the web application to use
To run this application:
pnpm install
# Scrape a list of JASP module and their release assets from GitHub and save as src/index.json
export GITHUB_TOKEN=<your personal fine grained access token, only access to public repositories is needed and no other permissions>
pnpm scrape
pnpm start
Application will be running at http://localhost:3000 (unless stated otherwise).
To build run:
pnpm scrape
pnpm build
We use Vitest for testing. You can run the tests with:
pnpm test
Can be typechecked with:
pnpm typecheck
Can be formatted and linted with:
pnpm check
Contributions are welcome! Please read the contributing guidelines for more information.