1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00
royalnet/README.md

112 lines
4.1 KiB
Markdown
Raw Normal View History

2019-05-31 12:37:39 +00:00
# `royalnet` [![PyPI](https://img.shields.io/pypi/v/royalnet.svg)](https://pypi.org/project/royalnet/)
2019-03-22 10:22:21 +00:00
2020-06-14 23:31:51 +00:00
A framework for small Internet communities
2019-03-26 11:38:31 +00:00
2020-06-14 23:31:51 +00:00
## About Royalnet
2019-03-26 11:38:31 +00:00
2020-06-14 23:31:51 +00:00
`royalnet` is a Python framework composed of many interconnected services that may be useful to small Internet communities (gaming clans, university groups, etc).
2019-11-12 01:11:12 +00:00
2020-06-14 23:31:51 +00:00
### [Serfs](royalnet/serf)
_Serfs_ are services that allow Royalnet to respond to **chat commands** on multiple chat platforms.
Commands using the Royalnet Serf API share their code between chat platforms: each serf will handle the specifics for their respective platform, preventing potential bugs due to code duplication!
#### Supported chat platforms
2019-11-12 09:44:36 +00:00
- [Telegram](https://core.telegram.org/bots)
- [Discord](https://discordapp.com/developers/docs/)
2020-06-14 23:31:51 +00:00
- [Matrix](https://matrix.org/) (alpha)
More can easily be added by creating a new serf!
### [Bard](royalnet/bard)
The Bard module allows Royalnet services to safely download and convert video files through [youtube-dl](https://youtube-dl.org/) and [ffmpeg](https://ffmpeg.org/).
It is mainly used to playback music on Discord Channels.
### [Alchemy](royalnet/alchemy)
The _Alchemy_ module allows all Royalnet services to use a **PostgreSQL database** with a [SQLAlchemy](https://www.sqlalchemy.org/) interface.
This allows the usage of a shared and easy-to-use ORM: Alchemy handles for you everything, from the creation of new tables to isolating in transactions the calls made from a Serf command to the database.
### [Herald Network](royalnet/herald)
All Royalnet services can communicate with each other through the _Herald Network_, a websockets-based system allowing Remote Procedure Calls ("_events_") between services.
For example, in response to a Telegram message, the Telegram Serf can contact the Discord Serf to ask it to connect to voice chat in Discord.
Connections between different hosts are possible too, even if they currently are unused by the Royalnet Launcher.
### [Constellation](royalnet/constellation)
The Constellation service is a [Starlette](https://www.starlette.io )-based webserver that can supply dynamic pages ("_stars_") while being connected to the other parts of Royalnet through the Herald.
#### APIs
The Constellation service also offers utilities for creating REST APIs as Python functions with `dict`s as inputs and outputs, leaving (de)serialization, transmission and eventually authentication to Royalnet.
2019-11-12 01:11:12 +00:00
2020-06-14 23:45:54 +00:00
### Sentry
Royalnet can automatically report uncaught errors in all services to a [Sentry](https://sentry.io )-compatible server, while logging them in the console in development environments to facilitate debugging.
### Packs
New Serf _commands_, Constellation _stars_, Herald _events_ and Alchemy _tables_ can be added to Royalnet through plugins called "Packs" that can be activated or deactivated on each single instance.
#### Config
Each pack can access only its individual section in the configuration file, preventing key conflicts (as long as the packs themselves don't share the same name).
2020-06-15 18:09:17 +00:00
#### Template
New packs can be created starting from [this GitHub template](https://github.com/Steffo99/royalnet-pack-template).
2020-06-14 23:31:51 +00:00
## Installing Royalnet
2019-11-12 01:11:12 +00:00
2020-02-03 17:23:31 +00:00
To install `royalnet`, run:
```
pip install royalnet
```
2019-12-04 17:04:47 +00:00
2020-02-03 17:23:31 +00:00
To install a specific module, run:
2019-12-04 17:04:47 +00:00
```
2020-02-03 17:23:31 +00:00
pip install royalnet[MODULENAME]
2019-12-04 17:04:47 +00:00
```
2020-02-03 17:23:31 +00:00
To install all `royalnet` modules, run:
```
pip install royalnet[telegram,discord,matrix,alchemy_easy,bard,constellation,sentry,herald,coloredlogs]
```
## Documentation
2020-06-14 23:31:51 +00:00
A work-in-progress documentation is available [here](https://gh.steffo.eu/royalnet/html).
2019-12-04 17:04:47 +00:00
2020-06-14 23:31:51 +00:00
## Developing for Royalnet
2019-12-04 17:04:47 +00:00
2020-06-14 23:31:51 +00:00
To develop for `royalnet`, you need to have [Poetry](https://poetry.eustace.io/) installed on your PC.
2019-12-04 17:04:47 +00:00
After you've installed Poetry, clone the git repo with the command:
```
git clone https://github.com/Steffo99/royalnet
```
Then enter the new directory:
```
cd royalnet
```
And finally install all dependencies and the package:
```
2020-02-03 17:23:31 +00:00
poetry install -E telegram -E discord -E matrix -E alchemy_easy -E bard -E constellation -E sentry -E herald -E coloredlogs
2020-03-29 16:33:32 +00:00
```
2020-06-14 23:45:54 +00:00
## Help!
Need help in anything Royalnet-related? [Open a issue on GitHub!](https://github.com/Steffo99/royalnet/issues/new)