Skip to content

Simple demo application that integrates AdonisJS with Socket.IO

Notifications You must be signed in to change notification settings

nedois/adonis-chat-demo

Repository files navigation

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()
  ...
})

About

Simple demo application that integrates AdonisJS with Socket.IO

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published