Skip to content

🏗️📦feat: scaffold infra/hasura/ folder structure and Hasura config #75

@sotoJ24

Description

@sotoJ24

Issue Summary

Create the infra/hasura/ directory structure inside dApp-SafeTrust and
add the root Hasura configuration files. This is the infrastructure container
that all subsequent migration and metadata issues will populate. No migrations
are added in this issue — only the scaffold and Hasura project config.

Type of Issue

  • Feature Request

Depends on

None — can run in parallel with all frontend issues.

Files to create

infra/
└── hasura/
    ├── config.yaml              ← Hasura CLI project config
    ├── .env.example             ← infra-specific env vars
    └── migrations/
        └── safetrust/
            └── .gitkeep         ← placeholder, removed when first migration added
    └── metadata/
        ├── base/
        │   └── .gitkeep
        └── tenants/
            └── safetrust/
                └── .gitkeep
    └── seeds/
        └── safetrust/
            └── .gitkeep

infra/hasura/config.yaml

version: 3
endpoint: http://localhost:8080
admin_secret: myadminsecretkey
metadata_directory: metadata
actions:
  kind: synchronous
  handler_webhook_baseurl: http://localhost:3000

infra/hasura/.env.example

# Hasura
HASURA_GRAPHQL_ENDPOINT=http://localhost:8080
HASURA_GRAPHQL_ADMIN_SECRET=myadminsecretkey

# Database
PG_DATABASE_URL=postgres://postgres:postgrespassword@postgres:5432/postgres

# JWT (Firebase)
HASURA_GRAPHQL_JWT_SECRET='{"type":"RS256","jwk_url":"https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com","audience":"safetrust-890d0","issuer":"https://securetoken.google.com/safetrust-890d0"}'

Update docker-compose.yml

Verify the hasura service in the root docker-compose.yml mounts the
correct migration path. Add if missing:

hasura:
  volumes:
    - ./infra/hasura/migrations:/hasura-migrations
    - ./infra/hasura/metadata:/hasura-metadata
  environment:
    HASURA_GRAPHQL_MIGRATIONS_DIR: /hasura-migrations
    HASURA_GRAPHQL_METADATA_DIR: /hasura-metadata

Acceptance Criteria

  • infra/hasura/ directory exists with the full subfolder structure
  • infra/hasura/config.yaml exists with correct endpoint and version
  • infra/hasura/.env.example documents all required infra env vars
  • docker-compose.yml hasura service mounts infra/hasura/migrations
    and infra/hasura/metadata correctly
  • docker compose up hasura starts without volume mount errors
  • migrations/safetrust/, metadata/base/, metadata/tenants/safetrust/,
    seeds/safetrust/ directories all exist

References


Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions