thoth-station / user-api

Web Service exposing Thoth functions to the RESTful worlds
https://thoth-station.github.io/
GNU General Public License v3.0
8 stars 18 forks source link
ai-stacks artificial-intelligence hacktoberfest software-quality thoth

Thoth User-facing API

.. image:: https://img.shields.io/github/v/tag/thoth-station/user-api?style=plastic :target: https://github.com/thoth-station/user-api/releases :alt: GitHub tag (latest by date)

.. image:: https://quay.io/repository/thoth-station/user-api/status :target: https://quay.io/repository/thoth-station/user-api?tab=tags :alt: Quay - Build

.. image:: https://api.codacy.com/project/badge/Grade/d8f62cde59b84854ac425d148570f1ab :alt: Codacy Badge :target: https://app.codacy.com/app/thoth-station/user-api?utm_source=github.com&utm_medium=referral&utm_content=thoth-station/user-api&utm_campaign=Badge_Grade_Dashboard

Thoth Deployment

You can find Thoth's deployment at khemenu.thoth-station.ninja <https://khemenu.thoth-station.ninja/>__.

Talking to API

User API is the main interaction point for a user or bot with Thoth. The API itself exposes endpoints that are well documented using OpenAPI (see openapi directory present in the repo). There are exposed only endpoints that can be useful for a user in some way.

If you would like to programmatically access this API service, the preferred way for interaction is the autogenerated swagger-client available in the Thamos repository <https://github.com/thoth-station/thamos>__ (see autogenerated documentation for more info). You can be also ensured that this client is kept up2date respecting the current API state.

Installation and deployment ###########################

The service is built using OpenShift Source-to-Image and deployed automatically with Thoth's deployment available in the thoth-station/thoth-application repository <https://github.com/thoth-station/thoth-application>__.

Running User API locally ########################

User API can be run locally in a mode when it still talks to the cluster. To run User API locally, create .env file out out .env.template and adjust environment variable values as desired (see thoth-station/storages <https://github.com/thoth-station/storages/>__ for more info):

.. code-block:: console

cp .env.template .env vim .env

Once the environment is properly setup, you can run User API locally:

.. code-block:: console

pipenv install pipenv run gunicorn thoth.user_api.openapi_server:app --config gunicorn.conf.py