From 1cbf9f3c457b51257453511d3e1c82e4347a6638 Mon Sep 17 00:00:00 2001 From: William Oldham Date: Thu, 26 Oct 2023 22:04:39 +0100 Subject: [PATCH] docs: proxy and client changes --- .docs/content/0.index.md | 2 +- .docs/content/2.self-hosting/2.proxy.md | 1 + .docs/content/2.self-hosting/3.client.md | 49 ++++++++++++++++++++++++ .docs/content/2.self-hosting/4.config.md | 1 + 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .docs/content/2.self-hosting/4.config.md diff --git a/.docs/content/0.index.md b/.docs/content/0.index.md index 0103c965..e9f81689 100644 --- a/.docs/content/0.index.md +++ b/.docs/content/0.index.md @@ -8,7 +8,7 @@ layout: page --- cta: - Get Started - - /guide/usage + - /introduction/getting-started secondary: - Open on GitHub → - https://github.com/movie-web/movie-web diff --git a/.docs/content/2.self-hosting/2.proxy.md b/.docs/content/2.self-hosting/2.proxy.md index e3959e3b..c727f540 100644 --- a/.docs/content/2.self-hosting/2.proxy.md +++ b/.docs/content/2.self-hosting/2.proxy.md @@ -34,3 +34,4 @@ The proxy is made as a Cloudflare worker. Cloudflare has a generous free plan, s 1. Click "Deploy" to deploy to Cloudflare Workers. 1. Congratulations! Your worker is now deploying. Please wait for the GitHub Action to build and publish your worker. 1. You can click the "Worker dash" and "GitHub repo" buttons to see the status of the deploy. +1. When the worker has deployed, you will need to take note of the URL. This can be found on Cloudflare under Workers and Pages -> Overview -> proxy. diff --git a/.docs/content/2.self-hosting/3.client.md b/.docs/content/2.self-hosting/3.client.md index e69de29b..14e025b1 100644 --- a/.docs/content/2.self-hosting/3.client.md +++ b/.docs/content/2.self-hosting/3.client.md @@ -0,0 +1,49 @@ +# Setting up the client + +## Vercel - Recommended +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fmovie-web%2Fmovie-web&env=VITE_CORS_PROXY_URL,VITE_TMDB_READ_API_KEY) +1. Click the Deploy button. +1. Sign in using either a GitHub, GitLab, or Bitbucket. +1. Follow the instructions to create a repository for movie-web. +1. Configure the environment variables: + - `VITE_CORS_PROXY_URL`: Enter your proxy URL here. Make sure to not have a slash at the end of your URL. + + Example (THIS IS AN EXAMPLE, IT WON'T WORK FOR YOU): `https://test-proxy.test.workers.dev` + - `VITE_TMDB_READ_API_KEY`: Enter your TMDB Read Access Token here. Please read [below](#tmdb-api-key) on how to get an API key. +1. Click "Deploy" +1. Congrats! You have your own version of movie-web hosted. +1. You may wish to configure a custom domain - Please consult [the Vercel docs for how to do this](https://vercel.com/docs/getting-started-with-vercel/domains). + + +## Any Static Web Host +1. Download the file `movie-web.zip` from the latest release: https://github.com/movie-web/movie-web/releases/latest. +2. Extract the ZIP file so you can edit the files. +3. Open `config.js` in an editor such as Notepad, Visual Studio Code or similar. +4. Put your proxy URL in-between the double quotes of `VITE_CORS_PROXY_URL: ""`. Make sure to not have a slash at the end of your URL. + + Example (THIS IS AN EXAMPLE, IT WON'T WORK FOR YOU): `VITE_CORS_PROXY_URL: "https://test-proxy.test.workers.dev"` +5. Put your TMDB Read Access Token inside the quotes of `VITE_TMDB_READ_API_KEY: ""`. Please read [below](#tmdb-api-key) on how to get an API key. +6. Save the file. +7. Upload **all** of the files to a static website hosting such as: + - GitHub Pages + - Netlify + - Vercel + - Etc, there are lots - Google it if the ones above don't work for you. +1. Congrats! You have your own version of movie-web hosted. + + +## TMDB API Key +In order to search for movies and TV shows, we use an API called "The Movie Database" (TMDB). In order for your client to be able to search, you need to generate an API key. + +::alert{type="info"} +The API key is **free**, you just need to create an account. +:: + +1. Create an account at https://www.themoviedb.org/signup +1. You will be required to verify your email; click the link that you get sent to verify your account. +1. Go to https://www.themoviedb.org/settings/api/request to create a developer account. +1. Read the terms and conditions and accept them. +1. Fill out your details: + - Select "Website" as type of use. + - For the other details can put any values; they are not important. +1. Copy the "API Read Access Token" - **DO NOT COPY THE API Key - IT WILL NOT WORK** diff --git a/.docs/content/2.self-hosting/4.config.md b/.docs/content/2.self-hosting/4.config.md new file mode 100644 index 00000000..04edf220 --- /dev/null +++ b/.docs/content/2.self-hosting/4.config.md @@ -0,0 +1 @@ +# Config Reference