Deploying
Running in a Kubernetes cluster
TODO: Write
For developers
Set up development environment
1. Create user config
This config will be picked up automatically
2. Create database and migrate
3. Create user
Export the user ID as an environment variable, we'll use it later. USER_ID should be 1 as in this example, if the database is clean. We'll also store SUPERUSER_ID for CLI access.
4. Create organization
5. Associate all roles to superuser
NOTE: ORGANIZATION_ID might be something different than 1.
6. Start the API server
7. (Optional) Store API token for conveniently making API calls
NOTE: The stored API token will have to be updated every 7 days for the api command to work.
Pro tip! You can use cargo-watch to have the server restart every time the code changes.
8. Start the frontend
This is easy! Just do:
Creating data via API
Currently the only way to create categories, prices, styles etc is via the API.
For example, to create a category called T-Shirts:
|
A style:
|
A color, associated with the above style:
|
A size, associated with the above color:
|
Notice how we're doing PUT requests here, with an External ID specified in the URL. This would be the typical way of syncing data from your ERP system.