Skip to content

Commit

Permalink
docs: update backend readme to use proper ghc and cabal versions
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzalowski committed Nov 5, 2024
1 parent a4ef51e commit 32765ad
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
44 changes: 30 additions & 14 deletions govtool/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ This is a backend application of GovTool project.
## Prerequisites

In order to run `backend` your host machine will need access to the `cardano-db-sync` postgres database. To have this database running locally you'll need:
* `cardano-node`
* `cardano-db-sync`
* PostgreSQL database

- `cardano-node`
- `cardano-db-sync`
- PostgreSQL database

You will need your `cardano-node` and `cardano-db-sync` to be compatible with Sancho testnet. Until these features will be merged to the master branch the new Sancho compatible versions are available as releases on [github](https://github.com/IntersectMBO/cardano-db-sync/releases). You will also need a correct `cardano-node` version. The release notes for `cardano-db-sync` usualy specify that.

Expand All @@ -25,35 +26,50 @@ You can utilize the [docker-compose.node+dbsync.yml](../../scripts/govtool/docke

Due to problems with openapi3 package it's hard to build this project with plain `ghc` and `cabal-install`. Until the prolem is solved we reccomend using `nix` - this problem is fixed when you build your project from inside of the nix shell.

1. Get [Nix](https://nixos.org/download).
1. Get [Nix](https://nixos.org/download).

2. Get [direnv](https://direnv.net/).

3. Set GHC version to 9.10.1:

```sh
ghcup install ghc 9.10.1

ghcup set ghc 9.10.1
```

4. Install cabal

2. Get [direnv](https://direnv.net/).
```sh
ghcup install cabal
ghcup set cabal
```

3. Enter `govtool/backend` directory:
5. Enter `govtool/backend` directory:

```sh
cd govtool/backend
```

4. Allow direnv to setup your environment:
6. Allow direnv to setup your environment:

```sh
direnv allow
```

5. Update cabal & build project
7. Update cabal & build project
```sh
cabal update
cabal build all
```
6. Create a config file. You can use `example-config.json` as a template.
8. Create a config file. You can use `example-config.json` as a template.

7. Run project
```sh
9. Run project
`sh
cabal run vva-be -- --config <YOUR CONFIG FILE> start-app
```
> [!WARNING]
> In the context of our ongoing project enhancements, it is assumed that the executable previously known as 'vva-be' should be now officially renamed to 'govtool-backend'. This change is necessary for aligning with the updated branding and functional scope of the application and it has to be implemented in the near future as a chore and refactoring ticket. Make sure that the documentation matches the actual name of the executable.
`
> [!WARNING]
> In the context of our ongoing project enhancements, it is assumed that the executable previously known as 'vva-be' should be now officially renamed to 'govtool-backend'. This change is necessary for aligning with the updated branding and functional scope of the application and it has to be implemented in the near future as a chore and refactoring ticket. Make sure that the documentation matches the actual name of the executable.

## Development

Expand Down
2 changes: 1 addition & 1 deletion govtool/frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ yarn dev

#### Using Nix and Direnv

1. Get [Nix](https://nixos.org/download).
1. Get [Nix](https://nixos.org/download) (And/Or) Get [GHCUP](https://www.haskell.org/ghcup/).

2. Get [direnv](https://direnv.net/).

Expand Down

0 comments on commit 32765ad

Please sign in to comment.