Giter Site home page Giter Site logo

adempiere_backend_rs's Introduction

ADempiere Backend Service from Rust

Build GH Action License GitHub release Discord

A Rest API developed with rust for ADempiere, this backend use gRPC for connect with adempiere-middleware and publish all endpoints using Rest API.

This backend was developed over salvo.rs as framework.

You are free of contribute with us for improve it.

Postman Request

Requirements

apt install -y protobuf-compiler
$ protoc --version  # Ensure compiler version is 3+

Getting Started

This project ewas developed over rust language and if you need run it just need run the follow commands

Clone it

git clone https://github.com/erpya/adempiere_backend_rs

Go to folder

cd adempiere_backend_rs

Build Project

cargo build

Start Service

cargo run --bin server

Console Output

2023-03-09T20:12:09.714Z INFO  [server] Server Address: "0.0.0.0:7878"
2023-03-09T20:12:09.714Z INFO  [server] └──!NULL!
    ├──entities
    │   ├──[POST] -> server::v1/create_entity
    │   ├──[PATCH] -> server::v1/update_entity
    │   └──[DELETE] -> server::v1/delete_entity
    └──process
        └──[POST] -> server::v1/run_process

Deploy with docker

Minimal Docker Requirements

To use this Docker image you must have your Docker engine version greater than or equal to 3.0.

Environment variables

  • MIDDLEWARE_HOST: Middleware host for use adempiere as gRPC server. Default http://0.0.0.0:50059
  • TZ: (Time Zone) Indicates the time zone to set in the nginx-based container, the default value is America/Caracas (UTC -4:00).

You can download the last image from docker hub, just run the follow command: You can build images using the follow command

docker build -t adempiere-backend-rs -f docker/Dockerfile .

After build just run it

docker run -d -p 7878:7878 --name adempiere-backend -e MIDDLEWARE_HOST="http://0.0.0.0:50059" openls/adempiere-backend-rs

See all images here

Run with Docker Compose

You can also run it with docker compose for develop enviroment. Note that this is a easy way for start the service with PostgreSQL and middleware.

Requirements

docker compose version
Docker Compose version v2.16.0

Run it

Just go to docker-compose folder and run it

cd docker-compose
docker compose up

Docker Compose

Setup a new Entity

The follow is a curl calling for create a Device

  • Table Name: M_Product_Class
  • Value: 0d005e89-42e0-4dd0-bbb7-af6b4212da6c
  • Name: Test from Rest API
  • IsDefault: false
  • Description: Test
curl --location '0.0.0.0:7878/v1/entities' \
--header 'Authorization: Bearer <Token>' \
--header 'Content-Type: application/json' \
--data '{
    "entity": {
        "table_name": "M_Product_Class",
        "attributes": [
            {
                "key": "Value",
                "string_value": "0d005e89-42e0-4dd0-bbb7-af6b4212da6c",
                "value_type": "STRING"
            },
            {
                "key": "Name",
                "string_value": "Test from Rest API",
                "value_type": "STRING"
            },
            {
                "key": "IsDefault",
                "boolean_value": false,
                "value_type": "BOOLEAN"
            },
            {
                "key": "Description",
                "string_value": "Test",
                "value_type": "STRING"
            }
        ]
    }
}'

See all endpoints here

adempiere_backend_rs's People

Contributors

yamelsenih avatar

Stargazers

 avatar

Watchers

Carlos Parada avatar  avatar  avatar Kostas Georgiou avatar  avatar

Forkers

ngja-devops

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.