A Project to quickly bootstrap new commercetools projects.
To bootstrap a new project follow these simple steps: Let's assume you want to setup a new b2c store.
- Create a branch to avoid overriding data and also to be able to commit your .env files and terraform states
- Create a project in MC and create an API client
- Copy and paste the credentials to ./b2c/typescript/.env
- Run
yarn install
to install all required NPM dependencies - Run
cd ./shared-code
- Run
yarn run build
Now you are good to go.
Now it is time to run terraform.
- Run
cd ./b2c/terraform
- Run
terraform init
andterraform plan
- Run
terraform apply
to apply the configuration.
Now run the typescript importer files to do create product, variants, prices, inventory, categories and customers...
cd ../typescript
yarn run bootstrap
The menu will guide you from here.
Now validate the import
The importing process supports translation via Google Translate. All you need to do is
- Login to google using
google-cli
- Configure the parameter
TRANSLATION_ENABLED="true"
in your.env
file Since this comes at a cost, the result from Google is stored in a JSON file to mimic a poor man's translation memory system.
During development you might not always want to run a real import. Therefore set the flag DRY_RUN=true
within your .env
file.
Since most of the magic is happening within the ./shared-folder
directory, you can run a yarn run watch
or yarn run test
here to continuously build or test your changes.