From bfc6504e4746807cf0205e2f74ab82a2b8d72cf3 Mon Sep 17 00:00:00 2001 From: Qolzam Date: Tue, 16 Jan 2018 12:59:30 +0700 Subject: [PATCH] [Readme] Update installation instruction --- README.md | 44 +++++++------------ docs/README.md | 44 +++++++------------ docs/app/configure/development.env | 3 +- docs/app/configure/production.env | 6 +++ .../services/authorize/AuthorizeService.ts | 1 - 5 files changed, 40 insertions(+), 58 deletions(-) create mode 100644 docs/app/configure/production.env diff --git a/README.md b/README.md index 5f73fc4..e7fdbcc 100644 --- a/README.md +++ b/README.md @@ -68,38 +68,26 @@ and then install the package ### Installing - -#### Install back-end server/serverless -1. You need to choose and install your backend bfore installing UI - - [Firestore Social Backend](https://github.com/Qolzam/firestore-social-backend) - - [AWS Social Backend]() - - [ASP.NET Social Backend](https://github.com/Qolzam/aspnet-core-social-network) - 2. Fork the [react-social-network](https://github.com/Qolzam/react-social-network) repository on Github - 3. Clone your fork to your local machine `git clone git@github.com:/react-social-network.git` +1. Fork the [react-social-network](https://github.com/Qolzam/react-social-network) repository on Github +2. Clone your fork to your local machine `git clone git@github.com:/react-social-network.git` - > You need to configure firbase first before starting other steps. We are using firebase storage to store files, firebase database to store user information and firebase authorization to authorize user with email and password. - 4. Configure firebase: - - Get [firebase config](https://firebase.google.com/docs/web/setup) - - Create a folder in root folder `react-social-network` set the name `config` => `>react-social-network\config` - - Create three files in `>react-social-network\config` set their name `development.env` , `test.env` and `production.env` => `>react-social-network\config\development.env` and `>react-social-network\config\test.env` - - Inside the files, you should write some keys of firebase configuration (each file is depend on the environment you work in `NODE_ENV`. If you set `NODE_ENV=development` your project will use from [development.env](https://github.com/Qolzam/react-social-network/blob/master/docs/app/configure/development.env) to config firebase but if you set it `NODE_ENV=test` it will use `test.env` in test environment): +3. Choose and install your backend bfore installing UI + #### [Firestore Social Backend](https://github.com/Qolzam/firestore-social-backend) + * Configure firebase: + * Get [firebase config](https://firebase.google.com/docs/web/setup) + * Create a folder in root folder `react-social-network` set the name `config` => `>react-social-network\config` + * Create three files in `>react-social-network\config` set their name `development.env` , `test.env` and `production.env` => `>react-social-network\config\development.env` and `>react-social-network\config\test.env` + * Inside the files, you should write some keys of firebase configuration (each file is depend on the environment you work in `NODE_ENV`. If you set `NODE_ENV=development` your project will use from [development.env](https://github.com/Qolzam/react-social-network/blob/master/docs/app/configure/development.env) or [production.env](https://github.com/Qolzam/react-social-network/blob/master/docs/app/configure/production.env) to config firebase but if you set it `NODE_ENV=test` it will use `test.env` in test environment): + * [Enable Email/Password](https://firebase.google.com/docs/auth/web/password-auth) sign-in on firebase: + * In the Firebase console, open the Auth section. + * On the Sign in method tab, enable the Email/password sign-in method and click Save. + #### AWS Social Backend + #### [ASP.NET Social Backend](https://github.com/Qolzam/aspnet-core-social-network) - > API_KEY=[API_KEY]
- > AUTH_DOMAIN=[PROJECT_ID].firebaseapp.com
- > DATABASE_URL=https://[DATABASE_NAME].firebaseio.com
- > PROJECT_ID=[PROJECT_ID]
- > STORAGE_BUCKET=[BUCKET].appspot.com
- > MESSAGING_SENDER_ID=[SENDER_ID]HOST_URL
- > PORT= Local_Host_Port
- - 5. [Enable Email/Password](https://firebase.google.com/docs/auth/web/password-auth) sign-in on firebase: - - In the Firebase console, open the Auth section. - - On the Sign in method tab, enable the Email/password sign-in method and click Save. - - 6. Installing all nodejs modules: +4. Installing all nodejs modules: `npm install` - 7. Go ahead ;) +5. Go ahead ;) `npm start` diff --git a/docs/README.md b/docs/README.md index 5f73fc4..e7fdbcc 100644 --- a/docs/README.md +++ b/docs/README.md @@ -68,38 +68,26 @@ and then install the package ### Installing - -#### Install back-end server/serverless -1. You need to choose and install your backend bfore installing UI - - [Firestore Social Backend](https://github.com/Qolzam/firestore-social-backend) - - [AWS Social Backend]() - - [ASP.NET Social Backend](https://github.com/Qolzam/aspnet-core-social-network) - 2. Fork the [react-social-network](https://github.com/Qolzam/react-social-network) repository on Github - 3. Clone your fork to your local machine `git clone git@github.com:/react-social-network.git` +1. Fork the [react-social-network](https://github.com/Qolzam/react-social-network) repository on Github +2. Clone your fork to your local machine `git clone git@github.com:/react-social-network.git` - > You need to configure firbase first before starting other steps. We are using firebase storage to store files, firebase database to store user information and firebase authorization to authorize user with email and password. - 4. Configure firebase: - - Get [firebase config](https://firebase.google.com/docs/web/setup) - - Create a folder in root folder `react-social-network` set the name `config` => `>react-social-network\config` - - Create three files in `>react-social-network\config` set their name `development.env` , `test.env` and `production.env` => `>react-social-network\config\development.env` and `>react-social-network\config\test.env` - - Inside the files, you should write some keys of firebase configuration (each file is depend on the environment you work in `NODE_ENV`. If you set `NODE_ENV=development` your project will use from [development.env](https://github.com/Qolzam/react-social-network/blob/master/docs/app/configure/development.env) to config firebase but if you set it `NODE_ENV=test` it will use `test.env` in test environment): +3. Choose and install your backend bfore installing UI + #### [Firestore Social Backend](https://github.com/Qolzam/firestore-social-backend) + * Configure firebase: + * Get [firebase config](https://firebase.google.com/docs/web/setup) + * Create a folder in root folder `react-social-network` set the name `config` => `>react-social-network\config` + * Create three files in `>react-social-network\config` set their name `development.env` , `test.env` and `production.env` => `>react-social-network\config\development.env` and `>react-social-network\config\test.env` + * Inside the files, you should write some keys of firebase configuration (each file is depend on the environment you work in `NODE_ENV`. If you set `NODE_ENV=development` your project will use from [development.env](https://github.com/Qolzam/react-social-network/blob/master/docs/app/configure/development.env) or [production.env](https://github.com/Qolzam/react-social-network/blob/master/docs/app/configure/production.env) to config firebase but if you set it `NODE_ENV=test` it will use `test.env` in test environment): + * [Enable Email/Password](https://firebase.google.com/docs/auth/web/password-auth) sign-in on firebase: + * In the Firebase console, open the Auth section. + * On the Sign in method tab, enable the Email/password sign-in method and click Save. + #### AWS Social Backend + #### [ASP.NET Social Backend](https://github.com/Qolzam/aspnet-core-social-network) - > API_KEY=[API_KEY]
- > AUTH_DOMAIN=[PROJECT_ID].firebaseapp.com
- > DATABASE_URL=https://[DATABASE_NAME].firebaseio.com
- > PROJECT_ID=[PROJECT_ID]
- > STORAGE_BUCKET=[BUCKET].appspot.com
- > MESSAGING_SENDER_ID=[SENDER_ID]HOST_URL
- > PORT= Local_Host_Port
- - 5. [Enable Email/Password](https://firebase.google.com/docs/auth/web/password-auth) sign-in on firebase: - - In the Firebase console, open the Auth section. - - On the Sign in method tab, enable the Email/password sign-in method and click Save. - - 6. Installing all nodejs modules: +4. Installing all nodejs modules: `npm install` - 7. Go ahead ;) +5. Go ahead ;) `npm start` diff --git a/docs/app/configure/development.env b/docs/app/configure/development.env index 167b9b3..7b5b947 100644 --- a/docs/app/configure/development.env +++ b/docs/app/configure/development.env @@ -3,4 +3,5 @@ AUTH_DOMAIN=test-6bdc1.firebaseapp.com DATABASE_URL=https://test-6bdc1.firebaseio.com PROJECT_ID=test-6bdc1 STORAGE_BUCKET=test-6bdc1.appspot.com -MESSAGING_SENDER_ID=416549341075 \ No newline at end of file +MESSAGING_SENDER_ID=416549341075 +PORT= 4000 \ No newline at end of file diff --git a/docs/app/configure/production.env b/docs/app/configure/production.env new file mode 100644 index 0000000..9f6ae9e --- /dev/null +++ b/docs/app/configure/production.env @@ -0,0 +1,6 @@ +API_KEY=[API_KEY]
+AUTH_DOMAIN=[PROJECT_ID].firebaseapp.com
+DATABASE_URL=https://[DATABASE_NAME].firebaseio.com
+PROJECT_ID=[PROJECT_ID]
+STORAGE_BUCKET=[BUCKET].appspot.com
+MESSAGING_SENDER_ID=[SENDER_ID]HOST_URL
diff --git a/src/data/firestoreClient/services/authorize/AuthorizeService.ts b/src/data/firestoreClient/services/authorize/AuthorizeService.ts index 268dc31..69f28e2 100644 --- a/src/data/firestoreClient/services/authorize/AuthorizeService.ts +++ b/src/data/firestoreClient/services/authorize/AuthorizeService.ts @@ -226,7 +226,6 @@ export class AuthorizeService implements IAuthorizeService { } ) .then(() => { - alert(userId) resolve(new RegisterUserResult(userId)) }) .catch((error: any) => reject(new SocialError(error.name, 'firestore/storeUserInformation : ' + error.message)))