Skip to content

Commit

Permalink
Merge pull request #157 from IntersectMBO/chore/97-rebrand-applicatio…
Browse files Browse the repository at this point in the history
…n-in-infrastructure-configuration

[#97] Rebrand the application in infrastructure configuration
  • Loading branch information
placek authored Feb 13, 2024
2 parents f1bf28a + 2d58c54 commit 56cb7fb
Show file tree
Hide file tree
Showing 120 changed files with 349 additions and 254 deletions.
2 changes: 1 addition & 1 deletion .github/vva-be-config.json → .github/backend-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"fakedbsyncconfig" : {
"host" : "localhost",
"dbname" : "vva",
"dbname" : "govtool",
"user" : "postgres",
"password" : "MTnk8lsuMM41RgAh1y2WTAUdObsb",
"port" : 5432
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ jobs:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
FAKEDBSYNC_POSTGRES_DB: "vva"
FAKEDBSYNC_POSTGRES_DB: "govtool"
FAKEDBSYNC_POSTGRES_USER: "test"
FAKEDBSYNC_POSTGRES_PASSWORD: "test"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+vva@binarapps.com"
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -191,15 +191,15 @@ jobs:
DBSYNC_POSTGRES_DB: "cexplorer"
DBSYNC_POSTGRES_USER: "postgres"
DBSYNC_POSTGRES_PASSWORD: "pSa8JCpQOACMUdGb"
FAKEDBSYNC_POSTGRES_DB: "vva"
FAKEDBSYNC_POSTGRES_DB: "govtool"
FAKEDBSYNC_POSTGRES_USER: "test"
FAKEDBSYNC_POSTGRES_PASSWORD: "test"
GRAFANA_ADMIN_PASSWORD: ${{ secrets.GRAFANA_ADMIN_PASSWORD }}
GRAFANA_SLACK_RECIPIENT: ${{ secrets.GRAFANA_SLACK_RECIPIENT }}
GRAFANA_SLACK_OAUTH_TOKEN: ${{ secrets.GRAFANA_SLACK_OAUTH_TOKEN }}
NGINX_BASIC_AUTH: ${{ secrets.NGINX_BASIC_AUTH }}
SENTRY_DSN_BACKEND: ${{ secrets.SENTRY_DSN_BACKEND }}
TRAEFIK_LE_EMAIL: "admin+vva@binarapps.com"
TRAEFIK_LE_EMAIL: "admin+govtool@binarapps.com"
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/frontend_sonar_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
execute_sonar_scanner:
name: Execute sonar-scanner on vva-fe
name: Execute sonar-scanner on govtool frontend
runs-on: ubuntu-latest
permissions: read-all
steps:
Expand All @@ -26,4 +26,4 @@ jobs:
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
7 changes: 3 additions & 4 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: npm install
working-directory: ./govtool/frontend
Expand All @@ -27,7 +27,7 @@ jobs:
with:
path: |
~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('govtool/frontend/package-lock.json', 'tests/vva-fe/package-lock.json') }}
key: ${{ runner.os }}-npm-${{ hashFiles('govtool/frontend/package-lock.json', 'tests/govtool-frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
Expand All @@ -45,7 +45,6 @@ jobs:
run: |
lhci assert --preset "lighthouse:recommended"
- name: Publish reports
working-directory: ./govtool/frontend
if: github.repository_owner == 'IntersectMBO'
Expand All @@ -56,4 +55,4 @@ jobs:
-d "@./lighthouseci/$(ls ./.lighthouseci |grep 'lhr.*\.json' | head -n 1)" \
-H "commit-hash: $(git rev-parse HEAD)" \
-H "secret-token: ${{ secrets.METRICS_SERVER_SECRET_TOKEN }}" \
-H 'Content-Type: application/json' || echo "Metric Upload error ignored ..."
-H 'Content-Type: application/json' || echo "Metric Upload error ignored ..."
10 changes: 5 additions & 5 deletions .github/workflows/test_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
paths:
- .github/workflows/test_backend.yml
# - src/vva-be
# - tests/vva-be
# - govtool/backend
# - tests/govtool-backend

schedule:
- cron: '0 0 * * *'
Expand All @@ -18,23 +18,23 @@ on:
options:
- "sanchogov.tools/api"
- "staging.govtool.byron.network/api"
- "vva-sanchonet.cardanoapi.io/api"
- "govtool-sanchonet.cardanoapi.io/api"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.4
cache: 'pip'

- name: Run Backend Test
working-directory: tests/vva-be
working-directory: tests/govtool-backend
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test_integration_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ on:
options:
- "sanchogov.tools"
- "staging.govtool.byron.network"
- "vva-sanchonet.cardanoapi.io"
- "govtool-sanchonet.cardanoapi.io"

jobs:
cypress-tests:
defaults:
run:
working-directory: ./tests/vva-fe
working-directory: ./tests/govtool-frontend
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=4096
Expand All @@ -50,15 +50,15 @@ jobs:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
key:
${{ runner.os }}-yarn-${{hashFiles('tests/vva-fe/yarn.lock') }}
${{ runner.os }}-yarn-${{hashFiles('tests/govtool-frontend/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Cypress run
uses: cypress-io/github-action@v6
with:
record: true
working-directory: ./tests/vva-fe
working-directory: ./tests/govtool-frontend
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to allow accurately detecting a build vs a re-run build
Expand All @@ -69,4 +69,3 @@ jobs:
CYPRESS_kuberApiKey: ${{secrets.KUBER_API_KEY}}
CYPRESS_faucetApiUrl: https://faucet.${{inputs.network || 'sanchonet'}}.world.dev.cardano.org
CYPRESS_faucetApiKey: ${{ secrets.FAUCET_API_KEY }}

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ The SanchoNet GovTool is currently open for beta testing and can be accessed at
Learn more; [docs.sanchogov.tools](https://docs.sanchogov.tools/).

## 📍 Navigation
- [GovTool Backend](./src/vva-be/README.md)
- [GovTool Frontend](./src/vva-fe/README.md)
- [GovTool Backend](./govtool/backend/README.md)
- [GovTool Frontend](./govtool/frontend/README.md)
- [Documentation](./docs/)
- [Tests](./tests/)

Expand All @@ -45,4 +45,4 @@ Frontend is able to connect to Cardano wallets over the [CIP-30](https://github.

## 🤝 Contributing
Thanks for considering contributing and helping us on creating GovTool! 😎
Please checkout our [Contributing Documentation](./CONTRIBUTING.md).
Please checkout our [Contributing Documentation](./CONTRIBUTING.md).
4 changes: 2 additions & 2 deletions docs/operations/DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ AWS is configured with Terraform, but the account needs to be bootstrapped befor
This has to be done only once per AWS account.

1. Configure AWS CLI with `aws configure` (if you are using a configuration profile, use `aws --profile MYPROFILE configure` and then `export AWS_PROFILE=MYPROFILE`).
1. Execute `./src/terraform/bootstrap-aws-account.sh` script.
1. Execute `./infra/terraform/bootstrap-aws-account.sh` script.

### Infrastructure setup

Expand All @@ -29,7 +29,7 @@ This has to be done only once per AWS account.
1. Run `terraform plan` to view changes that would be performed to infrastructure.
1. Take note of the outputs - they contain ECR repo URLs and app domains.

Note: the Terraform code configures the EC2 instance using `src/terraform/modules/vva-ec2/user_data.sh`. This script is only executed on instance creation.
Note: the Terraform code configures the EC2 instance using `infra/terraform/modules/govtool-ec2/user_data.sh`. This script is only executed on instance creation.

## Application deployment

Expand Down
8 changes: 5 additions & 3 deletions govtool/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This is a backend application of GovTool project.

## Prerequisites
In order to run `vva-be` your host machine will need access to the `cardano-db-sync` postgres database. To have this database running locally you'll need:
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
Expand All @@ -24,10 +24,10 @@ Due to problems with openapi3 package it's hard to build this project with plain

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

2. Enter `src/vva-be` directory:
2. Enter `govtool/backend` directory:

```sh
cd src/vva-be
cd govtool/backend
```

3. Allow broken nix packages
Expand All @@ -54,3 +54,5 @@ Due to problems with openapi3 package it's hard to build this project with plain
```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.
24 changes: 12 additions & 12 deletions govtool/frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Voltaire GovTool Frontend
# GovTool Frontend

Installed on your machine:

Expand All @@ -16,7 +16,7 @@ Fill .env based on env.example file
Go to the project directory

```bash
cd voltaire-era/src/vva-fe
cd voltaire-era/govtool/frontend
```

Install dependencies
Expand Down Expand Up @@ -47,10 +47,10 @@ yarn dev

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

2. Enter `src/vva-fe` directory:
2. Enter `govtool/frontend` directory:

```sh
cd src/vva-fe
cd govtool/frontend
```

3. Run `nix-shell`
Expand All @@ -75,13 +75,13 @@ Install [`direnv`](https://direnv.net/):
nix-env -i direnv
```

Allow direnv configuration in `src/vva-fe`:
Allow direnv configuration in `govtool/frontend`:

```sh
direnv allow src/vva-fe
direnv allow govtool/frontend
```

From now on, once you enter the `src/vva-fe` the `nix-shell` with proper
From now on, once you enter the `govtool/frontend` the `nix-shell` with proper
configuration will be propagated.

## Developing
Expand Down Expand Up @@ -128,9 +128,9 @@ npm run dev

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

2. Enter `src/vva-fe` directory:
2. Enter `govtool/frontend` directory:
```sh
cd src/vva-fe
cd govtool/frontend
```

3. Run `nix-shell`
Expand All @@ -152,12 +152,12 @@ Install [`direnv`](https://direnv.net/):
nix-env -i direnv
```

Allow direnv configuration in `src/vva-fe`:
Allow direnv configuration in `govtool/frontend`:
```sh
direnv allow src/vva-fe
direnv allow govtool/frontend
```

From now on, once you enter the `src/vva-fe` the `nix-shell` with proper
From now on, once you enter the `govtool/frontend` the `nix-shell` with proper
configuration will be propagated.

### Users
Expand Down
5 changes: 5 additions & 0 deletions infra/terraform/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export export AWS_PROFILE=<aws_profile>
export NIXPKGS_ALLOW_UNFREE=1

use nix

Loading

0 comments on commit 56cb7fb

Please sign in to comment.