The site is configured using environment variables. Set the following in your .env file, or the actual environment of your server process:
WATCH_CHANNEL_ID=XXXXsets the youtube channel to check for livestream status. Copy only the part after /channel/ in the URL (i.e. theUC...part)USE_DUMMY_DATA=truereturns fake stream status instead of scraping YT. See getServerSideProps in pages/index.js.PUBLIC_HOST=XXXXsets the external hostname of the site (e.g. "https://imissfauna.com"). This is used to make absolute URLs for the embed. Do not leave a trailing slash.WATCH_TWITTER_ID=XXXXTwitter user ID of an account that will post YouTube links. Not the @ handle, but the unique numeric ID.YOUTUBE_API_KEY=XXXXfor refreshing members/premiere info. Can be created for free at https://console.cloud.google.com/apis/api/youtube.googleapis.com/credentials (Google account required)TWITTER_BEARER_TOKEN=XXXXfor loading tweets, which we use to discover members/premiere streams. Can be issued from https://developer.twitter.com/ , which is free but requires your account to be approved as a Twitter dev.WATCH_CHANNEL_HANDLE=@xxxxsets the channel link at the bottom of the page. If unset, uses the old /channel/... URL format.
One of the following variable sets are needed to configure the database:
If using SQLite:
DATABASE_TYPE=sqlite3SQLITE_DB_PATH=./data.db
If using Postgres:
DATABASE_TYPE=postgresPGUSER=xxxPGPASSWORD=xxxPGPORT=xxxPGHOST=xxxPGDATABASE=imfdev
(Any PG environment variables supported by libpq can also be set. See https://www.postgresql.org/docs/9.3/libpq-envars.html)
You will probably want a connection pooler like pgbouncer if you're deploying on a serverless platform like vercel.
Run either init_postgres.sql or init_sqlite3.sql on your database to create the necessary tables.
- Put a .png or .jpg file in public/imagesets/[name]
- Open
next.config.jsand add your language's locale code to thelocalesarray (e.g.locales: ["en"],->locales: ["en", "fr"],). Locale codes can be either just the language (en) or include a region (en-US). - Open
lang/strings.jsand copy/paste the entire English strings block. Replace the locale code inAllStrings["en"]with the code you added in step 1. - Translate all the newly copypasted strings.
- Make a pull request.