Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 930 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 930 Bytes

Adonis chat demo

This repository contains a simple demo application that integrates AdonisJS with Socket.IO, featuring user authentication. The project demonstrates how to set up a basic one-to-one chat application where users can log in, join chat rooms, and exchange messages in real-time.

Features

  • Socket.io singleton server
  • Integration with @adonisjs/auth
  • User authentication (register, login)
  • Groups (create and delete)
  • Group members (list, join, leave, remove)
  • Group messages (list, send)
  • Private messages (list, send)
  • Realtime notifications
  • Inertia+React frontend

WIP

How to

Access the socket.io server:

import Ws from '#services/socket'

const io = Ws.io // singleton instance

Access the current user in the socket context

Ws.io.on('connection', async (socket) => {
  const user = socket.context.auth.getUserOrFail()
  ...
})