PhotoSphereStudio/README.md

148 lines
5.7 KiB
Markdown
Raw Permalink Normal View History

2023-04-08 12:07:47 +07:00
<div align=center>
<img src="public/assets/banner/github-banner.png">
<br /><br />
<p>Uploading 360° photos made easy</p>
</div>
# Overview
2023-06-27 22:39:15 +07:00
2023-04-06 06:03:21 +07:00
Upload 360° photos to Google Maps without using Google's app.
2023-06-27 22:39:15 +07:00
The main reason why I created this is because Google Maps isn't a good replacement of the former app. You are only able
to upload 360 photos to specific places on the map. With this project, it is possible to upload them at any coordinates.
2023-04-06 06:03:21 +07:00
2023-04-08 12:07:47 +07:00
If you want to try it out, there are publicly available instances:
| **URL** | **Country** | **Status** | **Hosted By** |
2023-04-08 12:07:47 +07:00
|------------------------------------------------|-------------|------------|---------------|
| [maps.moomoo.me](https://maps.moomoo.me) | 🇬🇧 | Up | @moom0o |
2024-07-19 12:43:10 +07:00
| [map.winscloud.net](https://map.winscloud.net) | 🇹🇭 | Up | @WinsDominoes |
2023-04-08 12:07:47 +07:00
2023-04-06 06:03:21 +07:00
## Quick start
2023-06-27 22:39:15 +07:00
2023-04-06 06:03:21 +07:00
In order to get the Google api keys required for the oauth follow these steps:
### Client ID
2023-06-27 22:39:15 +07:00
1. Create a new project at https://console.cloud.google.com/
2023-04-06 06:03:21 +07:00
2. Head over to the API library and enable
2023-06-27 22:39:15 +07:00
the <a href="https://console.cloud.google.com/apis/library/streetviewpublish.googleapis.com">Street View Publish
API</a>
2023-04-06 06:03:21 +07:00
3. Select 'Create Credentials', select 'User Data', enter any app name/email.
2023-04-06 06:03:21 +07:00
4. Enable the 'Street View Publish API' scope. You won't need any sensitive scopes.
2023-04-06 06:03:21 +07:00
5. Select 'Web application' for type, and name it anything.
2023-04-06 06:03:21 +07:00
6. Add http://localhost:7000 to authorized javascript origins. (If you are running on another domain/port, replace
2023-06-27 22:39:15 +07:00
localhost)
2023-04-06 06:03:21 +07:00
7. Add http://localhost:7000/auth/ to authorized redirect URIs (If you are running on another domain/port, replace
2023-06-27 22:39:15 +07:00
localhost)
2023-04-06 06:03:21 +07:00
8. You should now copy the Client ID into the config.json file.
2023-04-06 06:03:21 +07:00
### Client Secret
2023-06-27 22:39:15 +07:00
Head to the main credentials screen and click the pencil. (Edit OAuth Client) You will be able to find the Client Secret
and copy that to your config.json.
2023-04-06 06:03:21 +07:00
### Consent Screen
2023-06-27 22:39:15 +07:00
1. Select 'OAuth consent screen', use any name/email
2023-04-06 06:03:21 +07:00
2. Make sure the authorized domain and email is correct, then select 'Save and Continue'.
2023-04-06 06:03:21 +07:00
3. Make sure the Street View Publish API scope is enabled, if not, add it!
2023-04-06 06:03:21 +07:00
4. For test users, add the email address of the account where you want to upload 360 photos.
2023-04-06 06:03:21 +07:00
5. **Make sure to also copy the client ID into index.html**, after '&client_id=' and before '&scope', if needed, change
2023-06-27 22:39:15 +07:00
the port and domain here as well.
2023-04-08 12:07:47 +07:00
### Config File
2023-06-27 22:39:15 +07:00
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. |
2023-04-08 12:07:47 +07:00
2023-06-27 22:39:15 +07:00
**INFO: Your authorized JavaScript origins and authorized redirect URIs should be the same as the one you have set in
your config file.**
2023-04-08 12:07:47 +07:00
**Scenario 1 - Public Instance**
2023-06-27 22:39:15 +07:00
This example is for those who are hosting a public instance, your https, host and port would look something like this.
Change `maps.moomoo.me` to your domain.
2023-04-08 23:52:17 +07:00
You must use a nginx reverse proxy pointing to localhost:7000 for this to work.
2023-06-27 22:39:15 +07:00
2023-04-08 12:07:47 +07:00
```
{
"https": true,
"host": "maps.moomoo.me",
2023-04-08 23:52:17 +07:00
"port": 7000
2023-04-08 12:07:47 +07:00
}
```
2023-06-27 22:39:15 +07:00
2023-04-08 23:52:17 +07:00
Your **authorized JavaScript origin** would be: `https://maps.moomoo.me`
2023-04-08 12:07:47 +07:00
2023-04-08 23:52:17 +07:00
Your **authorized redirect URIs** would be: `https://maps.moomoo.me/auth/` (don't forget the slash after `auth`)
2023-04-08 12:07:47 +07:00
**Scenario 2 - Private Instance**
2023-06-27 22:39:15 +07:00
This example is for those who are running PhotoSphereStudio on a local machine, your https, host and port would look
something like this.
2023-04-08 12:07:47 +07:00
```
{
"https": false,
"host": "localhost",
"port" 7000
}
```
2023-06-27 22:39:15 +07:00
2023-04-08 12:07:47 +07:00
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
```
2024-07-19 11:44:17 +07:00
3. Rename `config.example.json` to `config.json`
2024-07-19 11:44:17 +07:00
4. Update the `config.json` file in the root directory of the project and fill it with the required information (clientId, clientSecret, etc.)
2024-07-19 11:44:17 +07:00
5. Start the server
```bash
node index.js
```
2024-07-19 13:03:37 +07:00
## To Do
- Fetch location metadata from image
- Location specifier
2023-04-08 12:07:47 +07:00
## Support
2023-06-27 22:39:15 +07:00
If you have any questions about how to set this up or about the source code, feel free to ask either **moom0o** (
2024-07-19 11:44:17 +07:00
m.o.o.m.o.o on Discord) or **WinsDominoes** (winsdominoes on Discord).