Skip to content

πŸ’¬ Live chat with Websocket, Nodejs, Prisma and Jest

Notifications You must be signed in to change notification settings

jrsousadev/live-chat-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

92 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

😺 Live chat project API using mongodb, nodejs, prisma, supertest and jest

API Desenvolvida para ser consumida no live-chat-web

O que foi utilizado no projeto

  • Typescript
  • Express
  • MongoDB
  • Mocks
  • Supertest
  • Jest
  • Prisma
  • Nodejs

Regras de negΓ³cio

  • Create message
  • Get message
  • Get last message by chat
  • Get all messages by chat
  • Delete all messages
  • Create chat
  • Create group chat
  • Get all chats by user
  • Get chat
  • Create user
  • Get user

Endpoints Message

  • [POST] "/api/message"
  • [GET] "/api/message/chat/:chatId"
  • [GET] "/api/message/lastMessage/:chatId"
  • [GET] "/api/message/:id"
  • [DELETE] "/api/message/all"

Endpoints Chat:

  • [POST] "/api/chat"
  • [POST] "/api/chat/group"
  • [GET] "/api/chat/user/:userId"
  • [GET] "/api/chat/:id"

Endpoints Use:

  • [POST] "/api/user"
  • [GET] "/api/user/:id"

Arquitetura do Projeto

.
β”œβ”€β”€ prisma
β”œβ”€β”€ src/
β”‚   └── app
β”‚     └── modules
β”‚     └── repositories
β”‚     └── utils
β”‚     └── shared
β”‚       └── errors
β”‚       └── routes
β”‚       └── app.ts
β”‚       └── server.ts
β”‚       └── websocket.ts
β”‚   └── config
β”‚   └── database
β”‚   └── domain
β”‚     └── entities
β”œβ”€β”€ tests/
β”‚   └── _database
β”‚   └── _modules
β”‚   └── _repositories
β”‚   └── _seed
└── ...

Iniciando o Projeto

  • Clone o repositΓ³rio e instale as dependΓͺncias.
# install dependencies
> npm i

# copy .env file
> cp .env.example .env

# Generating mongoDB with prisma models
> npm prisma generate

# Init tests
> npm run test

# start project
> npm run dev

# open in
http://localhost:8080/

About

πŸ’¬ Live chat with Websocket, Nodejs, Prisma and Jest

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published