-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
527 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# Use Alpine Linux as the base image | ||
FROM alpine:3.18 | ||
# Use a lightweight Linux base image | ||
FROM debian:bullseye-slim | ||
|
||
# Set environment variables for non-interactive installations | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install necessary dependencies | ||
RUN apk add --no-cache \ | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
curl \ | ||
bash \ | ||
ca-certificates \ | ||
&& update-ca-certificates | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Download and install Hasura CLI | ||
RUN curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Set the default command to show Hasura CLI help | ||
CMD ["hasura", "help"] | ||
CMD ["hasura", "console"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
services: | ||
postgres: | ||
image: postgis/postgis:15-3.3 | ||
platform: linux/amd64 | ||
restart: always | ||
volumes: | ||
- db_data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_PASSWORD: postgrespassword | ||
ports: | ||
- "5432:5432" | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
start_period: 10s | ||
|
||
graphql-engine: | ||
image: hasura/graphql-engine:v2.42.0 | ||
|
@@ -21,22 +26,18 @@ services: | |
HASURA_GRAPHQL_ENABLE_CONSOLE: "true" | ||
HASURA_GRAPHQL_DEV_MODE: "true" | ||
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log | ||
## uncomment next line to run console offline (i.e load console assets from server instead of CDN) | ||
# HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: /srv/console-assets | ||
## uncomment next line to set an admin secret | ||
HASURA_GRAPHQL_ADMIN_SECRET: myadminsecretkey | ||
HASURA_GRAPHQL_METADATA_DEFAULTS: '{"backend_configs":{"dataconnector":{"athena":{"uri":"http://data-connector-agent:8081/api/v1/athena"},"mariadb":{"uri":"http://data-connector-agent:8081/api/v1/mariadb"},"mysql8":{"uri":"http://data-connector-agent:8081/api/v1/mysql"},"oracle":{"uri":"http://data-connector-agent:8081/api/v1/oracle"},"snowflake":{"uri":"http://data-connector-agent:8081/api/v1/snowflake"}}}}' | ||
HASURA_GRAPHQL_JWT_SECRET: '{"type":"RS256","jwk_url": "https://www.googleapis.com/service_accounts/v1/jwk/[email protected]","audience": "safetrust-dev", "claims_map": {"x-hasura-allowed-roles": ["user","anonymous","tenant","landlord"],"x-hasura-default-role": "user","x-hasura-user-id": {"path": "$.sub"}},"issuer": "https://securetoken.google.com/safetrust-dev"}' | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
data-connector-agent: | ||
condition: service_healthy | ||
|
||
data-connector-agent: | ||
image: hasura/graphql-data-connector:v2.42.0 | ||
platform: linux/amd64 | ||
restart: always | ||
ports: | ||
- 8081:8081 | ||
- "8081:8081" | ||
environment: | ||
QUARKUS_LOG_LEVEL: ERROR | ||
QUARKUS_OPENTELEMETRY_ENABLED: "false" | ||
|
@@ -51,11 +52,20 @@ services: | |
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
entrypoint: ["/bin/bash"] | ||
tty: true | ||
volumes: | ||
- ./hasura-project:/hasura-project # Mount your Hasura project directory | ||
- .:/app # Mount your Hasura project directory | ||
environment: | ||
HASURA_GRAPHQL_ENDPOINT: http://graphql-engine:8080 | ||
PG_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/postgres | ||
working_dir: /app | ||
command: hasura console --address 0.0.0.0 --console-port 9695 | ||
ports: | ||
- "9695:9695" | ||
depends_on: | ||
graphql-engine: | ||
condition: service_healthy | ||
|
||
|
||
volumes: | ||
db_data: | ||
db_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
table: | ||
name: escrow_api_calls | ||
schema: public | ||
columns: | ||
- name: id | ||
type: uuid | ||
- name: escrow_transaction_id | ||
type: uuid | ||
- name: endpoint | ||
type: text | ||
- name: method | ||
type: text | ||
- name: request_body | ||
type: jsonb | ||
- name: http_status_code | ||
type: integer | ||
- name: response_body | ||
type: jsonb | ||
- name: error_details | ||
type: jsonb | ||
- name: created_at | ||
type: timestamptz | ||
object_relationships: | ||
- name: escrow_transaction | ||
using: | ||
foreign_key_constraint_on: escrow_transaction_id |
60 changes: 60 additions & 0 deletions
60
metadata/databases/safetrust/tables/escrow_transactions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
table: | ||
name: escrow_transactions | ||
schema: public | ||
columns: | ||
- name: id | ||
type: uuid | ||
- name: bid_request_id | ||
type: uuid | ||
- name: engagement_id | ||
type: text | ||
- name: contract_id | ||
type: text | ||
- name: signer_address | ||
type: text | ||
- name: transaction_type | ||
type: escrow_transaction_type | ||
- name: status | ||
type: escrow_status | ||
- name: http_status_code | ||
type: integer | ||
- name: http_response_body | ||
type: jsonb | ||
- name: http_error_details | ||
type: jsonb | ||
- name: amount | ||
type: numeric | ||
- name: initial_deposit_percentage | ||
type: integer | ||
- name: cancellation_reason | ||
type: text | ||
- name: cancelled_by | ||
type: text | ||
- name: refund_status | ||
type: escrow_status | ||
- name: metadata | ||
type: jsonb | ||
- name: created_at | ||
type: timestamptz | ||
- name: updated_at | ||
type: timestamptz | ||
- name: completed_at | ||
type: timestamptz | ||
object_relationships: | ||
- name: bid_request | ||
using: | ||
foreign_key_constraint_on: bid_request_id | ||
- name: cancelled_by_user | ||
using: | ||
foreign_key_constraint_on: cancelled_by | ||
array_relationships: | ||
- name: xdr_transactions | ||
using: | ||
foreign_key_constraint_on: | ||
column: escrow_transaction_id | ||
table: escrow_xdr_transactions | ||
- name: api_calls | ||
using: | ||
foreign_key_constraint_on: | ||
column: escrow_transaction_id | ||
table: escrow_api_calls |
28 changes: 28 additions & 0 deletions
28
metadata/databases/safetrust/tables/escrow_xdr_transactions.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
table: | ||
name: escrow_xdr_transactions | ||
schema: public | ||
columns: | ||
- name: id | ||
type: uuid | ||
- name: escrow_transaction_id | ||
type: uuid | ||
- name: xdr_type | ||
type: escrow_transaction_type | ||
- name: unsigned_xdr | ||
type: text | ||
- name: signed_xdr | ||
type: text | ||
- name: status | ||
type: xdr_status | ||
- name: signing_address | ||
type: text | ||
- name: error_message | ||
type: text | ||
- name: created_at | ||
type: timestamptz | ||
- name: updated_at | ||
type: timestamptz | ||
object_relationships: | ||
- name: escrow_transaction | ||
using: | ||
foreign_key_constraint_on: escrow_transaction_id |
25 changes: 25 additions & 0 deletions
25
metadata/databases/safetrust/tables/public_bid_tables.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- table: | ||
schema: public | ||
name: bid_requests | ||
configuration: | ||
custom_root_fields: {} | ||
custom_column_names: {} | ||
array_relationships: | ||
- name: status_histories | ||
using: | ||
foreign_key_constraint_on: | ||
column: bid_request_id | ||
table: | ||
schema: public | ||
name: bid_status_histories | ||
|
||
- table: | ||
schema: public | ||
name: bid_status_histories | ||
configuration: | ||
custom_root_fields: {} | ||
custom_column_names: {} | ||
object_relationships: | ||
- name: bid_request | ||
using: | ||
foreign_key_constraint_on: bid_request_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
migrations/safetrust/1732599256424_add_user_profile_columns_to_users/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- Drop indexes | ||
DROP INDEX IF EXISTS idx_escrow_transactions_bid; | ||
DROP INDEX IF EXISTS idx_escrow_transactions_contract; | ||
DROP INDEX IF EXISTS idx_escrow_transactions_status; | ||
DROP INDEX IF EXISTS idx_escrow_transactions_type_status; | ||
DROP INDEX IF EXISTS idx_escrow_xdr_transaction; | ||
DROP INDEX IF EXISTS idx_escrow_api_calls_transaction; | ||
DROP INDEX IF EXISTS idx_escrow_api_calls_status; | ||
|
||
-- Drop tables | ||
DROP TABLE IF EXISTS escrow_api_calls; | ||
DROP TABLE IF EXISTS escrow_xdr_transactions; | ||
DROP TABLE IF EXISTS escrow_transactions; | ||
|
||
-- Drop types | ||
DROP TYPE IF EXISTS escrow_transaction_type; | ||
DROP TYPE IF EXISTS escrow_status; | ||
DROP TYPE IF EXISTS xdr_status; |
Oops, something went wrong.