Code Monkey home page Code Monkey logo

imissspica.com's Introduction

Config

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=XXXX sets the youtube channel to check for livestream status. Copy only the part after /channel/ in the URL (i.e. the UC... 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.
  • WATCH_TWITTER_ID=XXXX Twitter user ID of an account that will post YouTube links. Not the @ handle, but the unique numeric ID.
  • 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)
  • TWITTER_BEARER_TOKEN=XXXX for 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=@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=sqlite3
  • SQLITE_DB_PATH=./data.db

If using Postgres:

  • DATABASE_TYPE=postgres
  • PGUSER=xxx
  • PGPASSWORD=xxx
  • PGPORT=xxx
  • PGHOST=xxx
  • PGDATABASE=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.

Initializing the database

Run either init_postgres.sql or init_sqlite3.sql on your database to create the necessary tables.

How to add images

  1. Put a .png or .jpg file in public/imagesets/[name]

How to add languages

  1. Open next.config.js and add your language's locale code to the locales array (e.g. locales: ["en"], -> locales: ["en", "fr"],). Locale codes can be either just the language (en) or include a region (en-US).
  2. Open lang/strings.js and copy/paste the entire English strings block. Replace the locale code in AllStrings["en"] with the code you added in step 1.
  3. Translate all the newly copypasted strings.
  4. Make a pull request.

imissspica.com's People

Contributors

saplinganon avatar bluedo avatar tralezab avatar kylemsguy avatar tunaflsh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.