Code Monkey home page Code Monkey logo

tern-rest-api's Introduction

Tern REST API


NOTE

This project still not functional. Please wait for the first functional release (0.0.1)


The Tern REST API is a RESTful API for Tern Project.

Currently, the API is not functional as it is still in the Specification development and project structure phase.

The specification is available at Tern REST API Offline Swagger, and contributions are welcome.

Mainly the API is implemented asynchronously on the server-side as the tern reports can take a while to be generated.

  sequenceDiagram
    participant User
    participant API
    participant Tern
    User->>API: GET /api/v1/version
    API-->>User: 200 OK, JSON with version data
    User->>API: POST /api/v1/reports with JSON payload
    API-->>User: 200 OK, JSON with request id
    User->>API: POST /api/v1/reports/status with JSON payload
    API-->>User: 200 OK, JSON with status RUNNING
    API->>Tern: Process the request calling asynchronous
    Tern->>Tern: Processing
    loop
    User->>API: POST /api/v1/reports/status with JSON payload
    Tern->>Tern: Processing
    API-->>User: 200 OK, JSON with status RUNNING or UNKOWN
    end
    Tern->>API: Provides the answer for the id
    User->>API: POST /api/v1/reports/status with JSON payload
    API-->>User: 200 OK, JSON with status FAILED with error or DONE with report
Loading

Development

This repository has the requirements.txt and the requirements-dev.txt files to help build your virtual environment.

We also recommend using Pipenv to manage your virtual environment.

$ Pip install pipenv
$ pipenv shell

Install development requirements

$ pipenv install -d

Running the development Tern REST API

Runing the API locally

$ flask run --reload

Open http://localhost:5000/ in your browser.

Tests

We use Tox to manage running the tests.

Running tests

$ tox

Managing the requirements

Installing new requirements

$ pipenv install {package}

Development requirements

$ pipenv install -d {package}

Updating packages

$ pipenv update

Updating the requirements.txt and requirements-dev.txt

$ pipenv lock -r > requirements.txt
$ pipenv lock -r -d > requirements-dev.txt

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.