|
5 月之前 | |
---|---|---|
.vscode | 6 月之前 | |
bin | 6 月之前 | |
config | 6 月之前 | |
migrations | 6 月之前 | |
scripts | 6 月之前 | |
src/server | 6 月之前 | |
test | 6 月之前 | |
.envrc | 6 月之前 | |
.gitignore | 6 月之前 | |
README.md | 6 月之前 | |
ROADMAP.md | 6 月之前 | |
default.nix | 5 月之前 | |
knexfile.js | 1 年之前 | |
module.nix | 5 月之前 | |
package.json | 5 月之前 | |
shell.nix | 5 月之前 | |
tsconfig.json | 6 月之前 | |
tslint.json | 1 年之前 | |
yarn.lock | 6 月之前 | |
yarn.nix | 6 月之前 |
MIRACLE IS CURRENTLY NOT PRODUCTION READY (as I hope is evident from this repository)
CONSULT ROADMAP.md (link below) FOR MORE INFO
Backend portion of the MiracleTV Streaming Suite.
Uses PostgreSQL, TypeScript, Express and Nix
Streaming is supported by Nginx RTMP and OSSRS
This package is intended to work with
v1.0.0
Coming when it’s done
You can run this with nix / nixos as a package
miracle-tv.nix
;nix-env -i -f miracle-tv.nix
to install locally;miracle-tv-server
binary, i.e. miracle-tv-server --configPath=/path/to/your/config.json
(See /config/local.json
for examples) imports = [
"${builtins.fetchurl {
url = "https://code.gensokyo.social/Gensokyo.social/miracle-tv/raw/commit/493c80142637b6fc47c864dfb51a1cba2f391150/module.nix";
sha256 = "0k04z1w6yrr3f9g7g5dpdrdkx9lazf273nsb23zq1zp0mgd4dd71";
}}"
];
(
[Be mindful!] This example uses a version of the module fixed to a commit.
While this is a good practice, this particular example might be outdated.
It is recommended to find a more recent commit and use nix-prefetch-url
to get sha256 value;
$ nix-prefetch-url https://code.gensokyo.social/Gensokyo.social/miracle-tv/raw/commit/e0a86cfa6a0a52de49dc5e1680338c286cc929dd/module.nix
path is '/nix/store/zvsjjia6ppb35icywvgl9ljcn41q7svh-module.nix'
10vjfy581mnnv20a7biv8cm4zqj26irz7lq339449dzgqmh771bl
)
services.miracle-tv = {
enable = true;
settings = {
database.connection = {
database = "miracle";
user = "miracle";
};
};
};
nixos-rebuild switch
(or sudo nixos-rebuild switch
) to rebuild your system and start the service.curl http://localhost:8080/api/v1/channels
, if response is {"data":[], "status": "ok"}
, then you’re all set!yarn && yarn build:server
node ./dist/server/server.js --configPath=/path/to/config.json
(check /config/local.json
for examples)Simply use nix-shell
inside project folder (or use a tool like direnv) to drop into development environment already set up
nix-build
in project folder builds default derivation and dumps it into result/. Make sure to check the executable before pushing final commits and do not commit result/ in!rm yarn.nix && yarn2nix > yarn.nix
after adding new yarn packages before you commitMake sure you have node >14.0 and yarn installed, as well as all necessary tools to build node packages.
yarn
yarn watch:server
to continously watch and restart yarnyarn build:server
to produce a working build into dist/ directoryyarn test
to run a test suite on the servernix-build
produces usable output.
./result/bin/miracle-tv-server --configPath=./config/local.json
yarn.nix
by running yarn2nix > yarn.nix
yarn2nix
should be available inside nix-shell
nix-collect-garbage && nix-build
after that to make sure project buildsyarn build:server
produces usable output
node ./dist/server/server.js --configPath=./config/local.json
;yarn.nix
when opening a pull-request