Skip to content

NDinhChien/realtime-application-with-nestjs

Repository files navigation

Realtime Application with NestJS

Build a chatting App using Socket.io and NestJs

This project is inspired by Mr.DenzelCode's repository Nest-Auth

It's my attempt to embrace best practices of using MongoDB, and trying to write maintainabe code, based on my experience acquired by building several NestJs projects previously. It might not be that fancy, but I hope you can learn something new from this project too, just like I did 😃

Project highlights:

  1. NestJs backend framework
  2. MongoDB
  3. SocketIO realtime app framework
  4. JWT authentication
  5. Class-transformer, Class-validator for validation
  6. Swagger for API documentation

APIs

Auth controller
Register, login, logout, refresh token

Code Controller
Issue code to verify your email (for account registration or password recovery)

Request Controller
Manage friend request, group request, group invitation

User Controller
Search users

Update profile

Manage user friends and groups

Group Controller
Search groups

Manage user groups

Message Controller
Manage direct and group messages

Gateways

Connect Socket.io server (login with token)

User Gateway

logout

Message Gateway

message:direct (send direct message)

message:group (send group message)

Manually testing

First, download the source code, then run:

npm install
npm run dev

To test API, visit http:https://localhost:3000/api

To test Gateway, use Postman Desktop and this sample collection
👉 socketio-server-collection

Thank you and happy coding!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages