Skip to main content

Software Heritage Web UI

Project description

swh-web

This repository holds the development of Software Heritage web applications:

Documentation about how to use these components but also the details of their URI schemes can be found in the docs folder. The produced HTML documentation can be read and browsed at https://docs.softwareheritage.org/devel/swh-web/index.html.

Technical details

Those applications are powered by:

How to build and run

Requirements

First you will need Python 3 and a complete swh development environment installed.

To run the backend, you need to have the following Python 3 modules installed:

  • beautifulsoup4
  • django >= 1.10.7
  • djangorestframework >= 3.4.0
  • django_webpack_loader
  • django_js_reverse
  • docutils
  • file_magic >= 0.3.0
  • htmlmin
  • lxml
  • pygments
  • pypandoc
  • python-dateutil
  • pyyaml
  • requests

To compile the frontend assets, you need to have nodejs >= 8.x and yarn installed. If you are on Debian stretch, you can easily install an up to date nodejs from the stretch-backports repository while packages for yarn can be installed by following these instructions.

Alternatively, you can install yarn with npm install yarn, and add YARN=node_modules/yarn/bin/yarn as argument whenever you run make.

Please note that the static assets bundles generated by webpack are not stored in the git repository. Follow the instructions below in order to generate them in order to be able to run the frontend part of the web applications.

Make targets

Below is the list of available make targets that can be executed from the root directory of swh-web in order to build and/or execute the web applications under various configurations:

  • run-django-webpack-devserver: Compile and serve not optimized (without mignification and dead code elimination) frontend static assets using webpack-dev-server and run django server with development settings. This is the recommended target to use when developing swh-web as it enables automatic reloading of backend and frontend part of the applications when modifying source files (*.py, *.js, *.css, *.html).

  • run-django-webpack-dev: Compile not optimized (no minification, no dead code elimination) frontend static assets using webpack and run django server with development settings. This is the recommended target when one only wants to develop the backend side of the application.

  • run-django-webpack-prod: Compile optimized (with minification and dead code elimination) frontend static assets using webpack and run django server with production settings. This is useful to test the applications in production mode (with the difference that static assets are served by django). Production settings notably enable advanced django caching and you will need to have memcached installed for that feature to work.

  • run-django-server-dev: Run the django server with development settings but without compiling frontend static assets through webpack.

  • run-django-server-prod: Run the django server with production settings but without compiling frontend static assets through webpack.

  • run-gunicorn-server: Run the web applications with production settings in a gunicorn worker as they will be in real production environment.

Once one of these targets executed, the web applications can be executed by pointing your browser to http://localhost:5004.

Yarn targets

Below is a list of available yarn targets in order to only execute the frontend static assets compilation (no web server will be executed):

  • build-dev: compile not optimized (without mignification and dead code elimination) frontend static assets and store the results in the swh/web/static folder.

  • build: compile optimized (with mignification and dead code elimination) frontend static assets and store the results in the swh/web/static folder.

The build target must be executed prior performing the Debian packaging of swh-web in order for the package to contain the optimized assets dedicated to production environment.

To execute these targets, issue the following commmand:

$ yarn <target_name>

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swh.web-0.0.195.tar.gz (7.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swh.web-0.0.195-py3-none-any.whl (7.8 MB view details)

Uploaded Python 3

File details

Details for the file swh.web-0.0.195.tar.gz.

File metadata

  • Download URL: swh.web-0.0.195.tar.gz
  • Upload date:
  • Size: 7.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.3

File hashes

Hashes for swh.web-0.0.195.tar.gz
Algorithm Hash digest
SHA256 5ede1eb680fb5b877440ea4cc585404a14b3da0896733c3aa3429e013c4f7896
MD5 fae7cc0a092cb71092eb709802797b45
BLAKE2b-256 70c976801e85ace1e6f371a0c6fbba1e09cb1dbf825e06425170d291134a5936

See more details on using hashes here.

File details

Details for the file swh.web-0.0.195-py3-none-any.whl.

File metadata

  • Download URL: swh.web-0.0.195-py3-none-any.whl
  • Upload date:
  • Size: 7.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.3

File hashes

Hashes for swh.web-0.0.195-py3-none-any.whl
Algorithm Hash digest
SHA256 6f72dbab6e36eb4aa05cd9efe463b47515e1128e2b09a14c0b01c745d4741056
MD5 2c34b55434fe2db4b54c9c1bcf4df48e
BLAKE2b-256 5684b78399eb978b3e84d95ac691e3445751342d4c3b9a702a22e68fc63f37c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page