The site is configured using environment variables. Set the following in your .env file, or the actual environment of your server process:
WATCH_TWITCH_CHANNEL_HANDLE=@xxxx
sets the twitch channel to check for livestream status.
Also sets the channel link at the bottom of the page.WATCH_YT_CHANNEL_ID=XXXX
sets the youtube channel to check for livestream status. Copy only the part after /channel/ in the URL (i.e. theUC...
part)USE_DUMMY_DATA=true
returns fake stream status instead of scraping YT. See getServerSideProps in pages/index.js.PUBLIC_HOST=XXXX
sets 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.YOUTUBE_API_KEY=XXXX
for refreshing members/premiere info. Can be created for free at https://console.cloud.google.com/apis/api/youtube.googleapis.com/credentials (Google account required)WATCH_YT_CHANNEL_HANDLE=@xxxx
sets 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=sqlite
SQLITE_DB_PATH=./data.db
If using Postgres:
DATABASE_TYPE=postgres
PGUSER=xxx
PGPASSWORD=xxx
PGPORT=xxx
PGHOST=xxx
PGDATABASE=imfdev
POSTGRES_URL= postgres connectiontring
overwrites ssl object in pg client and prevent ssl required error that appears with default login method
(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.js
and add your language's locale code to thelocales
array (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.js
and 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.