https://github.com/johnlees/poppunk-web
Web version of PopPUNK
https://github.com/johnlees/poppunk-web
epidemiology frontend poppunk sketching
Last synced: 10 months ago
JSON representation
Web version of PopPUNK
- Host: GitHub
- URL: https://github.com/johnlees/poppunk-web
- Owner: johnlees
- License: apache-2.0
- Created: 2020-09-17T15:21:05.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-23T11:02:26.000Z (over 3 years ago)
- Last Synced: 2023-08-15T00:30:10.608Z (almost 3 years ago)
- Topics: epidemiology, frontend, poppunk, sketching
- Language: JavaScript
- Homepage: https://web.poppunk.net
- Size: 5.36 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PopPUNK-web

## NOTICE: currently down
PopPUNK-web is temporarily down while we work on an updated and better supported version (beebop).
## Introduction
This repository holds the source code for the PopPUNK-web application. PopPUNK-web makes use of WebAssembly for in-browser, client-side k-mer sketching, and a Python backend for query assignment and generation of visualisations. As we make use of several languages in a single pipeline, there are a few considerations for development purposes.
## Testing
To locally host PopPUNK-web in development mode at http://localhost:3000, run:
```
git clone https://github.com/johnlees/PopPUNK-web
cd PopPUNK-web
npm install
npm start
```
To test the backend, ensure PopPUNK is installed (https://github.com/johnlees/PopPUNK), open a second terminal and run the Python API using:
```
git clone https://github.com/johnlees/PopPUNK
cd PopPUNK
python poppunk_api-runner.py
```
This will run a development server at http://localhost:5000. As this port (5000) is different to that running the frontend (3000), you must specify a proxy in PopPUNK-web so the frontend and backend can communicate. This can be done by adding the following line to ```package.json```:
```
"proxy": "http://localhost:5000"
```
## Compiling the WebAssembly
The sketching code is based in C++ and can be found at https://github.com/johnlees/pp-sketchlib. To compile the files necessary for web sketching, you will need to download and activate an emscripten sdk environment (https://emscripten.org/index.html), then compile. This can be done by running:
```
# Get the emsdk and pp-sketchlib repos
git clone https://github.com/emscripten-core/emsdk.git
git clone https://github.com/johnlees/pp-sketchlib
source ./emsdk/emsdk_env.sh
./emsdk/emsdk activate latest
cd pp-sketchlib/src && make web
```
This will build “web_sketch.js” and “web_sketch.wasm” in pp-sketchlib/src/web. These files can then be read by PopPUNK-web when placed in the public directory of the PopPUNK-web bundle.
## Create react app docs
### `npm test`
Launches the test runner in the interactive watch mode.
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.