Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install #6

Open
alanmilinovic opened this issue Jun 3, 2019 · 5 comments
Open

How to install #6

alanmilinovic opened this issue Jun 3, 2019 · 5 comments
Labels
question Further information is requested

Comments

@alanmilinovic
Copy link

Hi, any instructions how to install it on RPi3?

@sharkykh
Copy link
Owner

sharkykh commented Jun 3, 2019

👋
There's no need to install anything - this is a web application you can use: sharkykh.github.io/tppm.
Unless you're asking because you want to host it locally?

@alanmilinovic
Copy link
Author

Yes, I like to have things locally. 😀

@sharkykh
Copy link
Owner

sharkykh commented Jun 3, 2019

Alright 👍
So I have to say I don't know much about RPi3, but the basic things you need are:

This project isn't really set up to host it locally as it is on the website yet.
Right now you can run the development server using:

# installs the project dependencies into the folder `./node_modules`
yarn install
# runs the dev-server
yarn dev-server --port 8080 --host 0.0.0.0

Which will run a local server at the port you specify.
--host 0.0.0.0 will open it to the network (normally it's limited to localhost)

I will set up an easier way to run this as a local server tomorrow at the latest.

@alanmilinovic
Copy link
Author

tnx for a very quick response. Looking forward to easier setup.

@sharkykh
Copy link
Owner

sharkykh commented Jun 4, 2019

@Amilino
Unfortunately I tried doing that, but I couldn't make it work. I'm sorry!
TL;DR: You will only be able to use it if you're opening it on the browser as http://localhost:8080.
If you don't, the requests to Trakt will just be blocked by the browser.
In any case,
I updated the code so that yarn install + yarn start will start a server on localhost, port 8080.

The longer story:
Because this app makes calls to the Trakt API directly from the browser (without a server in between), there's something called CORS,
which means the browser will reject (or maybe it's the Trakt servers, not sure right now) any requests originating from host names that are not listed as approved for the API application on Trakt.

I can only add fully qualified host names to that list - it does not accept any wildcards, so I can't even have localhost with any port.

This is all because I built this app with the intention of it being able to run entirely in the browser, and only need simple web hosting (which GitHub Pages provides).

I am not planning on rewriting it to be able to be run on different domains.
But there are two alternatives I can think of:

  1. There's the original Python GUI application I made, which doesn't run a server,
    but it does require Python and a few Python dependencies to be installed.
  2. I think it's a stretch, but you could create your own API application on Trakt with the "Redirect uri" and "Javascript (cors) origins" set to the local address you want to put in the browser, then update these three values in the code with your application's values.
    (And if you want to change the server port, it's here.)

@sharkykh sharkykh added the question Further information is requested label Jul 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants