Coder Social home page Coder Social logo

softwareheritage / swh-web Goto Github PK

View Code? Open in Web Editor NEW
14.0 11.0 4.0 185.04 MB

GitHub mirror of Web applications

Home Page: https://forge.softwareheritage.org/source/swh-web/

License: GNU Affero General Public License v3.0

Makefile 0.05% Python 67.61% CSS 1.49% JavaScript 21.49% HTML 8.87% R 0.06% Ada 0.02% AutoHotkey 0.02% AspectJ 0.05% AppleScript 0.01% ActionScript 0.03% AutoIt 0.02% Awk 0.02% Batchfile 0.02% Brainfuck 0.02% 1C Enterprise 0.11% Cap'n Proto 0.05% Ceylon 0.01% Clojure 0.01% CMake 0.05%

swh-web's Introduction

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, run and test

Backend 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.

To run the backend tests, the following Python 3 modules are also required to be installed.

One easy way to install them is to use the pip tool:

$ pip install -r requirements.txt -r requirements-test.txt

Frontend requirements

To compile the frontend assets, you need to have nodejs >= 14.0.0 and yarn installed. If you are on Debian, you can easily install an up to date nodejs from the nodesource repository.

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 to execute the applications

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.

Make targets to test the applications

Some make targets are also available to easily execute the backend and frontend tests of the Software Heritage web applications.

The backend tests are powered by the pytest and hypothesis frameworks while the frontend ones rely on the use of the cypress tool.

Below is the exhaustive list of those targets:

  • test: execute the backend tests using a fast hypothesis profile (only one input example will be provided for each test)

  • test-full: execute the backend tests using a slower hypothesis profile (one hundred of input examples will be provided for each test which helps spotting possible bugs)

  • test-frontend: execute the frontend tests using cypress in headless mode but with some slow test suites disabled

  • test-frontend-full: execute the frontend tests using cypress in headless mode with all test suites enabled

  • test-frontend-ui: execute the frontend tests using the cypress GUI but with some slow test suites disabled

  • test-frontend-full-ui: execute the frontend tests using the cypress GUI with all test suites enabled

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 command:

$ yarn <target_name>

swh-web's People

Contributors

anlambert avatar ardumont avatar progval avatar jbertran avatar olasd avatar zacchiro avatar kalpitk avatar jayeshv avatar seirl avatar douardda avatar vsellier avatar kshivendu avatar mihir-karbelkar avatar anirudhlakhotia avatar iamshankhadeep avatar rdicosmo avatar ericson2314 avatar benoit-chauvet avatar twitu avatar 01shobitha avatar plt-amy avatar augustinetharakan12 avatar prdes avatar stspdotname avatar krithikvaidya avatar r5d avatar

Stargazers

Karl Goetz avatar Simone Sacchi avatar Nestor Monroy avatar  avatar edmondfrank avatar  avatar eg avatar Sora Morimoto avatar  avatar Naman Tayal avatar  avatar Cat  avatar Darío Clavijo avatar Remi Rampin avatar

Watchers

 avatar  avatar  avatar  avatar  avatar James Cloos avatar  avatar  avatar  avatar Morane Gruenpeter avatar Kostas Georgiou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.