https://github.com/talismansociety/multisig-metadata-backend
https://github.com/talismansociety/multisig-metadata-backend
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/talismansociety/multisig-metadata-backend
- Owner: TalismanSociety
- Created: 2023-06-23T12:16:32.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-19T14:23:27.000Z (about 1 year ago)
- Last Synced: 2024-08-20T08:32:58.209Z (10 months ago)
- Language: TypeScript
- Size: 245 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# signet-self-hosted-metadata-backend
## Setup
1. Setup your `.env` file, see `.env.sample` for example:
- `PG_DATABASE_URL`: The postgres url to connect to your local postgres db. Replace `localhost` with `host.docker.internal` if you're running locally.
- `NODE_ENV`: Set to `development` if running the frontend locally via http, which will disable `secure` for SIWS cookie.
- `HASURA_GRAPHQL_ADMIN_SECRET`: A password used to access your hasura instance. Can be any string.
- `HASURA_GRAPHQL_JWT_SECRET`: A json object containing your JWT secret's algo and key. see `.env.sample`2. Run `docker compose up --build -d` to build and start the services.
3. (Optional) Run `cd hasura && hasura console --admin-secret "{{HASURA_GRAPHQL_ADMIN_SECRET}}"` to start a Hasura dev console. Only changes made via your Hasura dev console will update your local `hasura` dir with all the relevant Hasura generated files that can later be used to update prod.
## Usage
- **Hasura Console**: Hasura console is accessible at `http://localhost:8080`. DO NOT change anything directly from the console.
- **Hasura Graphql Endpoint**: Check Hasura console for the graphql endpoint that the frontend can use to query data.
- **SIWS**: SIWS service needs to bind browser session with the client, and hence should reduce any proxy, including Hasura Action. Therefore, the frontend should access SIWS service directly at `http://localhost:3031`.
- **Hasura Dev Console**: Check your terminal where you execute `hasura console --admin-secret ...` command. Hasura dev console is typically accessible at `http://localhost9695`.## Folder Structure
```
.
|-- ...
|-- hasura # hasura generated files (e.g. metadata, migrations, config)
|-- services # contains all services. In the future, we will have things like notification service
| |-- actions-service # node JS app that exposes APIs for Hasura actions, mainly to perform data validation and custom business logic
| |-- siws-service # independent SIWS service that in the future can be extracted out of the repo and hosted on serverless functions
|__ ...
```