Giter Club home page Giter Club logo

shepherd_webservice's Introduction

Webservice

QC-Tests

Testbed-WebAPI: https://shepherd.cfaed.tu-dresden.de:8000

Main Documentation: https://orgua.github.io/shepherd

Source Code: https://github.com/orgua/shepherd-webservice

Main Project: https://github.com/orgua/shepherd


The Webservice links the user to the testbed. It's written in Python and uses FastAPI to expose an interface to the internet. You can write your own tools or just use the testbed-client integrated in the Core-Datalib.

Internally the webservices utilizes the herd-lib to access the shepherd observers. Handling of data is done with Pydantic-Models that store the actual data in a database.

FastApi Webservice (current prototype)

  • DNS approved for the server: shepherd.cfaed.tu-dresden.de
  • Port 8000 requested for firewall passing
  • TODO: allow service to start with reduced rights -> get nfs in order (access needs elevation)

API-Website ReDoc OpenApiDoc


Cornerstones

Data-Containers

Pydantic

  • data validation for python dataclasses, its fast, elegantly designed and comes with batteries included
  • already trusted base for shepherd-datalib

WebFrontend

FastUI

  • restful web-framework based on pydantic2 & fastapi
  • still alpha, but usable, rapid updates
  • plan B: tbd

Streamlit

  • stable and lots to offer, but maybe limited for more
  • and there is a freemium service

WebApi

FastApi

  • high performance web framework for APIs based on pydantic
  • offers features like OAuth, SSL-Encryption (by uvicorn), user-sessions
  • choice for now

Flask

  • low level but stable framework

Database

Beanie

  • async & pydantic-based ODM or MongoDB
  • stable, but also actively developed
  • choice for now

SQLModel

  • async & pydantic-based ODM for SQLAlchemy
  • still alpha, very slow in development
  • has trouble with complex pydantic-models

ORMDantic

  • async & pydantic-based ODM for SQLAlchemy
  • currently limited to pydantic <v2 -> dealbreaker

Misc

install

  • set up a local MongoDB instance
  • install package
  • config .env, by either bringing in a backup or starting fresh
    • backup: repopulate database by using ´shepherd_wsrv init file´
    • fresh start: generate fresh salt and initialize database with shepherd_wsrv init

run server

shepherd_wsrv run

or to switch to the offline-mode activate the redirect to the docs

shepherd_wsrv redirect

save state

shepherd_wsrv backup file_name

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.