Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/centrifugal/grand-chat-tutorial

Source code for Centrifugo grand tutorial – Building WebSocket chat/messenger application from scratch. See the tutorial here - https://centrifugal.dev/docs/tutorial/intro
https://github.com/centrifugal/grand-chat-tutorial

chat django instant-messaging messenger react scalability tutorial websocket

Last synced: 4 days ago
JSON representation

Source code for Centrifugo grand tutorial – Building WebSocket chat/messenger application from scratch. See the tutorial here - https://centrifugal.dev/docs/tutorial/intro

Awesome Lists containing this project

README

        

# Django + React + Centrifugo chat (instant messenger) application

This is a source code for [Centrifugo Chat/Messenger Tutorial](https://centrifugal.dev/docs/tutorial/intro).

## Running locally

You need Docker with Docker Compose. First, run the app:

```sh
docker compose up
```

After containers started for the first time, from another terminal window (you must be in the repo root) create admin user (or better two since you want to try chatting, right?):

```sh
docker compose exec backend python manage.py createsuperuser
```

Then go to [http://localhost:9000/admin](http://localhost:9000/admin), use admin user credentials to login and create several rooms. Alternatively, you can open Django shell:

```sh
docker compose exec backend python manage.py shell
```

And then inside Django shell:

```python
from app.utils import setup_dev
setup_dev()
```

Running `setup_dev` function will create 100k users and then 4 rooms with different number of members (100, 1k, 10k, 100k).

Then go to [http://localhost:9000](http://localhost:9000) and enjoy the working app! Login using second user (from incognito tab to not logout the first one session, or simply use different browser/device) to see the real-time in action.

![demo](grandchat.png?raw=true "Image of app")