Giter Club home page Giter Club logo

send-messages-api's Introduction

Sobre

Uma API responsável por fazer envio de mensagens.

Tecnologias utilizadas:
● Node.js
● MVC
● Sequelize ORM
● PostgreSQL
● Docker

Variaveis ambiente

PORT=3333
APP_URL=0.0.0.0

Rodando com docker

docker-compose up --build 

Variable APP_URL of .env must be" 0.0.0.0 "(it is already by default, so there is no need to change it)

Rodando localmente

npm install
npm start

Change the APP_URL variable in .env to "localhost" Change host in src/config/database.js to "localhost"

Banco de dados

Para rodar as migrations:

npx sequelize db:migrate

Ou criar:

npx sequelize migration:create --name=create-messages

host: 'localhost', username: 'root', password: 'root', database: 'postgres'

Rotas

Enviar uma mensagem
/messages    POST
Exemplo de dados json enviados:

{
    "from": "5531997469133",
    "target_id": "553196179668",
    "media": "false",
    "message": "Text"
}

Visualizar todas as mensagens
/messages    GET

Visualizar todas as mensagens filtrando por "message"
/messages/message/textoafiltrar   GET

Problemática

  1. Desenvolver uma API que seja responsável por fazer o envio de mensagens. Esta API deve conter um endpoint que receba um payload com os seguintes dados: “from”, “target_id”, “media”, “message”. Onde: from indica o número que está enviando a mensagem, target_id o número recebedor, media indica true ou false para envio de arquivo (imagem, documento, áudio, etc) e message a mensagem propriamente dita.
  2. Desenvolver um endpoint que liste as mensagens enviadas e que permita filtrá-las.
  3. Construa um sistema e/ou API, que faça o envio de mensagens utilizando a API criada acima e retorne os seguintes dados: “message_status”, “message”, “from”, “target_id”. Onde: message_status deve ser true ou false indicando o sucesso ou a negativa do envio, from indica o número que está enviando a mensagem, target_id o número recebedor e message a mensagem propriamente dita.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.