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/