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

https://github.com/camillamendess/node-websockets

WebSockets com Node.js - comunicações em tempo real com Socket.IO e MongoDB.
https://github.com/camillamendess/node-websockets

mongodb nodejs socket-io websocket

Last synced: 2 months ago
JSON representation

WebSockets com Node.js - comunicações em tempo real com Socket.IO e MongoDB.

Awesome Lists containing this project

README

          

### `WebSockets com Node.js - comunicações em tempo real com Socket.IO e MongoDB`

`Socket.IO` é uma biblioteca que facilita o uso de WebSockets em aplicações JavaScript, especialmente em Node.js.

`WebSocket` é um protocolo que permite comunicação bidirecional, o que significa que tanto o cliente quanto o servidor podem enviar mensagens a qualquer momento sem a necessidade de novas requisições HTTP. Isso torna o WebSocket ideal para aplicações em tempo real, como chats, notificações instantâneas, e jogos multiplayer.

### `Aprendizados`

- Implementar o protocolo WebSockets com o Socket.IO e suas possibilidades - Servidor emitir para um ou vários clientes, reconhecimentos, salas do Socket.IO e interação do servidor com diversas páginas.
- Aplicar conceitos de Front-end e Back-end.
- Utilizar o driver do Node.js no mongoDB.
- Aplicar o fluxo de cadastro, login e armazenamento de JWT - Cadastrar senhas criptografadas, autenticar usuários gerando JWT e guardar o JWT nos cookies.
- Controlar acessos - Utilizar middlewares e namespaces para verificação de autenticidade do cliente.
- Controlar informações de forma local - Criar uma lista local para controlar as conexões e utilizar socket.data para armazenar informações.


WebSockets with Node.js - real-time communications with Socket.IO and MongoDB


Socket.IO is a library that facilitates the use of WebSockets in JavaScript applications, especially in Node.js. WebSocket is a protocol that allows bidirectional communication, which means that both the client and the server can send messages at any time without the need for new HTTP requests. This makes WebSocket ideal for real-time applications such as chats, instant notifications, and multiplayer games.


Learnings



  • Implement the WebSockets protocol with Socket.IO and its possibilities - Server sends to one or several clients, acknowledgments, Socket.IO rooms and server interaction with several pages.

  • Apply Front-end and Back-end concepts.

  • Use the Node.js driver in mongoDB.

  • Apply the JWT registration, login and storage flow - Register encrypted passwords, authenticate users by generating JWT and save the JWT in cookies.

  • Control access - Use middleware and namespaces to verify the client's authenticity.

  • Control information locally - Create a local list to control connections and use socket.data to store information.