Browse Source

Merge pull request #98 from nameczz/main

Add client readme and update sdk version
Tumao 4 years ago
parent
commit
a203febaa9
2 changed files with 62 additions and 37 deletions
  1. 41 26
      client/README.md
  2. 21 11
      server/yarn.lock

+ 41 - 26
client/README.md

@@ -1,46 +1,61 @@
-# Getting Started with Create React App
+# Milvus insight client
 
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+## How to run
 
-## Available Scripts
+1. yarn install
+2. yarn start
 
-In the project directory, you can run:
+## Folder Structure
 
-### `yarn start`
+    └── public                    # Static resources
+    └── src
+      ├── assets                  # Put images here
+      ├── components              # Components
+      ├── consts                  # Constant values
+      ├── context                 # React context
+      ├── hooks                   # React hooks
+      ├── http                    # Http request api. And we have http interceptor in GlobalEffect.tsx file
+      ├── i18n                    # Language i18n
+      ├── pages                   # All pages , business components and types.
+      ├── router                  # React router, control the page auth.
+      ├── styles                  # Styles, normally we use material to control styles.
+      ├── types                   # Global types
+      └── utils                   # The common functoins
 
-Runs the app in the development mode.\
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
+### How to name the file
 
-The page will reload if you make edits.\
-You will also see any lint errors in the console.
+We use Camel-Case to name the file.
 
-### `yarn test`
+In components / pages folder, we need subfolder to wrapper all related files.
 
-Launches the test runner in the interactive watch mode.\
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
+### Global Effect
 
-### `yarn build`
+We get global data or take global side effect in components/layout/GlobalEffect
 
-Builds the app for production to the `build` folder.\
-It correctly bundles React in production mode and optimizes the build for the best performance.
+### Http request
 
-The build is minified and the filenames include the hashes.\
-Your app is ready to be deployed!
+We support user to define HOST_URL when docker run and it will write the env-config.js in public folder.
 
-See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
+We use class getter to define our client fields like \_field, because of our server response fields may be changed.
 
-### `yarn eject`
+### Helper Folder
 
-**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
+Like utils / consts / utils / hooks , we dont want put all functions or datas in one file like index.ts because of maintainability.
 
-If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
+So when we need to create new file , treat the file like Class then name it.
 
-Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
+### Icon
 
-You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
+We put all icons in components/icons file. Normally we use material icon.
 
-## Learn More
+If we use custom svg, like: import { ReactComponent as MilvusEmIcon } from xxx/xxx.svg'.
 
-You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
+It's react component because of svgr/webpack in webpack config.
 
-To learn React, check out the [React documentation](https://reactjs.org/).
+### Build
+
+We use react-app-rewired to change webpack config.
+
+If we want to change the webpack config, we can edit config-overrides.js file.
+
+And we use milvus insight server to host our client site. So our build path is `../server/build` .

+ 21 - 11
server/yarn.lock

@@ -379,16 +379,16 @@
     strip-json-comments "^3.1.1"
 
 "@grpc/grpc-js@^1.2.12":
-  version "1.3.2"
-  resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.3.2.tgz#eae97e6daf5abd49a7818aadeca0744dfb1ebca1"
-  integrity sha512-UXepkOKCATJrhHGsxt+CGfpZy9zUn1q9mop5kfcXq1fBkTePxVNPOdnISlCbJFlCtld+pSLGyZCzr9/zVprFKA==
+  version "1.3.4"
+  resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.3.4.tgz#5c4f5df717cd10cc5ebbc7523504008d1ff7b322"
+  integrity sha512-AxtZcm0mArQhY9z8T3TynCYVEaSKxNCa9mVhVwBCUnsuUEe8Zn94bPYYKVQSLt+hJJ1y0ukr3mUvtWfcATL/IQ==
   dependencies:
     "@types/node" ">=12.12.47"
 
 "@grpc/proto-loader@^0.6.0":
-  version "0.6.2"
-  resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.2.tgz#412575f3ff5ef0a9b79d4ea12c08cba5601041cb"
-  integrity sha512-q2Qle60Ht2OQBCp9S5hv1JbI4uBBq6/mqSevFNK3ZEgRDBCAkWqZPUhD/K9gXOHrHKluliHiVq2L9sw1mVyAIg==
+  version "0.6.4"
+  resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.4.tgz#5438c0d771e92274e77e631babdc14456441cbdc"
+  integrity sha512-7xvDvW/vJEcmLUltCUGOgWRPM8Oofv0eCFSVMuKqaqWJaXSzmB+m9hiyqe34QofAl4WAzIKUZZlinIF9FOHyTQ==
   dependencies:
     "@types/long" "^4.0.1"
     lodash.camelcase "^4.3.0"
@@ -973,11 +973,16 @@
   resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a"
   integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==
 
-"@types/node@*", "@types/node@>=12.12.47", "@types/node@>=13.7.0":
+"@types/node@*":
   version "15.12.2"
   resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.2.tgz#1f2b42c4be7156ff4a6f914b2fb03d05fa84e38d"
   integrity sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww==
 
+"@types/node@>=12.12.47", "@types/node@>=13.7.0":
+  version "15.12.5"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-15.12.5.tgz#9a78318a45d75c9523d2396131bd3cca54b2d185"
+  integrity sha512-se3yX7UHv5Bscf8f1ERKvQOD6sTyycH3hdaoozvaLxgUiY5lIGEeH37AD0G0Qi9kPqihPn0HOfd2yaIEN9VwEg==
+
 "@types/node@^14.14.36":
   version "14.17.3"
   resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.3.tgz#6d327abaa4be34a74e421ed6409a0ae2f47f4c3d"
@@ -1288,9 +1293,9 @@
   integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==
 
 "@zilliz/milvus2-sdk-node@^0.1.0":
-  version "0.1.0"
-  resolved "https://registry.yarnpkg.com/@zilliz/milvus2-sdk-node/-/milvus2-sdk-node-0.1.0.tgz#feab0f956a84f73e228d40ce4efc358e86c97e60"
-  integrity sha512-sehxvOndtqFknKdHYSaoks1kZo5q8t72mHqWiduIwsuIsCkpQMoOUyHOpWXvakWajrKrfksIdgn2oaUj5/JcBQ==
+  version "0.1.1"
+  resolved "https://registry.yarnpkg.com/@zilliz/milvus2-sdk-node/-/milvus2-sdk-node-0.1.1.tgz#4f099e16545b3af98fbbbca122978060803db7a7"
+  integrity sha512-Jc9qtPGU9m/4YP87ugf7Iaci5pdK4B2CukFf/TKbSFB7JFzA8WmhsltwfslscgKeKkSRegiGUIGUNJdI8o8isQ==
   dependencies:
     "@grpc/grpc-js" "^1.2.12"
     "@grpc/proto-loader" "^0.6.0"
@@ -6172,7 +6177,7 @@ yaml@^1.7.2:
   resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
   integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
 
-yargs-parser@20.x, yargs-parser@^20.2.2:
+yargs-parser@20.x:
   version "20.2.7"
   resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.7.tgz#61df85c113edfb5a7a4e36eb8aa60ef423cbc90a"
   integrity sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==
@@ -6185,6 +6190,11 @@ yargs-parser@^18.1.2:
     camelcase "^5.0.0"
     decamelize "^1.2.0"
 
+yargs-parser@^20.2.2:
+  version "20.2.9"
+  resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee"
+  integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==
+
 yargs@^15.4.1:
   version "15.4.1"
   resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8"