Skip to content

Microsserviço responsável por pesquisar dúvida no Stack Overflow

License

Notifications You must be signed in to change notification settings

botludum/Ludum-Duvida

Repository files navigation


pipeline statuscoverage report

Clique aqui para conversar comigo no Telegram!
Se não conseguir me encontre pelo meu username é @OLudumBot
Ah! Eu também possuo uma versão de homologação é @ludumdev_bot

Ludum - O assistente virtual sobre o PyGame

Sobre o repositório

Encarregado de armazenar o Microsserviço de Pesquisar Dúvida no Stack Overflow do Ludum. Esse microsserviço é responsável por pesquisar a dúvida do usuário no Stack Overflow caso a mesma não esteja presente no FAQ.

Sobre o projeto

O Ludum é um chatbot que propõe-se a auxiliar em diversos aspectos as pessoas que desejam desenvolver jogos utilizando a biblioteca PyGame.

Como desenvolver

Neste microsserviço foi utilizado NodeJS com express e MongoDB (Mongoose). Tudo que é necessário para o desenvolvimento está dentro do docker, então, para desenvolver, deve-se seguir os seguintes passos:

  1. Modifique a linha 20 do arquivo index.js localizado na pasta raíz do projeto de:
mongoose.connect(process.env.MONGODB_URI);

para:

mongoose.connect('mongodb://localhost/ludum-duvida');
  1. Após, abra um terminal na pasta raíz do projeto e execute o comando:
docker build -t guilhermesiqueira/ludum-duvida .
  1. Em seguida:
docker-compose up

Pronto, o seu ambiente de desenvolvimento está pronto!

Quero saber mais!

Para mais informações e maiores esclarecimentos, visite o nosso repositório principal, clicando aqui

Documentação da API

Base URL

A URL para qualquer requisição possui a url base api: https://ludum-duvidas.herokuapp.com/api/{resource}

Endpoints

Os endpoints são:

/duvidas

São os endpoints relacionados às duvidas pesquisadas.

GET /duvidas/pesquisar/:{question}

