{"id":16393718,"url":"https://github.com/tk42/bbff","last_synced_at":"2025-02-23T02:21:38.640Z","repository":{"id":65088258,"uuid":"576791405","full_name":"tk42/bbff","owner":"tk42","description":"the best backend for frontend with graphql (Hasura) and sqlc ","archived":false,"fork":false,"pushed_at":"2023-02-08T11:46:32.000Z","size":46,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T04:14:42.766Z","etag":null,"topics":["graphql","hasura","sqlc"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tk42.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-11T01:34:23.000Z","updated_at":"2023-10-22T15:41:38.000Z","dependencies_parsed_at":"2023-02-19T17:00:47.090Z","dependency_job_id":null,"html_url":"https://github.com/tk42/bbff","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tk42%2Fbbff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tk42%2Fbbff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tk42%2Fbbff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tk42%2Fbbff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tk42","download_url":"https://codeload.github.com/tk42/bbff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240258778,"owners_count":19773056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","hasura","sqlc"],"created_at":"2024-10-11T04:54:05.402Z","updated_at":"2025-02-23T02:21:38.464Z","avatar_url":"https://github.com/tk42.png","language":null,"readme":"# bbff\nthe best backend for frontend\n\n## Quickstart\nFor migration\n```\ndocker compose -f docker-compose.autogen.yml up\n```\n\nFor demo\n```\ndocker compose up\n```\n\nand in Hasura UI push `Track All` button twice. one for tables/views and the other for foreign-keys. See more details in [here](https://hasura.io/docs/latest/schema/postgres/using-existing-database/).\n\n## Deploy (on CloudRun)\n 1. Create a repository in Google Artifact (e.g. 'backend' in ap-northeast1)\n 2. Tag the docker image on Local PC\n  ```\n  docker tag hasura/graphql-engine:v2.16.0.ubuntu.amd64 asia-northeast1-docker.pkg.dev/\u003cproject name\u003e/backend/graphql-engine\n  ```\n  and configure the docker registory if you need\n  ```\n  gcloud auth configure-docker asia-northeast1-docker.pkg.dev\n  ```\n 3. Push the image\n  ```\n  docker push asia-northeast1-docker.pkg.dev/\u003cproject name\u003e/backend/graphql-engine\n  ```\n 4. Set as following based on [here](https://github.com/hasura/graphql-engine/issues/2673#issuecomment-545182529)\n  ```\n  postgres://\u003cuser\u003e:\u003cpassword\u003e@/\u003cdatabase\u003e?host=/cloudsql/\u003cinstance_name\u003e\n  ```\n 5. for migration, add a network temp as [here](https://cloud.google.com/sql/docs/postgres/configure-ip)\n 6. Test connection\n  ```\n  psql -h \u003cCloudSQL IP\u003e -p 5432 -U \u003cUser\u003e -d \u003cDatabase\u003e\n  ```\n 7. Appendix. After create the schema, to recreate a new schema\n  ```\n  create schema public;\n  grant usage on schema public to public;\n  grant create on schema public to public;\n  ```\n\n\n## Migration\n```\ncd ./sqlc/schema\ngoose create alter_table_name sql\ncd ../\ndocker-compose -f docker-compose.autogen.yml up\n```\nthen edit the file in sqlc/schema/YYYYMMDD_alter_table_name.sql\nSee for more information [here](https://github.com/pressly/goose)\n\n## Auto-generated Docs\n[ER relationships](https://raw.githubusercontent.com/tk42/bbff/main/dbdoc/schema.svg) and [schema table](./dbdoc/README.md) are auto-generated by tbls\n\n## Reference\n - [Hasuraがめちゃくちゃ便利だよという話](https://qiita.com/maaz118/items/9e198ea91ad8fc624491)\n - [Hasuraを使ってみた](https://qiita.com/kyamamoto9120/items/e0f3f15dac9ff532e202)\n - [SELECT構文：JOINを使ってテーブルを結合する](https://rfs.jp/sb/sql/s03/03_3.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftk42%2Fbbff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftk42%2Fbbff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftk42%2Fbbff/lists"}