|  | 
|  | 1 | +<h1 align="center">Seedlingo Apiary</h1> | 
|  | 2 | +<h3 align="center">Content editor for Seedlingo</h3> | 
|  | 3 | +<p align="center"> | 
|  | 4 | +  <img src="../docs/.vuepress/public/images/seedlingo-logo-blue.svg" | 
|  | 5 | +    alt="seedlingo-logo" height="160px" width="160px"/> | 
|  | 6 | +  <br/> | 
|  | 7 | +  <b>Modern mobile multi-language literacy</b> | 
|  | 8 | +  <br/> | 
|  | 9 | +  <i>A first-language digital learning tool for adults</i> | 
|  | 10 | +</p> | 
|  | 11 | +<hr> | 
|  | 12 | + | 
|  | 13 | +# Seedlingo Apiary | 
|  | 14 | + | 
|  | 15 | +Seedlingo Apiary is a content editor for the language learning tool [Seedlingo](../README.md). | 
|  | 16 | + | 
|  | 17 | + | 
|  | 18 | +## Setup | 
|  | 19 | + | 
|  | 20 | +Make sure to install the dependencies: | 
|  | 21 | + | 
|  | 22 | +```sh | 
|  | 23 | +npm install | 
|  | 24 | +``` | 
|  | 25 | + | 
|  | 26 | +## Development server | 
|  | 27 | + | 
|  | 28 | +Start the development server on `http://localhost:3000`: | 
|  | 29 | + | 
|  | 30 | +```sh | 
|  | 31 | +npm run dev | 
|  | 32 | +``` | 
|  | 33 | + | 
|  | 34 | +## Production | 
|  | 35 | + | 
|  | 36 | +Build the application for production: | 
|  | 37 | + | 
|  | 38 | +```sh | 
|  | 39 | +npm run build | 
|  | 40 | +``` | 
|  | 41 | + | 
|  | 42 | +Locally preview production build: | 
|  | 43 | + | 
|  | 44 | +```sh | 
|  | 45 | +npm run preview | 
|  | 46 | +``` | 
|  | 47 | + | 
|  | 48 | +## AWS Amplify setup | 
|  | 49 | + | 
|  | 50 | +1. Sign up for a user at | 
|  | 51 | +   [AWS](https://signin.aws.amazon.com/signup?request_type=register). | 
|  | 52 | +2. Navigate to [Amplify](https://console.aws.amazon.com/amplify). | 
|  | 53 | +3. Press `Create new app`-button. | 
|  | 54 | +4. At `Choose source code provider`, select `Github` and press `Next`. | 
|  | 55 | +5. In the popup, log in to Github with credentials that has access to the | 
|  | 56 | +   Seedlingo repo. | 
|  | 57 | +6. In the first dropdown, select `nodepa/seedlingo`. In the second dropdown, | 
|  | 58 | +   select `main`. Also check the box for `My app is a monorepo`, then press | 
|  | 59 | +   `Next`. | 
|  | 60 | +7. Enter the name of the app, i.e. `Seedlingo Apiary`. Leave the rest at | 
|  | 61 | +   defaults and press `Next`. (The `Frontend build command` and `Build output | 
|  | 62 | +   directory` will be overridden by the content of the `amplify.yml` file | 
|  | 63 | +   anyway, see `Edit YML file` for details/content). | 
|  | 64 | +8. Press `Save and deploy`. | 
|  | 65 | +9. If deploy fails, hunt for clues under `Deployments`. A log of all the build | 
|  | 66 | +   steps can be found by expanding the `Build` line. | 
|  | 67 | +10. If the deploy succeeds, any new git push to the same branch, i.e. `main`, | 
|  | 68 | +    will be picked up and deployed immediately. | 
|  | 69 | +11. Test the deploy in the browser by pressing the `Domain` link under | 
|  | 70 | +    `Deployments` or pressing the `Visit deployed URL` button under `Overview`. | 
|  | 71 | + | 
|  | 72 | +## Amplify sandbox for local dev | 
|  | 73 | + | 
|  | 74 | +This guide is based on the [account setup guide]( | 
|  | 75 | +  https://docs.amplify.aws/vue/start/account-setup/ | 
|  | 76 | +) in the Amplify docs. | 
|  | 77 | + | 
|  | 78 | +1. Install [AWS CLI]( | 
|  | 79 | +     https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html | 
|  | 80 | +   ). | 
|  | 81 | +   It is available as a Snap package for Ubuntu and similar. | 
|  | 82 | + | 
|  | 83 | +   ``` sh | 
|  | 84 | +   snap install aws-cli --classic | 
|  | 85 | + | 
|  | 86 | +   # verify installation with: | 
|  | 87 | +   aws --version | 
|  | 88 | +   ``` | 
|  | 89 | + | 
|  | 90 | +2. Configure SSO (if you don't have an AWS SSO user, see | 
|  | 91 | +   [IAM Identity Center SSO setup](#iam-identity-center-sso-setup)) | 
|  | 92 | + | 
|  | 93 | +   ```sh | 
|  | 94 | +   aws configure sso | 
|  | 95 | + | 
|  | 96 | +   # SSO session name: [assigned sso user, i.e. amplify-admin-1] | 
|  | 97 | +   # SSO start URL: https://d-966742a7b4.awsapps.com/start/ | 
|  | 98 | +   # SSO region: ap-southeast-1 | 
|  | 99 | +   # SSO registration scopes: [leave blank] | 
|  | 100 | + | 
|  | 101 | +   # When the browser opens, log in with your aws-sso user | 
|  | 102 | +   ``` | 
|  | 103 | + | 
|  | 104 | +3. Verify | 
|  | 105 | + | 
|  | 106 | +   ```sh | 
|  | 107 | +   aws amplify list-apps | 
|  | 108 | +   ``` | 
|  | 109 | + | 
|  | 110 | +4. Create sandbox for local dev | 
|  | 111 | + | 
|  | 112 | +   ```sh | 
|  | 113 | +   # from within `seedlingo/editor` | 
|  | 114 | +   npm run sandbox | 
|  | 115 | +   ``` | 
|  | 116 | + | 
|  | 117 | +### IAM Identity Center SSO setup | 
|  | 118 | + | 
|  | 119 | +To set up a SSO user with the correct permissions, | 
|  | 120 | +follow the [account setup guide]( | 
|  | 121 | +  https://docs.amplify.aws/vue/start/account-setup/ | 
|  | 122 | +) in the Amplify docs. | 
|  | 123 | +Then make use of the SSO user as described in | 
|  | 124 | +[Amplify sandbox for local dev](#amplify-sandbox-for-local-dev). | 
|  | 125 | + | 
|  | 126 | +In short, create a SSO user with the permission | 
|  | 127 | +`AmplifyBackendDeployFullAccess`. | 
|  | 128 | + | 
|  | 129 | +# Dependency upgrade process | 
|  | 130 | + | 
|  | 131 | +```sh | 
|  | 132 | +npx nuxi@latest upgrade | 
|  | 133 | +npm outdated | 
|  | 134 | +npm update -S | 
|  | 135 | +``` | 
0 commit comments