Skip to content

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

4 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages