Coder Social home page Coder Social logo

alanbubalo / modeling-low-code-databases-with-executable-uml Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 29 KB

REST API for transforming UML class diagram into Baserow database.

Home Page: https://modeling-low-code-databases-with-executable-uml.vercel.app

License: MIT License

Python 99.61% Dockerfile 0.27% Shell 0.12%
api-rest baserow uml-class-diagram

modeling-low-code-databases-with-executable-uml's Introduction

REST API

Introduction

REST API for transforming UML class diagram into Baserow database.

UML class diagram as an XMI file is parsed in Python and then a database is created with all tables as classes, fields as attributes, enumerations and associations from a model.

Limitations

Supported versions

  • XMI: 2.1
  • UML: 2.0

API is currently adjusted to XMI models exported from StarUML software's extension.

Use cases

  • Add, reupload, rename and delete XMI files
  • Generate and manage multiple databases in Baserow from uploaded UML models
  • CRUD operations on table data

Basic use cases

Create user

You can create an account to keep your models' metadata and files safe.

Example:

response = requests.post(
    f'{url}/api/v1/users',
    json={
        'email': email,
        'password': password
    },
    header={'Content-Type': 'application/json'})

Make sure to retrieve access and refresh token from the response and put them in the header.

Example:

response = requests.get(
    f'{url}/api/v1/test_protected',
    header={'Authorization': f'Bearer {access_token}'})

Upload XMI files

Upload XMI files with REST API to save them and attach them to the model.

Example:

response = requests.put(
    f'{url}/api/v1/files/{filename}',
    data=xmi_file,
    header={
        'Authorization': f'Bearer {access_token}',
        'Content-Type': 'application/xml'
    })

Create model and generate database

Creating a new model, API gathers information from the uploaded XMI file and generates a database in Baserow.

Example:

response = requests.post(
    f'{url}/api/v1/models',
    json={
        'database_url': database_name, # provide if baserow is self hosted
        'database_name': database_name,
        'baserow_token': refresh_token,
        'group_id': group_id,
        'filename': filename
    },
    header={
        'Authorization': f'Bearer {access_token}',
        'Content-Type': 'application/json'
    })

Update the database with one request

You can update the database with one request. When updating model information, one more request is necessary to confirm the change in Baserow.

Example:

response = requests.patch(
    f'{url}/api/v1/models/{model_id}',
    header={'Authorization': f'Bearer {access_token}'})

CRUD operations on Baserow tables

Directly access and manage data within each table in your model.

Example:

response = requests.post(
    f'{url}/api/v1/data/model/{model_id}/table/{table_name}',
    json={
        'field_1': data_1,
        'field_2': data_2,
        'field_3': data_3
    },
    header={
        'Authorization': f'Bearer {access_token}',
        'Content-Type': 'application/json'
    })

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.