Database CMS seeding
Now that all shopify products are synced to the shophub database, you may consider seeding your database with mock data for CMS banners.
Backend docker container id
Once your docker is up and running, we need to connect our terminal to the bash of the docker to run commands. First of all will we need the hash of the backend docker container:
docker psThis will list all currently running docker container.
Copy the id of the shophub-backend container. In this example this would be fad8383f5e73.
Docker bash
Now we can connect to the dockers bash. Replace <shophub-backend-docker-id> with the id of the docker container.
docker exec -it <shophub-backend-docker-id> bashRun seeding script
Now we are inside the bash and can run the seeding script, that is located in the backend. So first of all we need to navigate into the backend package
cd packages/backendNow lets run the seeding script.
npx ts-node src/db/seed-cms.tsOnce completed we can close the terminated the connection to the docker bash. The database should now be populated with a bunch of mock banners, useful for development and testing.