Giter VIP home page Giter VIP logo

non-stop-story's Introduction

Non-stop-story

Test status

日本語 中文

v1.3 KARKINOS

Table of contents

  1. Introduction
  2. What is a 'worker'?
  3. Ruby version
  4. System dependencies
  5. Configuration
  6. Database initialization
  7. Test suite
  8. Job queue services
  9. Deployment instructions
  10. More

Introduction

Non-stop-story is a public API server project for VTuber live streams, which offers a stable and reliable data source.

It gathers various live infos from 'worker's and manages the interaction with a persistent database for developers.

RESTful API is now available at HOLO.DEV:

/api/v1/lives/current
/api/v1/lives/scheduled
/api/v1/lives/ended
/api/v1/lives/open
/api/v1/lives/1
/api/v1/members
/api/v1/channels
/api/v1/platforms
/api/v1/rooms
/api/v1/hotnesses

GraphQL API is available at:

/graphql

You can also have a try the friendly GUI here.

What is a 'worker'?

Worker is another server which returns live infos according to the channelIDs passed through querystring.

Worker can be considered as an async and pure function.

There are various kinds of workers each of which is running for a specific platform.

There also exist workers for the same platform but are using different methods internally to fetch infos.

A Non-stop-story server/instance may combine different kinds of workers together to best fit its needs.

Here is a collection of sample workers.

Ruby version

2.6.5

System dependencies

DEVELOPMENT:

  • Bundler, which allows you to execute rails commands without much efforts
  • SQLite3, a lightweight database suitable for test and development

PRODUCTION

  • Bundler
  • MySQL/PostgreSQL, or any database that rails supports. Modify Gemfile if you are not using PostgreSQL
  • Unicorn/Puma, acts as a web server
  • NginX, recommended as a reverse proxy server

Configuration

  • config/database.yml stores database connection preferences.

  • config/worker.yml stores the various workers' addresses you use.

  • config/email.yml stores email configurations used in daily summary emails.

  • config/job.yml stores the frequency of live detection.

  • config/credentials.yml.enc stores encoded sensitive data such as admin username and password. Rails guides on credentials. You must provide username and password under key http_basic before you deploy.

Database initialization

You can manually setup the database:

# Create database if it does not exist
bundle exec rails db:create
# Run migrations
bundle exec rails db:migrate
# Seed your database
bundle exec rails db:seed

or make use of db:schema.rb:

# This will create the database if it does not exist, load the schema, then seed it
bundle exec rails db:setup

Test suite

Run

bundle exec rails t

Job queue services

No external queue tools is required. The built-in job queue backend Async is enough.

Deployment instructions

Read this post for a basic understanding of how to deploy Rails.

More

TODO

non-stop-story's People

Contributors

dependabot[bot] avatar nekochan0122 avatar yunzhezju avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

johndpope

non-stop-story's Issues

[Feature] Support Twitch

New jobs for Twitch should be set up as Sakura Miko has opened her first Twitch account.
All other members that have their official Twitch accounts should be added to seeds as well.

[Feature] Add field `graduated` to Member

Add a Boolean field indicating the current guaduation status of a member.
True stands for a member who has stopped his/her activity while False means this member is still active. A null constraint MAY be added to avoid null values.
This can be used in live-detect jobs to reduce requests.

Order of lives

lives returned by api should exist in the order of id asc

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.