From adae1480c59248e37b32ff7c514f698edb88a3da Mon Sep 17 00:00:00 2001 From: Miguel Carrasco Q Date: Wed, 7 Feb 2024 12:22:41 -0300 Subject: [PATCH] docs: add installation instructions to run locally --- .gitignore | 1 + README.md | 72 +++++++++++++++++++++++++++++++++++------------------- 2 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30bc162 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/node_modules \ No newline at end of file diff --git a/README.md b/README.md index 79c504d..abaf1ac 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ The main reason why I created this is because Google Maps isn't a good replaceme to upload 360 photos to specific places on the map. With this project, it is possible to upload them at any coordinates. If you want to try it out, there are publicly available instances: -| **URL** | **Country** | **Status** | **Hosted By** | +| **URL** | **Country** | **Status** | **Hosted By** | |------------------------------------------------|-------------|------------|---------------| -| [maps.moomoo.me](https://maps.moomoo.me) | 🇬🇧 | Up | @moom0o | +| [maps.moomoo.me](https://maps.moomoo.me) | 🇬🇧 | Up | @moom0o | | [map.winscloud.net](https://map.winscloud.net) | 🇹🇭 | Down | @WinsDominoes | ## Quick start @@ -23,25 +23,25 @@ In order to get the Google api keys required for the oauth follow these steps: ### Client ID -1) Create a new project at https://console.cloud.google.com/ +1. Create a new project at https://console.cloud.google.com/ -2) Head over to the API library and enable +2. Head over to the API library and enable the Street View Publish API -3) Select 'Create Credentials', select 'User Data', enter any app name/email. +3. Select 'Create Credentials', select 'User Data', enter any app name/email. -4) Enable the 'Street View Publish API' scope. You won't need any sensitive scopes. +4. Enable the 'Street View Publish API' scope. You won't need any sensitive scopes. -5) Select 'Web application' for type, and name it anything. +5. Select 'Web application' for type, and name it anything. -6) Add http://localhost:7000 to authorized javascript origins. (If you are running on another domain/port, replace +6. Add http://localhost:7000 to authorized javascript origins. (If you are running on another domain/port, replace localhost) -7) Add http://localhost:7000/auth/ to authorized redirect URIs (If you are running on another domain/port, replace +7. Add http://localhost:7000/auth/ to authorized redirect URIs (If you are running on another domain/port, replace localhost) -8) You should now copy the Client ID into the config.json file. +8. You should now copy the Client ID into the config.json file. ### Client Secret @@ -50,15 +50,15 @@ and copy that to your config.json. ### Consent Screen -1) Select 'OAuth consent screen', use any name/email +1. Select 'OAuth consent screen', use any name/email -2) Make sure the authorized domain and email is correct, then select 'Save and Continue'. +2. Make sure the authorized domain and email is correct, then select 'Save and Continue'. -3) Make sure the Street View Publish API scope is enabled, if not, add it! +3. Make sure the Street View Publish API scope is enabled, if not, add it! -4) For test users, add the email address of the account where you want to upload 360 photos. +4. For test users, add the email address of the account where you want to upload 360 photos. -5) **Make sure to also copy the client ID into index.html**, after '&client_id=' and before '&scope', if needed, change +5. **Make sure to also copy the client ID into index.html**, after '&client_id=' and before '&scope', if needed, change the port and domain here as well. ### Config File @@ -66,14 +66,14 @@ and copy that to your config.json. There are many options in the config file that might confuse you, so here's a simple guide (I think?) to help you get through it. -| **Keys** | **Default values** | **Usage** | -|------------------|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------| -| `https` | `false` (boolean) | This is an option whether if you want to enable https or not, this uses boolean values. `false` = http:// and `true` = https:// | -| `host` | `localhost` (string) | Your host or domain, if you are hosting on a local machine, set this to `localhost`, if you are hosting this publicly, set it to your domain. | -| `port` | `7000` (integer) or `null` | Your port, if are running this as a public instance, set this to `null` | -| `openWebBrowser` | `true` (boolean) | This option will open a browser window to PhotoSphereStudio's running instance, set this to `false` if you are running this on a server, | -| `clientId` | string | Paste your Google OAuth Client ID here, check the previous steps on how to get it. | -| `clientSecret` | string | Paste your Google OAuth Client Secret ID here, check the previous steps on how to get it. | +| **Keys** | **Default values** | **Usage** | +| ---------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `https` | `false` (boolean) | This is an option whether if you want to enable https or not, this uses boolean values. `false` = http:// and `true` = https:// | +| `host` | `localhost` (string) | Your host or domain, if you are hosting on a local machine, set this to `localhost`, if you are hosting this publicly, set it to your domain. | +| `port` | `7000` (integer) or `null` | Your port, if are running this as a public instance, set this to `null` | +| `openWebBrowser` | `true` (boolean) | This option will open a browser window to PhotoSphereStudio's running instance, set this to `false` if you are running this on a server, | +| `clientId` | string | Paste your Google OAuth Client ID here, check the previous steps on how to get it. | +| `clientSecret` | string | Paste your Google OAuth Client Secret ID here, check the previous steps on how to get it. | **INFO: Your authorized JavaScript origins and authorized redirect URIs should be the same as the one you have set in your config file.** @@ -88,7 +88,7 @@ You must use a nginx reverse proxy pointing to localhost:7000 for this to work. ``` { "https": true, - "host": "maps.moomoo.me", + "host": "maps.moomoo.me", "port": 7000 } ``` @@ -114,7 +114,29 @@ Your **authorized JavaScript origin** would be: `http://localhost:7000` Your **authorized redirect URIs** would be: `http://localhost:7000/auth/` (don't forget the slash after `auth`) +## Installation + +1. Clone the repository + +```bash +git clone https://github.com/moom0o/PhotoSphereStudio.git +``` + +2. Install the dependencies + +```bash +npm install +``` + +3. Update the `config.json` file in the root directory of the project and fill it with the required information (clientId, clientSecret, etc.) + +4. Start the server + +```bash +node index.js +``` + ## Support If you have any questions about how to set this up or about the source code, feel free to ask either **moom0o** ( -moo#0529 on Discord) or **WinsDominoes** (Win#7206 on Discord). +moo#0529 on Discord) or **WinsDominoes** (Win#7206 on Discord).