Skip to main content

Google Bucket

Google Cloud Service provides file storage in Buckets. When you enable and synchronize the plugin, it will enable you to get the URL of all files stored in the bucket to use in your application. This is useful when you have a large amount of static assets, need to orginize your static assets in a folder structure or easily need to replace static assets during the development of the application.

Note that the bucket must be public to internet in order to get the DynaMaker application to work.

1. Google Cloud Service Account

A. Create a bucket

B. Set CORS policy for bucket:

  • Read more in their guide: https://cloud.google.com/storage/docs/using-cors
  • Example-policy:
    [
    {
    "origin": ["https://app.dynamaker.com", "https://deployed.dynamaker.com"],
    "method": ["GET"],
    "responseHeader": ["Content-Type"],
    "maxAgeSeconds": 3600
    }
    ]

C. Create service account

Create a service account to use when connecting the application to the Bucket.


2. DynaMaker Plugin

A. Enable Plugin

Once you have your account key:

  • Go to your app dashboard, under Plugins, look for the plugin Google Bucket.
  • Fill in the name of your bucket, paste the account key you got from Google, enable the plugin and save.
  • Press Synchronize to synchronize your application to your Bucket

B. Use Plugin

  • Go to a Component Container of your app.
  • Import PLUGINS in edit/hide imports... at the top of the code editor as if it's a subcomponent.
  • Use PLUGINS.GOOGLE_STATIC.getUrl('my_file.glb') to get the URL of the file that can be sent as input to SKYCAD.MeshModel(), which is the equivalent of a static 3D, as shown in the example below:
      generateGeometry() {
    const geometryGroup = new SKYCAD.GeometryGroup()
    const url = PLUGINS.GOOGLE_STATIC.getUrl('Table.glb')
    const model = new SKYCAD.MeshModel(url)
    geometryGroup.addGeometry(model, { scale: 1000 })

    return geometryGroup
    }