From efb8a9a99f35ba7924ee687d26822a29dbb5e7eb Mon Sep 17 00:00:00 2001 From: minhpv-2595 Date: Wed, 15 Oct 2025 17:22:57 +0700 Subject: [PATCH] feat: setup docker-compose and sample user metadata --- config.yaml | 6 +++++ docker-compose.yml | 24 +++++++++++++++++++ metadata/actions.graphql | 0 metadata/actions.yaml | 6 +++++ metadata/allow_list.yaml | 1 + metadata/api_limits.yaml | 1 + metadata/backend_configs.yaml | 1 + metadata/cron_triggers.yaml | 1 + .../HASURA-DEMO/tables/public_users.yaml | 3 +++ .../databases/HASURA-DEMO/tables/tables.yaml | 1 + metadata/databases/databases.yaml | 8 +++++++ metadata/graphql_schema_introspection.yaml | 1 + metadata/inherited_roles.yaml | 1 + metadata/metrics_config.yaml | 1 + metadata/network.yaml | 1 + metadata/opentelemetry.yaml | 1 + metadata/query_collections.yaml | 1 + metadata/remote_schemas.yaml | 1 + metadata/rest_endpoints.yaml | 1 + metadata/version.yaml | 1 + 20 files changed, 61 insertions(+) create mode 100644 config.yaml create mode 100644 docker-compose.yml create mode 100644 metadata/actions.graphql create mode 100644 metadata/actions.yaml create mode 100644 metadata/allow_list.yaml create mode 100644 metadata/api_limits.yaml create mode 100644 metadata/backend_configs.yaml create mode 100644 metadata/cron_triggers.yaml create mode 100644 metadata/databases/HASURA-DEMO/tables/public_users.yaml create mode 100644 metadata/databases/HASURA-DEMO/tables/tables.yaml create mode 100644 metadata/databases/databases.yaml create mode 100644 metadata/graphql_schema_introspection.yaml create mode 100644 metadata/inherited_roles.yaml create mode 100644 metadata/metrics_config.yaml create mode 100644 metadata/network.yaml create mode 100644 metadata/opentelemetry.yaml create mode 100644 metadata/query_collections.yaml create mode 100644 metadata/remote_schemas.yaml create mode 100644 metadata/rest_endpoints.yaml create mode 100644 metadata/version.yaml diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..83352bd --- /dev/null +++ b/config.yaml @@ -0,0 +1,6 @@ +version: 3 +endpoint: http://localhost:8080 +# admin_secret: secret +metadata_directory: metadata +actions: + kind: synchronous diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5ae82da --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,24 @@ +services: + postgres: + image: postgres:15 + restart: always + volumes: + - db_data:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: postgrespassword + graphql-engine: + image: hasura/graphql-engine:v2.46.0 + ports: + - "8080:8080" + restart: always + environment: + HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres + PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres + HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console + HASURA_GRAPHQL_DEV_MODE: "true" # set to "false" disable this in production + HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log + # HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets + # HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey + +volumes: + db_data: diff --git a/metadata/actions.graphql b/metadata/actions.graphql new file mode 100644 index 0000000..e69de29 diff --git a/metadata/actions.yaml b/metadata/actions.yaml new file mode 100644 index 0000000..1edb4c2 --- /dev/null +++ b/metadata/actions.yaml @@ -0,0 +1,6 @@ +actions: [] +custom_types: + enums: [] + input_objects: [] + objects: [] + scalars: [] diff --git a/metadata/allow_list.yaml b/metadata/allow_list.yaml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/metadata/allow_list.yaml @@ -0,0 +1 @@ +[] diff --git a/metadata/api_limits.yaml b/metadata/api_limits.yaml new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/metadata/api_limits.yaml @@ -0,0 +1 @@ +{} diff --git a/metadata/backend_configs.yaml b/metadata/backend_configs.yaml new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/metadata/backend_configs.yaml @@ -0,0 +1 @@ +{} diff --git a/metadata/cron_triggers.yaml b/metadata/cron_triggers.yaml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/metadata/cron_triggers.yaml @@ -0,0 +1 @@ +[] diff --git a/metadata/databases/HASURA-DEMO/tables/public_users.yaml b/metadata/databases/HASURA-DEMO/tables/public_users.yaml new file mode 100644 index 0000000..52de1e0 --- /dev/null +++ b/metadata/databases/HASURA-DEMO/tables/public_users.yaml @@ -0,0 +1,3 @@ +table: + name: users + schema: public diff --git a/metadata/databases/HASURA-DEMO/tables/tables.yaml b/metadata/databases/HASURA-DEMO/tables/tables.yaml new file mode 100644 index 0000000..0f402f4 --- /dev/null +++ b/metadata/databases/HASURA-DEMO/tables/tables.yaml @@ -0,0 +1 @@ +- "!include public_users.yaml" diff --git a/metadata/databases/databases.yaml b/metadata/databases/databases.yaml new file mode 100644 index 0000000..f6e96bb --- /dev/null +++ b/metadata/databases/databases.yaml @@ -0,0 +1,8 @@ +- name: HASURA-DEMO + kind: postgres + configuration: + connection_info: + database_url: postgres://postgres:postgrespassword@postgres:5432/postgres + isolation_level: read-committed + use_prepared_statements: false + tables: "!include HASURA-DEMO/tables/tables.yaml" diff --git a/metadata/graphql_schema_introspection.yaml b/metadata/graphql_schema_introspection.yaml new file mode 100644 index 0000000..61a4dca --- /dev/null +++ b/metadata/graphql_schema_introspection.yaml @@ -0,0 +1 @@ +disabled_for_roles: [] diff --git a/metadata/inherited_roles.yaml b/metadata/inherited_roles.yaml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/metadata/inherited_roles.yaml @@ -0,0 +1 @@ +[] diff --git a/metadata/metrics_config.yaml b/metadata/metrics_config.yaml new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/metadata/metrics_config.yaml @@ -0,0 +1 @@ +{} diff --git a/metadata/network.yaml b/metadata/network.yaml new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/metadata/network.yaml @@ -0,0 +1 @@ +{} diff --git a/metadata/opentelemetry.yaml b/metadata/opentelemetry.yaml new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/metadata/opentelemetry.yaml @@ -0,0 +1 @@ +{} diff --git a/metadata/query_collections.yaml b/metadata/query_collections.yaml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/metadata/query_collections.yaml @@ -0,0 +1 @@ +[] diff --git a/metadata/remote_schemas.yaml b/metadata/remote_schemas.yaml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/metadata/remote_schemas.yaml @@ -0,0 +1 @@ +[] diff --git a/metadata/rest_endpoints.yaml b/metadata/rest_endpoints.yaml new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/metadata/rest_endpoints.yaml @@ -0,0 +1 @@ +[] diff --git a/metadata/version.yaml b/metadata/version.yaml new file mode 100644 index 0000000..0a70aff --- /dev/null +++ b/metadata/version.yaml @@ -0,0 +1 @@ +version: 3