]> Git — Sourcephile - gargantext.git/blob - README.md
[CLEAN] removing Prelude && adding gargantext-prelude dependency
[gargantext.git] / README.md
1 # Gargantext Haskell
2
3 ## About this project
4
5 Gargantext is a collaborative web platform for the exploration of sets
6 of unstructured documents. It combines tools from natural language
7 processing, text-mining, complex networks analysis and interactive data
8 visualization to pave the way toward new kinds of interactions with your
9 digital corpora. This software is a free software, developed by the CNRS
10 Complex Systems Institute of Paris Île-de-France (ISC-PIF) and its
11 partners.
12
13 ## Installation
14
15 Disclaimer: this project is still in development, this is work in
16 progress. Please report and improve this documentation if you encounter issues.
17
18 ### Build Core Code
19
20 NOTE: Default build (with optimizations) requires large amounts of RAM (16GB at least). To avoid heavy compilation times and swapping out your machine, it is recommended to `stack build` with the `--fast-` flag, i.e.:
21 ``` sh
22 stack --docker build --fast
23 ```
24 or
25 ``` sh
26 stack --nix build --fast
27 ```
28 This might be related to the [broken Swagger `-O2` issue](https://github.com/haskell-servant/servant/issues/986).
29
30 #### Docker
31
32 ``` sh
33 curl -sSL https://gitlab.iscpif.fr/gargantext/haskell-gargantext/raw/dev/devops/docker/docker-install | sh
34 ```
35
36 #### Debian
37
38 ``` sh
39 curl -sSL https://gitlab.iscpif.fr/gargantext/haskell-gargantext/raw/dev/devops/debian/install | sh
40 ```
41
42 #### Ubuntu
43
44 ``` sh
45 curl -sSL https://gitlab.iscpif.fr/gargantext/haskell-gargantext/raw/dev/devops/ubuntu/install | sh
46 ```
47
48 ### Add dependencies
49
50 1. CoreNLP is needed (EN and FR); This dependency will not be needed soon.
51
52 ``` sh
53 ./devops/install-corenlp
54 ```
55
56 2. Louvain C++ needed to draw the socio-semantic graphs
57
58 NOTE: This is already added in the Docker build.
59
60 ``` sh
61 git clone https://gitlab.iscpif.fr/gargantext/clustering-louvain-cplusplus.git
62 cd clustering-louvain-cplusplus
63 ./install
64 ```
65
66 ### Initialization
67
68 #### Docker
69
70 Run PostgreSQL first:
71
72 ``` sh
73 cd devops/docker
74 docker-compose up
75 ```
76
77 Initialization schema should be loaded automatically (from `devops/postgres/schema.sql`).
78
79 #### Gargantext
80
81 ##### Fix the passwords
82
83 Change the passwords in gargantext.ini_toModify then move it:
84
85 ``` sh
86 mv gargantext.ini_toModify gargantext.ini
87 ```
88 (`.gitignore` avoids adding this file to the repository by mistake)
89
90
91 ##### Run Gargantext
92
93 Users have to be created first (`user1` is created as instance):
94
95 ``` sh
96 stack install
97 ~/.local/bin/gargantext-init "gargantext.ini"
98 ```
99
100 For Docker env, first create the appropriate image:
101
102 ``` sh
103 cd devops/docker
104 docker build -t cgenie/stack-build:lts-17.13-garg .
105 ```
106
107 then run:
108
109 ``` sh
110 stack --docker run gargantext-init -- gargantext.ini
111 ```
112
113 ### Importing data
114
115 You can import some data with:
116 ``` sh
117 docker run --rm -it -p 9000:9000 cgenie/corenlp-garg
118 stack exec gargantext-import -- "corpusCsvHal" "user1" "IMT3" gargantext.ini 10000 ./1000.csv
119 ```
120
121 ### Nix
122
123 It is also possible to build everything with [Nix](https://nixos.org/) instead of Docker:
124 ``` sh
125 stack --nix build
126 stack --nix exec gargantext-import -- "corpusCsvHal" "user1" "IMT3" gargantext.ini 10000 ./1000.csv
127 stack --nix exec gargantext-server -- --ini gargantext.ini --run Prod
128 ```
129
130 ## Use Cases
131
132 ### Multi-User with Graphical User Interface (Server Mode)
133
134 ``` sh
135 ~/.local/bin/stack --docker exec gargantext-server -- --ini "gargantext.ini" --run Prod
136 ```
137
138 Then you can log in with `user1` / `1resu`.
139
140
141 ### Command Line Mode tools
142
143 #### Simple cooccurrences computation and indexation from a list of Ngrams
144
145 ``` sh
146 stack --docker exec gargantext-cli -- CorpusFromGarg.csv ListFromGarg.csv Ouput.json
147 ```
148
149 ### Analyzing the ngrams table repo
150
151 We store the repository in directory `repos` in the [CBOR](https://cbor.io/)
152 file format. To decode it to JSON and analyze, say, using
153 [jq](https://shapeshed.com/jq-json/), use the following command:
154
155 ``` sh
156 cat repos/repo.cbor.v5 | stack --nix exec gargantext-cbor2json | jq .
157 ```
158 ### Documentation
159
160 To build documentation, run:
161
162 ```sh
163 stack --docker build --haddock --no-haddock-deps --fast
164 ```
165