Parametro Tipo Descricao Obrigatorio?
question string Comando digitado pelo usuário no telegram sim
  • Exemplo de JSON retornado:
{
    "status": "success",
    "message": "Posts retrieved successfully",
    "data": [
        {
            "_id": "5cbfbe32de8e8b0024c7e011",
            "question": "How to use Rasa?",
            "answer": [
                {
                    "_id": "5cbfbe32de8e8b0024c7e016",
                    "title": "How to use RASA NLU with RASA CORE?",
                    "link": "https://stackoverflow.com/questions/48700554/how-to-use-rasa-nlu-with-rasa-core"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e015",
                    "title": "How to use rasa action_restart",
                    "link": "https://stackoverflow.com/questions/53715698/how-to-use-rasa-action-restart"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e014",
                    "title": "RASA how to use Japanese (Tokennization-Mecab)",
                    "link": "https://stackoverflow.com/questions/53001497/rasa-how-to-use-japanese-tokennization-mecab"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e013",
                    "title": "How to use my own NLU module completely with Rasa Core?",
                    "link": "https://stackoverflow.com/questions/55368233/how-to-use-my-own-nlu-module-completely-with-rasa-core"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e012",
                    "title": "How to use Hindi Model in RASA NLU?",
                    "link": "https://stackoverflow.com/questions/52586211/how-to-use-hindi-model-in-rasa-nlu"
                }
            ],
            "create_date": "2019-04-24T01:38:58.246Z",
            "__v": 0
        }
  • Retorno: HTTP Status 200 e json retornado e armazenado no banco.

GET /duvidas/:{id}

Retorna apenas uma dúvida

Parametro Tipo Descricao Obrigatorio?
id string id da pergunta sim
  • Exemplo de JSON retornado:
{
    "status": "success",
    "message": "Carregando detalhes da dúvida",
    "data": [
        {
            "_id": "5cbfbe32de8e8b0024c7e011",
            "question": "How to use Rasa?",
            "answer": [
                {
                    "_id": "5cbfbe32de8e8b0024c7e016",
                    "title": "How to use RASA NLU with RASA CORE?",
                    "link": "https://stackoverflow.com/questions/48700554/how-to-use-rasa-nlu-with-rasa-core"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e015",
                    "title": "How to use rasa action_restart",
                    "link": "https://stackoverflow.com/questions/53715698/how-to-use-rasa-action-restart"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e014",
                    "title": "RASA how to use Japanese (Tokennization-Mecab)",
                    "link": "https://stackoverflow.com/questions/53001497/rasa-how-to-use-japanese-tokennization-mecab"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e013",
                    "title": "How to use my own NLU module completely with Rasa Core?",
                    "link": "https://stackoverflow.com/questions/55368233/how-to-use-my-own-nlu-module-completely-with-rasa-core"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e012",
                    "title": "How to use Hindi Model in RASA NLU?",
                    "link": "https://stackoverflow.com/questions/52586211/how-to-use-hindi-model-in-rasa-nlu"
                }
            ],
            "create_date": "2019-04-24T01:38:58.246Z",
            "__v": 0
        }
  • Retorno: HTTP Status 200 e json retornado e armazenado no banco.

GET /duvidas/

Retorna todas as dúvidas pesquisadas

  • Exemplo de JSON retornado:
{
    "status": "success",
    "message": "Posts retrieved successfully",
    "data": [
        {
            "_id": "5cbfbe32de8e8b0024c7e011",
            "question": "How to use Rasa?",
            "answer": [
                {
                    "_id": "5cbfbe32de8e8b0024c7e016",
                    "title": "How to use RASA NLU with RASA CORE?",
                    "link": "https://stackoverflow.com/questions/48700554/how-to-use-rasa-nlu-with-rasa-core"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e015",
                    "title": "How to use rasa action_restart",
                    "link": "https://stackoverflow.com/questions/53715698/how-to-use-rasa-action-restart"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e014",
                    "title": "RASA how to use Japanese (Tokennization-Mecab)",
                    "link": "https://stackoverflow.com/questions/53001497/rasa-how-to-use-japanese-tokennization-mecab"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e013",
                    "title": "How to use my own NLU module completely with Rasa Core?",
                    "link": "https://stackoverflow.com/questions/55368233/how-to-use-my-own-nlu-module-completely-with-rasa-core"
                },
                {
                    "_id": "5cbfbe32de8e8b0024c7e012",
                    "title": "How to use Hindi Model in RASA NLU?",
                    "link": "https://stackoverflow.com/questions/52586211/how-to-use-hindi-model-in-rasa-nlu"
                }
            ],
            "create_date": "2019-04-24T01:38:58.246Z",
            "__v": 0
        },
        {
            "_id": "5cc8afbb85979700243ef73f",
            "question": ":python",
            "answer": [
                {
                    "_id": "5cc8afbb85979700243ef744",
                    "title": "List of string "integers" to integers accounting for "non-numeric" strings Python",
                    "link": "https://stackoverflow.com/questions/55927965/list-of-string-integers-to-integers-accounting-for-non-numeric-strings-pytho"
                },
                {
                    "_id": "5cc8afbb85979700243ef743",
                    "title": "Chess in Python without any game library?",
                    "link": "https://stackoverflow.com/questions/55928152/chess-in-python-without-any-game-library"
                },
                {
                    "_id": "5cc8afbb85979700243ef742",
                    "title": "How can I deploy my API on IBM Cloud developed in Python and swagger?",
                    "link": "https://stackoverflow.com/questions/55928217/how-can-i-deploy-my-api-on-ibm-cloud-developed-in-python-and-swagger"
                },
                {
                    "_id": "5cc8afbb85979700243ef741",
                    "title": "Python pandas dataframe to html -- highlight entire column based on header value",
                    "link": "https://stackoverflow.com/questions/55387873/python-pandas-dataframe-to-html-highlight-entire-column-based-on-header-value"
                },
                {
                    "_id": "5cc8afbb85979700243ef740",
                    "title": "Python, convert string which contains escape characters to a dict",
                    "link": "https://stackoverflow.com/questions/55928207/python-convert-string-which-contains-escape-characters-to-a-dict"
                }
            ],
            "create_date": "2019-04-30T20:27:39.712Z",
            "__v": 0
        }
    ]
}

About

Microsserviço responsável por pesquisar dúvida no Stack Overflow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •