{"id":21904812,"url":"https://github.com/boostercloud/serialize-config","last_synced_at":"2026-05-19T03:41:34.010Z","repository":{"id":222642834,"uuid":"754716735","full_name":"boostercloud/serialize-config","owner":"boostercloud","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-21T15:16:35.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T07:26:02.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/boostercloud.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-08T16:27:31.000Z","updated_at":"2024-02-08T16:27:49.000Z","dependencies_parsed_at":"2024-03-21T16:47:59.236Z","dependency_job_id":null,"html_url":"https://github.com/boostercloud/serialize-config","commit_stats":null,"previous_names":["boostercloud/serialize-config"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boostercloud%2Fserialize-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boostercloud%2Fserialize-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boostercloud%2Fserialize-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boostercloud%2Fserialize-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boostercloud","download_url":"https://codeload.github.com/boostercloud/serialize-config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244918708,"owners_count":20531686,"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":[],"created_at":"2024-11-28T16:19:15.377Z","updated_at":"2026-05-19T03:41:33.920Z","avatar_url":"https://github.com/boostercloud.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serialize Config for Booster Framework Injectable\n\nWelcome to the **Serialize Config** component for Booster Framework's Injectable! This indispensable tool streamlines your infrastructure automation by serializing the Booster Config object into a JSON file. It allows for easy extraction of names and type information for your project's commands, events, entities, read models, and more. Serialize Config is perfect for use with automation tools like Terraform, enhancing your development workflow.\n\n\u003ch2\u003eTable of Contents\u003c/h2\u003e\n\n- [Features](#features)\n- [Quick Start](#quick-start)\n  - [Installation](#installation)\n  - [Modify Your Config File](#modify-your-config-file)\n- [Running Serialize Config](#running-serialize-config)\n- [Example: Leveraging Serialize Config for automatic Terraform generation](#example-leveraging-serialize-config-for-automatic-terraform-generation)\n  - [Using the CartReadModel JSON for Terraform Preconfiguration](#using-the-cartreadmodel-json-for-terraform-preconfiguration)\n  - [Example Terraform configuration for the CartReadModel](#example-terraform-configuration-for-the-cartreadmodel)\n- [Getting Help](#getting-help)\n- [Contributing](#contributing)\n- [License](#license)\n\n\n## Features\n\n- **Automation Friendly**: Facilitates infrastructure as code (IaC) practices by making your Booster project's configuration accessible in JSON format.\n- **Comprehensive Project Insights**: Gain detailed insights into your project's commands, events, entities, read models, and more.\n- **Seamless Integration**: Integrate Serialize Config into your Booster project effortlessly to enhance your infrastructure automation.\n\n## Quick Start\n\nFollow these steps to integrate Serialize Config into your Booster project:\n\n### Installation\n\nFirst, install Serialize Config via npm by running the following command in your project directory:\n\n```bash\nnpm install @boostercloud/serialize-config\n```\n\n### Modify Your Config File\n\nTo ensure Serialize Config works seamlessly with your Booster project, modify your config file (`src/config/config.ts`) to include the injectable configuration for serialize config like so:\n\n```typescript\n// your-app/src/config/config.ts\nimport * as SerializeConfig from '@boostercloud/serialize-config'\n\nBooster.configure('YOUR_ENVIRONMENT_NAME', (config: BoosterConfig): void =\u003e {\n  // ... other config\n  config.injectable = {\n    commands: [SerializeConfig.command],\n  }\n})\n\n\n```\n\n## Running Serialize Config\n\nOnce you've set up Serialize Config in your Booster project, executing it is straightforward. To generate the serialized Booster configuration JSON file, run the following command from your project's root directory:\n\n```bash\nboost serialize-config -e YOUR_ENVIRONMENT_NAME\n```\n\nThis command provides you with additional options and usage information for the Serialize Config command.\n\nBy default, the output JSON file will be saved to `.booster/infra-config.json` within your project directory. If you wish to specify a different output location, you can use the `--output` flag followed by your desired path. Here's an example command that demonstrates this:\n\n```bash\nboost serialize-config -e local --output path/to/your/custom-config.json\n```\n\nThis flexibility allows you to integrate the serialized configuration seamlessly into your infrastructure automation workflows.\n\n## Example: Leveraging Serialize Config for automatic Terraform generation\n\nTo illustrate how Serialize Config can be used to preconfigure resources with Terraform, let’s consider a simplified example from a JSON output, focusing on a specific section named `CartReadModel`. This model outlines the structure and data types of a shopping cart in an e-commerce application. Here’s a snippet highlighting key properties:\n\n```json\n\"CartReadModel\": {\n  \"properties\": [\n    {\n      \"name\": \"id\",\n      \"typeInfo\": {\n        \"name\": \"UUID\",\n        \"typeGroup\": \"Class\",\n        \"isNullable\": false\n      }\n    },\n    {\n      \"name\": \"testProperty\",\n      \"typeInfo\": {\n        \"name\": \"number\",\n        \"typeGroup\": \"Number\",\n        \"isNullable\": false\n      }\n    },\n    {\n      \"name\": \"cartItems\",\n      \"typeInfo\": {\n        \"name\": \"CartItem[]\",\n        \"typeGroup\": \"Array\",\n        \"isNullable\": false\n      }\n    },\n    {\n      \"name\": \"shippingAddress\",\n      \"typeInfo\": {\n        \"name\": \"Address\",\n        \"typeGroup\": \"Class\",\n        \"isNullable\": true\n      }\n    }\n  ]\n}\n```\n\nThis JSON snippet includes an identifier (`id`), a test property (`testProperty`), an array of cart items (`cartItems`), and a shipping address (`shippingAddress`). Each property has associated type information, such as `UUID` for the `id` or `CartItem[]` for the list of items in the cart, indicating the expected data structure and types for these fields.\n\n### Using the CartReadModel JSON for Terraform Preconfiguration\n\nGiven the CartReadModel example, you can use this structured information to preconfigure Terraform resources, ensuring that your infrastructure aligns with the application’s data models. Here’s how to approach this:\n\n- **Define Database Schema**: Extract key information from the CartReadModel to define the schema of a database table. Each property in the JSON maps to a column in the table, with the typeInfo indicating the data type.\n\n- **Terraform Resource Definition**: Use the schema information to create a Terraform resource definition for a database table. For instance, if using AWS DynamoDB, define attributes and their types based on the model’s properties.\n\n### Example Terraform configuration for the CartReadModel\n\n```tf\nresource \"aws_dynamodb_table\" \"cart_table\" {\n  name           = \"Cart\"\n  hash_key       = \"id\"\n  billing_mode   = \"PROVISIONED\"\n\n  attribute {\n    name = \"id\"\n    type = \"S\" # String type for UUID\n  }\n\n  attribute {\n    name = \"testProperty\"\n    type = \"N\" # Number\n  }\n\n  ...\n}\n```\n\nBy following these steps, developers can leverage the detailed structure provided by Serialize Config to ensure their Terraform configurations accurately reflect the application’s data models, streamlining the infrastructure setup and maintenance process.\n\n## Getting Help\n\nShould you face any challenges or have questions regarding Serialize Config, please consult the [Booster Framework documentation](https://docs.booster.cloud/) or join our vibrant community on the Discord server (link available in the docs). Our community and contributors are eager to assist.\n\n## Contributing\n\nContributions to Serialize Config are warmly welcomed. Whether it's enhancing documentation, adding features, or reporting issues, your input helps us improve. Please refer to our [contributing guidelines](https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md) for more information.\n\n## License\n\nSerialize Config is open-source software licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).\n\n---\n\nDive into the world of efficient infrastructure automation with Serialize Config and elevate your Booster Framework projects to new heights!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboostercloud%2Fserialize-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboostercloud%2Fserialize-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboostercloud%2Fserialize-config/lists"}