mirror of
https://github.com/kiteco/kiteco-public.git
synced 2022-11-21 08:18:27 +03:00
Development Guide
React App
The base Kite Answers code lives in ./web/render. A complementary React app for previewing lives in ./web/preview.
To test any changes, you'll need to:
- run
npm linkin the./web/renderdirectory, thennpm link @kiteco/kite-answers-renderer, in either the Preview app, or the Webapp.- This only needs to be done once, unless the dependency is re-installed (during the deployment process, we run
npm i @kiteco/kite-answers-renderer@latestto grab the latest changes).
- This only needs to be done once, unless the dependency is re-installed (during the deployment process, we run
- Build the app, either with
npm run build-dev, ornpm run build-prodfor an obfuscated output file. This needs to happen each time the renderer is updated. - Run the preview app or webapp with
npm run.- For the Webapp, optional args may be passed in to hit different hostnames, refer to each package's
package.jsonfor details. - The preview app's endpoints are defined in
./web/preview/utils/constants.js. Until the process is improved, we'll need to update the values manually if another hostname is desired.
- For the Webapp, optional args may be passed in to hit different hostnames, refer to each package's
Preview Server
To test changes with the go preview server:
- Execute
go run ./go/cmds/preview-server/ - You can open
localhostin your browser to render the currently bindata'd React bundle.
To deploy changes to the preview server:
- Make sure you have credentials to our team's prviate npm repo
- If any changes were made in the
renderpackage, from the project's root dir, runnpm version {x}wherexincrements the current version inpackage.json, thennpm publish. - Go to the root
kite-answersdirectory. Runmake preview-app && make assets && make deploy-preview.
Publishing Flow
To run the publishing command line tool, you'll need:
- AWS CLI
- AWS Credentials
- Docker Desktop (for first time setup, go to
./go/execution/sandbox/and run the Makefile to setup dependencies). - Access to https://github.com/kite-answers/answers
For now, we'll need to check out and pull the repo locally to grab the latest content.
To run the actual tool:
- Run
go run ./go/publish/main.go {...}where{...}is the path to the Kite Answers posts path. - Wait for the output file to be generated. (Current implementation will take awhile).
- Upload file to S3 in the bucket
kite-data/kite-answers.