From 9a21846586862d8878d832b131b75e3a91af5860 Mon Sep 17 00:00:00 2001 From: Barry Low Date: Fri, 12 Oct 2018 11:18:52 -0700 Subject: [PATCH] Update docs + add client .env.example --- README.md | 77 +++++++++++++++++++++++++++++++++- client/.env.example | 15 +++++++ docs/RefactorModuletoMaster.md | 1 + 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 client/.env.example diff --git a/README.md b/README.md index c9918bd15..6aa3c0886 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,77 @@ # MasterApp -Responsible for loading all web modules and running them. +The Master App is an application layer that wraps the client-side web modules of the various Advanced Algos platform modules (Users, Teams, KeyVault, Financial Beings, Hosts, etc). +It provides, to these modules, an authentication layer and GraphQL data layer, among other commonly used utilities and APIs. + +Each client-side module is published as an NPM package and their function is best described as a +React higher-order component encasing their given module use cases. + +## Developing with the Master App + +### Getting Started + +Clone the repo. + +``` +git clone https://github.com/AdvancedAlgos/MasterApp.git +cd MasterApp +``` + +**Setup Server** + +``` +cd server +npm install +``` +Rename `.env.example` to `.env` + +Start the server: + +``` +npm run start +``` + +**Setup Client** + +In another CLI window, navigate to the MasterAoo/client + +``` +cd ../client +npm install +``` + +Rename `.env.example` to `.env`. Get Auth0 Client ID from team member + +Start the client: + +``` +npm run dev + +# or if on windows +npm run dev_win +``` + +### Working with existing modules + +Using the `npm link` command, we can develop a module locally before publishing as a package on npm. + +In the client of the module to be developed: + +``` +npm link +``` + +Make note of the module package name — the name in the module's client package.json. *e.g. @advancedalgos/key-vault-client* + +In the Master app client dir link the developing module: + +``` +# in MasterApp/client +npm link + +e.g. +npm link @advancedalgos/key-vault-client +``` + +### Starting a new module + +*We are currently developing a boilerplate that will accelerate starting a new module and works easily within the MasterApp.* diff --git a/client/.env.example b/client/.env.example new file mode 100644 index 000000000..fa326946a --- /dev/null +++ b/client/.env.example @@ -0,0 +1,15 @@ +PORT=3100 +NODE_ENV=development + +DEV_GRAPHQL=http://localhost:4100/graphql +PROD_GRAPHQL=https://app.advancedalgos.net/graphql + +AUTH0_DOMAIN=advancedalgos.eu.auth0.com +AUTH0_AUDIENCE=https://auth-dev.advancedalgos.net +AUTH0_ISSUER=https://advancedalgos.eu.auth0.com/ +AUTH0_CLIENTID= + +AUTH0_CALLBACK_URL=http://localhost:3100/callback +AUTH0_LOGOUT_URL=http://localhost:3100 +AUTH0_PROD_CALLBACK_URL=https://app.advancedalgos.net/callback +AUTH0_PROD_LOGOUT_URL=https://app.advancedalgos.net diff --git a/docs/RefactorModuletoMaster.md b/docs/RefactorModuletoMaster.md index c54354c5c..3cd74a4c7 100644 --- a/docs/RefactorModuletoMaster.md +++ b/docs/RefactorModuletoMaster.md @@ -7,6 +7,7 @@ 5. Update auth handling. Pass as props or pull from local storage. 6. Remove header and footer. 7. Update [Material-UI Typography variants](https://material-ui.com/style/typography/#migration-to-typography-v2) +8. Add react hot module: `npm i react-hot-loader -D` ## Developing Module with Master App