Giter Club home page Giter Club logo

botflowapi's Introduction

BotFlow API

This repository is a Rest API for the BotFlow.

Get started

We use Docker and Docker-Compose for development environment. You only need this two tools to run this project.

To start the django server and the mongo database, follow the instructions bellow:

cd BotFlowAPI
sudo docker-compose up --build

After a small slice of time the django server will be ready at http://localhost:8000/api/v1/

To stop the containers, run:

sudo docker-compose down

or, to remove the volumes (and erase the database):

sudo docker-compose down --volumes

If there is no previously made database, there will be created a default project with examples of utters, intents and stories. The content used to populate the database is contained in src/api/fixtures/initial.json. If no seed is necessary, edit runserver.sh to remove the seed script call:

#! /bin/bash

cd /src
python3 manage.py makemigrations
python3 manage.py migrate
# python3 manage.py shell < populate_models.py
python3 manage.py runserver 0.0.0.0:8000

Architecture

All the persistent data is stored on a non relational database (mongo db), we choose this option because our data are like documents and make more sense store them as json.

Our models are, project, story, intent, utter, a project is an abstraction for a new bot project that will be managed by the BotFlow, the other abstractions are like the normal terminologies of a rasa bot.

Usage

Since the API follows the REST architecture, those are the available endpoints:

Projects

  • GET, PUT /api/v1/projects
  • GET, PUT, PATCH, DELETE /api/v1/projects/:project_id

Intents

  • GET, PUT /api/v1/projects/:project_id/intents
  • GET, PUT, PATCH, DELETE /api/v1/projects/:project_id/intents/:intent_id
  • GET /api/v1/projects/:project_id/intents/:intent_id/example

Utters

  • GET, PUT /api/v1/projects/:project_id/utters
  • GET, PUT, PATCH, DELETE /api/v1/projects/:project_id/utters/:utter_id
  • GET /api/v1/projects/:project_id/utters/:utter_id/example

Stories

  • GET, PUT /api/v1/projects/:project_id/stories
  • GET, PUT, PATCH, DELETE /api/v1/projects/:project_id/stories/:story_id

To download the bot-readable content files, send a GET request to:

  • /api/v1/files/:project_id/zip/

The used JSON format can be found in Django Rest Framework web interface: http://localhost:8000/api/v1/

Lincese

The entire BotFlow platform is developed under the license GPL3

botflowapi's People

Contributors

arthurbdiniz avatar brunanayara avatar brunapinos avatar ednunes avatar ezequieldeoliveira avatar gabibguedes avatar joaovitor3 avatar kahcosta avatar matheusmiranda avatar rochacarla avatar rodrigocam avatar victorcmoura avatar ygortgaleno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.