Commit 0e037e1f authored by Grégoire Locqueville's avatar Grégoire Locqueville

New README improvements abt. compiling and running

Fixed some typos introduced in the previous edit,
clarified a couple of points, and restructured the doc some more
as I got a better grasp on the process.
parent a481b2cb
Pipeline #6382 passed with stages
in 33 minutes and 52 seconds
......@@ -36,16 +36,17 @@ You must have the following installed:
### Building
#### Cloning the project
#### Clone the projects
Clone this project in a directory of your choice, and enter the directory. Also, clone the frontend:
Clone both the backend (`haskell-gargantext`), and the frontend (`purescript-gargantext`) at the root of the backend.
```shell
git clone https://gitlab.iscpif.fr/gargantext/haskell-gargantext.git
cd haskell-gargantext
git clone https://gitlab.iscpif.fr/gargantext/purescript-gargantext
git clone https://gitlab.iscpif.fr/gargantext/purescript-gargantext.git
cd ..
```
#### Entering a Nix shell
#### Enter a Nix shell
Enter a Nix shell. This will take a long time the first time you run it:
```shell
......@@ -54,7 +55,7 @@ nix-shell
You can exit a Nix shell at any point with `exit`.
In what follows, many commands need to be executed from within the Nix shell. To make that clear, those will be prefixed with `n$`.
In what follows, many commands need to be executed from within the Nix shell. To make that clear, those will be prefixed with `n$`, *but you must not actually type `n$` before the commands*.
If for some reason you do not want to enter a Nix shell, you can still run a command from outside:
```shell
......@@ -66,33 +67,33 @@ is equivalent to running `my command` from within a Nix shell.
Make a file `cabal.project.local` that will tell Cabal to turn off optimizations:
```shell
cp cabal.project.local_toModify cabal.project.local
cp cabal.project.local_toCopy cabal.project.local
```
#### Build the backend
#### Install backend dependencies
*Note: This project can be built with either stack or cabal. We keep the `cabal.project` up-to-date, which allows us to build with cabal by default but we support stack thanks to thanks to `cabal2stack`, which allows us to generate a valid `stack.yaml` from a `cabal.project`. Due to the fact gargantext requires a particular set of system dependencies (C++ libraries, toolchains, etc) we use nix to setup an environment with all the required system dependencies, in a sandboxed and isolated fashion.*
*This documentation shows how to build with cabal. For information related to stack, see `docs/using_stack.md`.*
From within the Nix shell, run:
**From within the Nix shell**, run:
```shell
n$ cabal update
n$ cabal install
```
#### Build the frontend
#### Build the backend and frontend
`cd` into the frontend directory and build:
```shell
cd purescript-gargantext
./install
./bin/install
cd purescript-gargantext/
./bin/install
cd ..
```
### Initializing
### Initializing and running
#### Configure database and NLP software bricks
#### Start containers for database and NLP software bricks
```shell
cd devops/docker
......@@ -118,41 +119,15 @@ n$ gargantext-cli init --ini-path gargantext.ini
The master user's name is automatically set to `gargantua`, but you will be prompted for their password and email address.
### Launching and developing Gargantext <a name="launch"></a>
Once the project is setup, the following (except the backend build if you are working on the frontend, and vice versa) is what you will need to run to update after you have edited the source code.
If you are working on the backend, you might want to use the `./start` script: it does all of that, except the frontend build.
#### Building the backend
```shell
./bin/install
```
#### Building the frontend
```shell
cd purescript-gargantext/
./install
cd ..
```
#### Running the Docker images
If docker is not already running:
```shell
cd devops/docker
docker compose up
```
#### Launching the Gargantext server
#### Running
From inside a Nix shell:
```shell
n$ cabal run gargantext-server -- --ini gargantext.ini --run Prod
```
If you are working on the backend, you might want to use the `./start` script: it rebuilds the backend, starts the docker containers, and launches the Gargantext server at once.
### Running tests
From nix shell:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment