Skip to content
/ grigory Public template

Backend for real-time chats, notifications and microservice communication. Has both REST and WebSockets support.

License

Notifications You must be signed in to change notification settings

Anttek-io/grigory

Repository files navigation

Grigory

Django CI Docker Image Version (latest semver) Docker Image Size (latest semver) Docker Pulls

Grigory is backend for notification service, real-time chats and microservices communication.
It's built on top of Django and Django Channels.
It's designed to be used as a microservice in a microservice architecture, but can be used as a standalone service as well.
It provides both REST API and WebSockets for clients and microservices.

If you find this project useful, please consider giving it a star ⭐️

Who was this project made for?

Everybody who wants to implement chat and notifications in their project.
For example, frontend developers who needs chat and/or notifications functionality.


How it works

screenshot

  1. Any client or microservice sends some message via REST API or WebSockets with the indication of the chat it belongs to.
    1.1. If chat with user doesn't exist, it will be created automatically.
  2. Then this message gets saved in database.
  3. After that, the message is sent to real-time chat via WebSockets.

Message history can be retrieved via REST API or WebSockets.

Demo

Grigory needs some pretty demo site. But I'm bad at frontend, so if you want to help, please contact me at rustam@astafeev.dev.

demo

You can try the demo at https://grigory-demo.anttek.io.
To test it, open 2 tabs in your browser and login as 2 different users.
Then you can send messages between them.

There are 2 users in the demo: demo-1 and demo-2.
They have same password: demo-123.

API is available at https://grigory-demo.anttek.io/api.
WebSockets are available at wss://grigory-demo.anttek.io/ws.


Features implemented

  • WebSockets with JWT auth (with Rest Framework Simple JWT)
  • Real-time chats and chat list
  • Chat management (creating, updating, deleting, adding and removing members, etc.)
  • File attachments via REST API only (because there's limitation for message size in Django Channels / Redis)
  • Microservice architecture-ready

Features to be implemented

  • Marking messages as read by concrete user
  • Show unread messages count in chat list
  • Using system events as messages in chats

Quick start

First clone the repo

git clone https://github.com/Anttek-io/grigory.git
cd grigory

Create .env file and put at least GRIGORY_WEB_PORT

GRIGORY_WEB_PORT=8000

Run the app

docker compose up -d

Documentation

Hand-writed docs available here: link to GitHub Pages.

Demo auto-generated docs available here: link to RapiDoc UI.


Postman workspace

There's public Postman workspace with all the requests and collections. You can import it to your Postman and start testing the API right away.

View in Postman


About

Backend for real-time chats, notifications and microservice communication. Has both REST and WebSockets support.

Topics

Resources

License

Stars

Watchers

Forks