This is a backend application of GovTool project.
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
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. You will also need a correct cardano-node
version. The release notes for cardano-db-sync
usualy specify that.
cardano-db-sync
documentation (with docker)
You can utilize the docker-compose.node+dbsync.yml file to setup the required services.
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.
-
Get Nix.
-
Get direnv.
-
Enter
govtool/backend
directory:cd govtool/backend
-
Allow direnv to setup your environment:
direnv allow
-
Update cabal & build project
cabal update cabal build all
-
Create a config file. You can use
example-config.json
as a template. -
Run project
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.
In the development environment in Nix, the hlint
tool is readily available to verify Haskell files.
By using hlint
, developers can ensure that their code adheres to best practices and follows appropriate guidelines. By incorporating hlint
into the development process, developers can catch potential errors and make necessary improvements early on, ultimately leading to more efficient and robust software development.
To easily format Haskell code, ensuring consistency and readability across the codebase the stylish-haskell
formatter has been introduced into the nix configuration.
Developers can streamline the process of formatting their code, reducing the time and effort required for manual formatting.
Developers can use the IDE integrations for Language Server Protocol (LSP) by utilising the Haskell-Language-Server that include support for GHC 9.2.7. Using such integration, developers can ensure a seamless and efficient experience with Haskell code in their IDE.