README.md 3.82 KB
Newer Older
1
<div align="center"><img height="180" src="https://gitlab.iscpif.fr/gargantext/main/raw/master/images/logo.png"></div>
2 3

&nbsp;
4
# Gargantext with Purescript (FrontEnd instance)
5

6

7
![Purescript](https://img.shields.io/badge/Code-Purescript-informational?style=flat&logo=purescript&color=1d222d)&nbsp;&nbsp;![Nix](https://img.shields.io/badge/Package%20manager-Nix-informational?style=flat&logo=debian&color=6586c8)&nbsp;&nbsp;![NPM](https://img.shields.io/badge/Tools-npm-informational?style=flat&logo=npm&color=red)&nbsp;&nbsp;![Yarn](https://img.shields.io/badge/Tools-Yarn-informational?style=flat&logo=yarn&color=2188b6)&nbsp;&nbsp;![React](https://img.shields.io/badge/Code-React-informational?style=flat&logo=react&color=61DAFB)&nbsp;&nbsp;![HTML](https://img.shields.io/badge/Code-HTML-informational?style=flat&logo=html5&color=E44D26)&nbsp;&nbsp;![CSS](https://img.shields.io/badge/Style-CSS-informational?style=flat&logo=css3&color=264EE4)&nbsp;&nbsp;![Bootstrap](https://img.shields.io/badge/Style-Bootstrap-informational?style=flat&logo=bootstrap&color=6528e0)&nbsp;&nbsp;![Sass](https://img.shields.io/badge/Tools-Sass-informational?style=flat&logo=sass&color=bf4080)&nbsp;&nbsp;![Python](https://img.shields.io/badge/Tools-Python-informational?style=flat&logo=python&color=ffd343)&nbsp;&nbsp;![Docker](https://img.shields.io/badge/Tools-Docker-informational?style=flat&logo=docker&color=003f8c)
8

9 10 11 12
#### Table of Contents
1. [About the project](#about)
2. [Getting set up](#setup)
3. [Develoment](#dev)
13 14


15
## About the project <a name="about"></a>
16

17 18 19 20 21
GarganText is a collaborative web-decentralized-based macro-service
platform for the exploration of unstructured texts. It combines tools
from natural language processing, text-data-mining tricks, complex
networks analysis algorithms and interactive data visualization tools to
pave the way toward new kinds of interactions with your digital corpora.
22

23 24 25 26 27 28
This software is free software, developed and offered by the CNRS
Complex Systems Institute of Paris Île-de-France (ISC-PIF) and its
partners.

GarganText Project: this repo builds the
frontend for the backend server built by
Alexandre Delanoë's avatar
Alexandre Delanoë committed
29
[backend](https://gitlab.iscpif.fr/gargantext/haskell-gargantext).
30

31

32
## Getting set up <a name="setup"></a>
James Laver's avatar
James Laver committed
33

Fabien Manière's avatar
Fabien Manière committed
34 35
**Prerequisite:**  clone the project.

James Laver's avatar
James Laver committed
36
There are two approaches to working with the build:
Fabien Maniere's avatar
Fabien Maniere committed
37

38
1. Use Nix setup (recommended)
Fabien Maniere's avatar
Fabien Maniere committed
39
2. Use Docker setup
James Laver's avatar
James Laver committed
40

41
### 1. Use Nix setup (recommended)
42

Fabien Maniere's avatar
Fabien Maniere committed
43
First install [Nix](https://nixos.org/download.html): 
44 45

```shell
Fabien Maniere's avatar
Fabien Maniere committed
46
sh <(curl -L https://nixos.org/nix/install) --daemon
47 48
```

Fabien Maniere's avatar
Fabien Maniere committed
49
Verify the installation is complete (**Note:** close the current terminal session and open en new session to get nix working)
50
```shell
Alexandre Delanoë's avatar
Alexandre Delanoë committed
51 52
$ nix-env --version
nix-env (Nix) 2.11.0
53 54
```

55 56 57 58 59 60 61
Enable de flake experimental feature :

```shell
mkdir ~/.config/nix
echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf
```

Alexandre Delanoë's avatar
Alexandre Delanoë committed
62
To build the frontend just execute the install script at the root at the project:
63
```shell
Alexandre Delanoë's avatar
Alexandre Delanoë committed
64
./install
65 66
```

67 68 69 70
```shell
nix -L develop
```

Fabien Maniere's avatar
Fabien Maniere committed
71 72
**Local instance is ready!** (Example: http://localhost:8000/)

Fabien Maniere's avatar
Fabien Maniere committed
73
### 2. Use Docker setup
James Laver's avatar
James Laver committed
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

You will need docker and docker-compose installed.

First, Source our environment file:

```shell
source ./env.sh
```

WARNING: you must `source ./env.sh` before using the docker
container. If you don't do that, the container will write files as
root and you'll need root powers to get ownership back!

Now build the docker image:

```shell
Fabien Maniere's avatar
Fabien Maniere committed
90
docker compose build frontend
James Laver's avatar
James Laver committed
91 92 93 94
```

That's it, skip ahead to "Development".

95
## Development <a name="dev"></a>
96

97
#### Server 
98
Just serve dist/index.html with any server and you are ready to be
99
connected to any backend.
100 101 102 103 104

For instance you can serve it:
```
cd dist/ && python3 -mhttp.server
```
105 106 107 108 109 110 111 112 113

#### Frontend compilation
To see Purescript updates, we have to rebuild:
```shell
nix-shell --run build
```

To compile CSS (Sass):
```shell
114
nix-shell --run "npm run css"
115 116
```