
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
📑 Table of Contents
yarn or yarn installyarn devyarn build & yarn start 3000yarn testyarn release [major|minor|patch]yarn release:ci [major|minor|patch]todo:https://platypusv2.appspot.com&testKey={key}&testValues={value}**Table of content created using VSCode extension: https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
Run the following command to get your project installed, and up and running.
shgit clone git@github.com:theplatypusio/frontend.git cd frontend yarn install
yarn or yarn installInstall the modules defined in the package.json, with version from yarn.lock
yarn devRuns the app in development mode.
Open http://localhost:3000 to view it in the browser.
The page will automatically reload if you make changes to the code.
You will see the build errors and lint warnings in the console.
yarn build & yarn start 3000Builds the app to the .next folder.
Once you've runned yarn build, you can spin up the Next.js node server by running yarn start.
You'll need to suffix the start command with the Port (3000), due to our Hosting.
sh# Build the project and start the node server yarn build && yarn start 3000
yarn testRuns the test watcher in an interactive mode.
By default, runs tests related to files changed since the last commit.
[Read more about testing.] https://reactjs.org/docs/testing.html
We're deploying through https://app.circleci.com/pipelines/github/theplatypusio/frontend
test branch automatically deploys to [***]prod branch automatically deploys to [] & []We're using https://github.com/release-it/release-it to update our version number correctly, and create Github Tag & Releases.
yarn release [major|minor|patch]yarn release starts an Interactive CI which pro***s you with questions, that helps you make a decision on which kind of release it is.
You can bump a specific version, by appending either major, minor or patch.
Like so yarn release patch.
yarn release:ci [major|minor|patch]yarn release:ci starts a CI which makes a specific release, but without pro***ing questions. Instead it picks the default settings from the package.json file
Read more about release-it here: https://github.com/theplatypusio/frontend/edit/test/README.md
We're following the traditional Semver rules.
Given a version number MAJOR.MINOR.PATCH, increment the:
MAJOR version when you make incompatible API changes,MINOR version when you add functionality in a backwards compatible manner, andPATCH version when you make backwards compatible bug fixes.Read more about semver here: https://semver.org/
The creation of the docker image used by CircleCI to build the application can be found https://github.com/theplatypusio/frontend/blob/test/Dockerfile.
The Dockerfile gets build automatically by DockerHub, the docker image build step is triggered by a tag that matches the following regex expression: /^v([0-9.]+)-docker$/. The image will be tagged with the numerical part of the git tag(ex: git tag : v1.2.3-docker, docker image tag: 1.2.3). The build process takes a bit of time, to check when it's done go https://hub.docker.com/repository/docker/platypusio/cloud-sdk-nodejs12. After pushing go and delete the README from the repository, so we don't expose sensitive data, as the docker image is public (The README is automatically updated by DockerHub).
After creating a new image remember to change the image version in the CircleCI file https://github.com/theplatypusio/frontend/blob/bf432f824dc8fe618a20f0a449b3910bb33d0599/.circleci/config.yml#L14.
todo:If you're working on a task, and a issue occur, which is not solvable within scope, then create a todo: comment.
The comment should include:
When committting task, we're using the tool https://github.com/commitizen/cz-cli.
{component-name}componentutilsA description of what's been done in the commit.
https://platypusv2.appspot.com&testKey={key}&testValues={value}You can create A/B Tests by creating a unique key: testKey and provide it with values: testValues.
| Key | Value | Purpose |
|---|---|---|
testKey | string | An unique identified, to control which A/B test to execute. |
testValues | string|string[] | The value/values that you want to pass to the A/B test function |
httphttps://platypusv2.appspot.com/print_creation/intro?link_token=eyJ0eXBlIjoiYXBwbGljYW50IiwiY29tcGFueV9pZCI6MSwicG9zdGluZ19pZCI6MX0=&testKey=point_quantity&testValues=25
This is an A/B Test for Point Quantity, which is testing with the value of 25 points.
For each feature, we're creating a hook (example: usePrintCreationABTest), which is invoked which is invoked with the specific key, and optionally which store it relates to.
tsxconst { isCompleted, setTestDone } = usePrintCreationABTest({ key: 'point_quantity', // < The Unique Key as identifier storeKey: 'printCreation', // < The Redux Store });
We're tracking the speed through Speedtracker.
See the benchmarks here: https://theplatypusio.github.io/speedtracker
https://sentry.io/auth/login/theplatypus/
To report bugs/corrections/suggestions we use Marker.io.
We're using https://github.com/ds300/patch-package#readme to patch modules.
To patch a module do the following.
sh# Navigate to the node_modules folder, and then fix the issue. vim node_modules/package_name/flawful_file.js
sh# Run the patch function npx patch-package {package_name}
sh# Commit the patched file inside of the `/patches` folder. git add patches/* yarn release:ci patch
| number | Purpose / Usage |
|---|---|
| -1 | Putting stuff below other |
| 0-9 | Below overlay |
| 10-20 | Above Overlay |
src/gql/* (any file based on where it supposed to be.)Super User) and pasting the following command in the console copy(__NEXT_REDUX_STORE__.getState().auth.token) (The token will be copied to clipboard)AUTH_TOKEN={token} yarn generate --watch
PS: if you got an error regarding fields not being found check that you have the right access first (a super user is the perfect scenario) other than that issues in the query/mutation need to be fixed for it to run right.src/__generated__/graphql.ts and ready to be used and already typed.| key | values |
|---|---|
| x-hasura-role | {role} |
| x-hasura-company-id | {id} |
jq installed on your system. It is used to parse JSON returned from the login request.sh# Mac brew install jq # Linux / Windows (WSL): apt-get install jq
Make sure that you an .env file with these values:
AUTH_API_BASE_URL = The authentication service URLADMIN_MAIL = Email of the userADMIN_PASS = Pass of the userOnce you have all this, you can simply run:
sh./generate.sh
If you run into permissions issues, you can do this for Mac:
shchmod u+x ./generate.sh
This will give exec permission for the current user.
Ask a developer for the password
username: PlatyMem password: ****
Frontend repository, and clone it down.See video on how to setup: [***]
test branch. Then create a new branch called translations. (If there already is a branch called translations, delete it and recreate it using the Github Desktop).public/static/locales project in i18n Managertranslations branch, and commit the changes using the bottom left interface (Please add a commit message which gives a context of what's been translated).commit, and then make a Pull Request towards the test branch, and assign a reviewer (right side of Github Pull Request view)See video on how to create translations: [***]
features/{feature-name}
Branches for features that can include tasks or sub tasks under that it taken from test (or development later)
task/task-name
Branches for tasks which falls under a feature and is branched out from a feature branch
bugfix/bug-name
Branches for features and releases bug fixes that is branched out from a feature or a release branch
hotfix/fix-name
Branches for test hot fixes that branched out from test branch
release/release-tag
(this is not used now because we are using test directly) it's for releases branch for test needs before merging to test
feature branch out from prodfeature into test. (never pull the test branch into your feature branch)#testing channel in Slackfeature branch and create a new PR towards test.feature approved by QA, merge the feature branch into prodfeature is merged into prod, test the feature on demo. (Not prod)!Branching Strategy
/public/icons/* <- Icons that shouldn't be compiled through Webpack./src/assets/icons/* <- Icons that should be compiled through Webpack and merged into the markup.(If you haven't already, install both SVGO and the addViewBox plugin)
Run svgo src/assets/icons/* --enable=addViewBox
Add it to the <Icon /> components iconsMap
To be honst just just check the Tests written already and here is the docs https://docs.cypress.io/
https://docs.cypress.io/guides/guides/continuous-integration.html#Advanced-setup
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务