Go to file
Luna 49edad8573 pubsub.lazy_guild: add dummy impl for chan_update 2018-12-02 19:16:00 -03:00
images all: add guild icon support 2018-11-13 21:12:40 -03:00
litecord pubsub.lazy_guild: add dummy impl for chan_update 2018-12-02 19:16:00 -03:00
manage storage: add rate_limit_per_user fetching 2018-11-22 22:06:19 -03:00
static static.index: fix usage of obsolete tag 2018-11-21 20:08:37 -05:00
tests tests.test_main: remove 'hewwo' content check 2018-11-21 22:06:10 -03:00
.gitignore gitignore: add images dir 2018-11-13 21:15:30 -03:00
.gitlab-ci.yml .gitlab-ci.yml: add gifsicle to main apk add command 2018-11-21 20:08:19 -03:00
LICENSE Initial Commit 👌 😂 2018-06-15 21:59:52 -03:00
Pipfile blueprints: add icons blueprint 2018-11-13 17:33:28 -03:00
Pipfile.lock user.billing: add create_payment 2018-11-14 19:49:36 -03:00
README.md README: add gifsicle requirement 2018-11-21 20:07:46 -03:00
__init__.py tests: add basic test 2018-11-12 04:10:31 -03:00
config.ci.py config.ci.py: add MAIN_URL and NAME 2018-11-21 23:02:33 -03:00
config.example.py config.example.py: add NAME attribute 2018-11-21 21:40:56 -03:00
discord_endpoints.txt run: replace other/peer to user 2018-11-20 14:52:35 -03:00
manage.py add manage.py 2018-11-06 17:42:27 -03:00
nginx.conf README: add "Checking if it is working" section 2018-11-15 18:08:12 -03:00
requirements.txt Pipfile: add pyflakes 2018-11-12 18:11:04 -03:00
run.py user: add fake_store bp 2018-11-30 17:33:23 -03:00
schema.sql storage: add rate_limit_per_user fetching 2018-11-22 22:06:19 -03:00
setup.py Pipfile: add pyflakes 2018-11-12 18:11:04 -03:00
tox.ini Pipfile: add pyflakes 2018-11-12 18:11:04 -03:00

README.md

litecord

Litecord is an open source implementation of Discord's backend and API in Python.

This project is a rewrite of litecord-reference.

Notes

  • Unit testing isn't completly perfect.
  • No voice is planned to be developed, for now.
  • You must figure out connecting to the server yourself. Litecord will not distribute Discord's official client code nor provide ways to modify the client.

Install

Requirements:

  • Python 3.7 or higher
  • PostgreSQL
  • gifsicle for GIF emoji and avatar handling.
  • Pipenv
$ git clone https://gitlab.com/luna/litecord.git && cd litecord

# Setup the database:
# don't forget that you can create a specific
# postgres user just for the litecord database
$ createdb litecord
$ psql -f schema.sql litecord

# Configure litecord:
# edit config.py as you wish
$ cp config.example.py config.py

# run database migrations (this is a
# required step in setup)
$ pipenv run ./manage.py migrate

# Install all packages:
$ pipenv install --dev

Running

Hypercorn is used to run litecord. By default, it will bind to 0.0.0.0:5000. You can use the -b option to change it (e.g. -b 0.0.0.0:45000).

Use --access-log - to output access logs to stdout.

$ pipenv run hypercorn run:app

It is recommended to run litecord behind NGINX. Because of that, there is a basic nginx.conf file at the root.

Checking if it is working

You can check if your instance is running by checking the /api/v6/gateway path. For basic websocket testing a tool such as ws can be used.

Updating

$ git pull
$ pipenv run ./manage.py migrate

Running tests

To run tests we must create users that we know the passwords of. Because of that, never setup a testing environment in production.

# setup the testing users
$ pipenv run ./manage.py setup_tests

# make sure you have tox installed
$ pip install tox

# run basic linter and tests
$ tox