{"id":20878681,"url":"https://github.com/hukusuke1007/firestore_data_modeling_design","last_synced_at":"2025-10-03T23:58:08.475Z","repository":{"id":57233818,"uuid":"415982041","full_name":"hukusuke1007/firestore_data_modeling_design","owner":"hukusuke1007","description":"firestore data modeling design","archived":false,"fork":false,"pushed_at":"2022-01-09T17:02:07.000Z","size":104,"stargazers_count":10,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-05T09:57:09.418Z","etag":null,"topics":["ballcap","dart","firebase","firestore","freezed","typescript","yaml"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fdmd","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hukusuke1007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-11T15:19:40.000Z","updated_at":"2025-01-27T09:10:47.000Z","dependencies_parsed_at":"2022-09-04T23:00:43.226Z","dependency_job_id":null,"html_url":"https://github.com/hukusuke1007/firestore_data_modeling_design","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/hukusuke1007/firestore_data_modeling_design","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hukusuke1007%2Ffirestore_data_modeling_design","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hukusuke1007%2Ffirestore_data_modeling_design/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hukusuke1007%2Ffirestore_data_modeling_design/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hukusuke1007%2Ffirestore_data_modeling_design/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hukusuke1007","download_url":"https://codeload.github.com/hukusuke1007/firestore_data_modeling_design/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hukusuke1007%2Ffirestore_data_modeling_design/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278245386,"owners_count":25955016,"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","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ballcap","dart","firebase","firestore","freezed","typescript","yaml"],"created_at":"2024-11-18T07:13:48.204Z","updated_at":"2025-10-03T23:58:08.456Z","avatar_url":"https://github.com/hukusuke1007.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fdmd\n\nFirebase Data Modeling Desing Tool. yaml =\u003e firestore modeling code.\n\nhttps://www.npmjs.com/package/fdmd\n\n## Install\n\nInstall to your project (recommand).\n\n```sh\nnpm install --save-dev fdmd\n```\n\n## Run\n\nCopy from yaml dir and template dir to your current directory.\n\n[yaml](./yaml/)\u003cbr\u003e\n[template](./template/)\n\n```sh\n# generate code\nnode_modules/.bin/fdmd\n\n# generate code with options\nnode_modules/.bin/fdmd --generate all --inputFile yaml/db.yaml --tempDir template\n```\n\n| command options | details                                 | remarks                          |\n| --------------- | --------------------------------------- | -------------------------------- |\n| --generate      | all (default `all`)                     | auto generate code type          |\n| --inputFile     | modeling yaml (default `yaml/db.yaml` ) | input data to auto generate code |\n| --tempDir       | template code (default `template`)      | input data to auto generate code |\n\n### Support language\n\n| generate code              | support | command          | generate code example                           |\n| -------------------------- | ------- | ---------------- | ----------------------------------------------- |\n| All                        | ◯       | all              | [code](./example/fdmd_output/)                  |\n| Dart                       | -       | -                | -                                               |\n| Dart - Freezed             | ◯       | dart_freezed     | [code](./example/fdmd_output/dart_freezed/)     |\n| TypeScript                 | -       | -                | -                                               |\n| TypeScript - Ballcap-Admin | ◯       | ts_ballcap_admin | [code](./example/fdmd_output/ts_ballcap_admin/) |\n| Swift                      | -       | -                | -                                               |\n| Swift - Ballcap            | -       | -                | -                                               |\n| Kotlin                     | -       | -                | -                                               |\n\n## Data Modeling\n\nCan be design data modeling with yaml file.\n\n| type      | support |\n| --------- | ------- |\n| string    | ◯       |\n| int       | ◯       |\n| double    | ◯       |\n| timestamp | ◯       |\n| map       | ◯       |\n| array     | ◯       |\n| any       | ◯       |\n| bool      | ◯       |\n| nullable  | ◯       |\n\n### How to design yaml\n\n[yaml sample](./yaml/db.yaml)\n\n#### Document\n\n```yaml\ndocs: # add\n  - name: Poster\n    path: /social/${socialId}/posters/${posterId}\n    description: 投稿者の情報\n    codeGenerate: true # code generate\n    data:\n      - field: id\n        type: string # non nullable\n        example: DocumentId\n      - field: name\n        type: string,nullable # nullable\n        example: ケン\n      - field: age\n        type: int,nullable\n        example: 10\n      - field: createdAt\n        type: timestamp,nullable\n        example: '2021-09-16T13:10:52+09:00'\n      - field: updatedAt\n        type: timestamp,nullable\n        example: '2021-09-16T13:10:52+09:00'\n```\n\nMap model\n\n```yaml\nmaps: # add\n  - name: ThumbnailImage\n    description: 画像情報\n    codeGenerate: true\n    data:\n      - field: url\n        type: string\n        example: https://sample/image.jpg\n      - field: path\n        type: string\n        example: /social/${socialId}/users/${userId}/images/${imageId}\n```\n\nReference map model\n\n```yaml\ndocs:\n  - name: Poster\n    path: /social/${socialId}/posters/${posterId}\n    description: 投稿者の情報\n    codeGenerate: true\n    data:\n      - field: image\n        type: map,nullable\n        map:\n          reference: ThumbnailImage # add. same maps name\nmaps:\n  - name: ThumbnailImage # add. same docs name\n    description: 画像情報\n    codeGenerate: true\n    data:\n      - field: url\n        type: string\n        example: https://sample/image.jpg\n      - field: path\n        type: string\n        example: /social/${socialId}/users/${userId}/images/${imageId}\n```\n\n#### Collection\n\n```yaml\ndocs:\n  - name: Poster\n    path: /social/${socialId}/posters/${posterId}\n    description: 投稿者の情報\n    codeGenerate: true\n    data:\n      - field: name\n        type: string,nullable\n        example: ケン\n    collections: # add\n      - field: posts\n        type: Post\n  - name: Post\n    path: /social/${socialId}/posters/${posterId}/posts/${postId}\n    description: 投稿情報\n    codeGenerate: true\n    data:\n      - field: title\n        type: string,nullable\n        example: タイトル\n      - field: text\n        type: string,nullable\n        example: テキスト内容\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhukusuke1007%2Ffirestore_data_modeling_design","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhukusuke1007%2Ffirestore_data_modeling_design","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhukusuke1007%2Ffirestore_data_modeling_design/lists"}