GithubHelp home page GithubHelp logo

taarifa / taarifa_backend Goto Github PK

View Code? Open in Web Editor NEW
0.0 5.0 1.0 625 KB

Prototype of a Taarifa backend (DEPRECATED, use TaarifaAPI)

License: Other

Python 68.21% Shell 7.23% CSS 0.74% JavaScript 8.26% HTML 15.56%

taarifa_backend's Introduction

Taarifa Backend

Build Status

Prototype of a Taarifa backend, now with an added map functionality!

Installation

Install MongoDB and run mongod

mongod

If you're on a Ubuntu/Debian system and have installed MongoDB via your package manager, start the service instead

sudo service mongodb start

Install python dependencies using pip

pip install -r requirements.txt

Start the server

python taarifa_backend/manage.py runserver

Run the curl_send_report script from the console to try sending a report via JSON

API work notes

The API will support the following requests:

Services:

Defines a report template, i.e. the set of fields which are part of the report, their type and their contraints. This is comparable to a custom form.

Create a new service

POST services

List services

GET services

Retrieve / modify / delete service service_id

GET services/{service_id}
UPDATE services/{service_id}
DELETE services/{service_id}

Reports:

The collection of information about which a report is made. Must use one previously defined service.

Create a new report

POST reports

List reports

GET reports

Retrieve / modify / delete report report_id

GET reports/{report_id}
UPDATE reports/{report_id}
DELETE reports/{report_id}

Workflow:

Defines a set of possible states and the possible transitions between them. Workflows can be attached to services. As a first step a workflow is just a set of states.

Create a new workflow

POST workflows

List workflows

GET workflows

Retrieve / modify / delete report report_id

UPDATE workflows/{workflow_id}
DELETE workflows/{workflow_id}
GET workflows/{workflow_id}

taarifa_backend's People

Contributors

kynan avatar nicowe avatar aidan avatar dgorissen avatar markiliffe avatar funsim avatar

Watchers

 avatar Drew avatar  avatar James Cloos avatar  avatar

Forkers

aidan

taarifa_backend's Issues

Services schema

A service currently has the following schema:

service_schema = {
    'name': {
        'type': 'string',
        'required': True,
    },
    'fields': {
        'type': 'dict',
        'required': True,
    },
    'unique': {
        'type': 'boolean',
        'default': False,
    },
    'description': {
        'type': 'string',
    },
    'group': {
        'type': 'string',
    },
    'keywords': {
        'type': 'list',
        'schema': {
            'type': 'string',
        },
    },
    'protocol_type': {
        'type': 'string',
    },
    'service_name': {
        'type': 'string',
        'required': True,
    },
    'service_code': {
        'type': 'string',
        'required': True,
        'unique': True,
    },
}

This schema is interpreted as follows:

  • name: human readable name, may be any string
  • fields: defines the schema of the service where each field must have a valid Eve schema
  • unique: must documents of a given service be unique?
  • description: human readable description, any string
  • group: What do we want this to be?
  • keywords: list of keywords characterizing the service
  • protocol_type: Still needed?
  • service_name: name used for the endpoint and the collection where documents for this service are stored
  • service_code: unique code used to identify the schema for a document

Is this schema still appropriate? I think we need to at least:

  • define what protocol_type is supposed to be or drop it
  • define what group is supposed to be or drop it

LoadMap() or LoadData()

On deploying the current version of master 014762b, the loadMap() function is lost in the call. On speaking to @dgorissen, he mentions that this is due to the function being renamed loadData().

Report versioning

Reports need to support different versions i.e. updating a report should not just overwrite data.

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.