Skip to content

gephi/gephi-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gephi Lite

Gephi Lite is a free and open-source web application to visualize and explore networks and graphs. It is a web-based, lighter version of Gephi. You can try it here:

gephi.org/gephi-lite

It is currently under active developments, so features can evolve quite quickly. Feel free to report bugs or ask for new features in the issues board.

You can read more about the intent of this project on the Gephi blog.

License

Gephi Lite source code is distributed under the GNU General Public License v3.

Run locally

Gephi Lite is a web application, written using TypeScript and React. The styles are written using SASS, and are based on Bootstrap v5.

Gephi Lite uses sigma.js for graph rendering, and graphology as the graph model as well as for graph algorithms. It is built using Vite.

To build Gephi Lite locally, you first need a recent version of Node.js with NPM installed on your computer. You can then install the dependencies by running npm install in Gephi Lite's directory.

Now, in the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:5173/gephi-lite to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

End-to-end tests can be run with playwright.

First make sure to install browsers : npx playwright install

Then start the e2e tests : npm run test:e2e

If you have updated the project style/layout, you will have to delete the saved screenshot in /e2e/.spec.ts-snapshots/, and then run the e2e test to regenerate them.

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 Gephi Lite is ready to be deployed!

Docker

Docker allows building and running Gephi lite in a controlled environment without installing npm and project dependencies on your host system.

Docker compose for development

The docker compose provided in this repository is designed for local development not for production.

Make sure you have a fresh version of Docker and Docker Compose plugin. Effective July 2023 Compose is now integrated into all current Docker Desktop versions.

docker compose build

Builds or rebuilds docker image from your git checkout

docker compose up

Starts Gephi Lite with previously prebuilt image

docker compose down

Stops container and frees all the resources obtained by the container.

Dockerfile for production

The Dockerfile provided in this repository is designed for production. The application is build and then served by nginx, which its port is exposed by docker

  • Build the image : docker build -f Dockerfile -t gephi-lite .
  • Create & run a container : docker run -p 80:80 gephi-lite

Any custom npm command

Run docker compose run --entrypoint sh gephi-lite and you'll get into the shell where you can run all the npm commands from above

Deploy the application

To allow users to synchronize their data with GitHub, Gephi Lite needs a reverse proxy to avoid CORS issues. When working locally in development, we use http-proxy-middleware to make that work.

To deploy the application, you need to define the env variable VITE_GITHUB_PROXY before building it, by following those steps:

$> VITE_GITHUB_PROXY=mydomain.for.github.auth.proxy.com
$> npm install
$> npm run build

On gephi.org/gephi-lite we use this settings : VITE_GITHUB_PROXY: "https://githubapi.gephi.org".

Then on our server, we configured NGINX with this following settings:

server {
    listen       443 ssl;
    server_name githubapi.gephi.org;

    ssl_certificate /etc/letsencrypt/live/githubapi.gephi.org/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/githubapi.gephi.org/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

   location /login {
     add_header Access-Control-Allow-Origin "https://gephi.org";
     add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
     add_header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, user-agent";
     if ($request_method = OPTIONS) {
        return 204;
     }
     proxy_pass https://github.com/login;
   }

   location / {
     return 404;
   }
}

PS: On this configuration you should change the server_name with its ssl configuration, as well as the add_header Access-Control-Allow-Origin value.