API Desenvolvida para ser consumida no live-chat-web
- Typescript
- Express
- MongoDB
- Mocks
- Supertest
- Jest
- Prisma
- Nodejs
- 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
- [POST] "/api/message"
- [GET] "/api/message/chat/:chatId"
- [GET] "/api/message/lastMessage/:chatId"
- [GET] "/api/message/:id"
- [DELETE] "/api/message/all"
- [POST] "/api/chat"
- [POST] "/api/chat/group"
- [GET] "/api/chat/user/:userId"
- [GET] "/api/chat/:id"
- [POST] "/api/user"
- [GET] "/api/user/:id"
.
├── prisma
├── src/
│ └── app
│ └── modules
│ └── repositories
│ └── utils
│ └── shared
│ └── errors
│ └── routes
│ └── app.ts
│ └── server.ts
│ └── websocket.ts
│ └── config
│ └── database
│ └── domain
│ └── entities
├── tests/
│ └── _database
│ └── _modules
│ └── _repositories
│ └── _seed
└── ...
- 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/