v1.3 KARKINOS
- Introduction
- What is a 'worker'?
- Ruby version
- System dependencies
- Configuration
- Database initialization
- Test suite
- Job queue services
- Deployment instructions
- More
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.
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.
2.6.5
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
-
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 provideusername
andpassword
under keyhttp_basic
before you deploy.
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
Run
bundle exec rails t
No external queue tools is required.
The built-in job queue backend Async
is enough.
Read this post for a basic understanding of how to deploy Rails.
TODO