BeardbAPI


NameBeardbAPI JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/teddyoweh/beardb-api
SummaryMicroservice to deploy Beardb Secured Databases Remotely.
upload_time2023-03-19 07:48:40
maintainer
docs_urlNone
authorTeddy Oweh
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # BearDB MicroService

#### ![beardbimg](https://www.beardb.net/assets/logo.d0f8a85f.png)
A microservice using the Beardb database system is a standalone service that is designed to deploy JSON databases remotely and provide API endpoints for accessing the data stored in these databases. This microservice utilizes the Beardb database system, which is a highly scalable and flexible database management system that is specifically designed to handle large amounts of data in the form of JSON documents.

The microservice provides a set of API endpoints that allow users to retrieve data from the JSON databases that are deployed on the server. These API endpoints can be accessed using HTTP POST requests, and they return data in the form of JSON objects. This allows users to easily access and manipulate the data stored in the databases, and it also enables them to integrate the microservice with other systems and applications.



## Introduction
 

### Install Libaries
```sh
$ python3 -m pip install BeardbAPI 
```
```sh
$ python3 -m pip install gunicorn
```

### Import Libraries
```py
from BeardbAPI.API import BeardbAPI
```
#### Running the Development MicroService
run.py
```py
test = BeardbAPI()
test.run(host='127.0.0.1',port=5555)
```
Terminal
```sh
$ python3 run.py
```
#### Running the Production MicroService
run.py
```py
test = BeardbAPI()
api = test.service()
```
Terminal
```sh
$ gunicorn run:api
```
The file system automatically starts the database environment in the current directory of the driver code.
To avoid that pass in the directory you want to make the database enviroment.
Run the following code
```py
test.storage(app_name='test_app',dir='')
```
#### Optimal Driver Code (Development)
run.py
```py
test = BeardbAPI()
test.storage(app_name='test_app',dir='')
test.run(host='127.0.0.1',port=5555)
```
Terminal
```sh
$ python3 run.py
```
#### Optimal Driver Code (Production)
run.py
```py
test = BeardbAPI()
test.storage(app_name='test_app',dir='')
api = test.service()
```
Terminal
```sh
$ gunicorn run:api
```
# API Documentation

## API Endpoints
```sh
[POST] - \me
[POST] - \newuser
[POST] - \newproject
[POST] - \newdatabase
[POST] - \newbucket
[POST] - \insertdata
[POST] - \fetchdata
[POST] - \fetchbyid
[POST] - \updatebyid
[POST] - \updatedata
[POST] - \deletedata
[POST] - \deletebyid
[POST] - \getbuckets
[POST] - \getdatabases
[POST] - \getprojects
```

## API QuickStart
To access any of the endpoint you have to include your email and secret in the body of the API Request.

```json
{
"email":"teddyoweh@gmail.com"
"secret":"a60e1bb1be7fc59ea08378f2840a8a4f44c07d19b315c3e78a279660a3f8a6f5"
}
```
You can get you secret by creating a new user, steps to do so is listed in the API GUIDES Below
All of the endpoints require only a **POST** Method

# API GUIDES
- [Create New User](#create-new-user)
- [Get User Data](#get-user-data)
- [Create Project](#create-project)
- [Create Database](#create-database)
- [Create Bucket](#create-bucket)
- [Insert Data](#insert-data)
- [Update Data With Query](#update-data-with-query)
- [Update Data With ID](#update-data-with-id)
- [Fetch Data With Query](#fetch-data-with-query)
- [Fetch Data With ID](#fetch-data-with-query)
- [Delete Data With Query](#delete-data-with-query)
- [Delete Data With ID](#delete-data-with-id)
- [Get Projects](#get-projects)
- [Get Databases](#get-databases)
- [Get Buckets](#get-buckets)

## Headers
```sh
Server: gunicorn
Date: Wed, 14 Dec 2022 08:11:34 GMT
Connection: close
Content-Type: application/json
Content-Length: 582
Access-Control-Allow-Origin: *
```

## Create New User
### Body
- email
- fullname
- password
### Method 
	POST

### Endpoint 
```sh
\newuser
```

### Response
```json
 

{
 "status": "success"
	"data": {
 
 	   "email": "teddyoweh@gmail.com",
           "fullname": "testt",
           "id": "db067f2a-7ac4-11ed-aaf7-324d38bf6d76",
           "password": "tstt",
           "secretKey": "a60e1bb1be7fc59ea08378f2840a8a4f44c07d19b315c3e78a279660a3f8a6f5"
           "databases": [
              {
               "name": "appp",
               "project": "idea"
              }
           ],

           "projects": [
             "idea"
           ],
           "buckets": [
             {
              "database": "appp",
              "modified": "2022-12-13 03:47:55.373527",
              "name": "users",
              "project": "idea"
             },
            ]
            "created": "2022-12-13 03:02:22.519349",

          },

}

```


## Get User Data
### Body
- email
- secret
### Method
	POST
### Endpoint 
```sh
\me
```

### Response
```json
 

{
 "status": "success"
	"data": {
 
 	   "email": "teddyoweh@gmail.com",
           "fullname": "testt",
           "id": "db067f2a-7ac4-11ed-aaf7-324d38bf6d76",
           "password": "tstt",
           "secretKey": "a60e1bb1be7fc59ea08378f2840a8a4f44c07d19b315c3e78a279660a3f8a6f5"
           "databases": [
              {
               "name": "appp",
               "project": "idea"
              }
           ],

           "projects": [
             "idea"
           ],
           "buckets": [
             {
              "database": "appp",
              "modified": "2022-12-13 03:47:55.373527",
              "name": "users",
              "project": "idea"
             },
            ]
            "created": "2022-12-13 03:02:22.519349",

          },

}

```



## Create Project

### Body
- email
- secret
- project
### Method
	POST
### Endpoint 
```sh
\newproject
```

### Response
```json
{
 "status": "success"	
}

```



## Create Database

### Body
- email
- secret
- project
- database


### Method
	POST
### Endpoint 
```sh
\newdatabase
```

### Response
```json
{
 "status": "success"	
}

```




## Create Bucket

### Body
- email
- secret
- project
- database
- bucket

### Method
	POST
### Endpoint 
```sh
\newbucket
```

### Response
```json
{
 "status": "success"	
}

```



## Insert Data

### Body
- email
- secret
- project
- database
- bucket
- data 

#### JSON FORMAT FOR Data
```json
"{'name':'teddy'}"
```

### Method
	POST
### Endpoint 
```sh
\insertdata
```

### Response
```json
{
 "status": "success"	
}

```




## Update Data With Query

### Body
- email
- secret
- project
- database
- bucket
- data 
- query

#### JSON FORMAT FOR Data & Query
```json
"{'name':'teddy'}"
```

### Method
	POST
### Endpoint 
```sh
\updatedata
```

### Response
```json
{
 "status": "success"	
}

```

## Update Data With ID

### Body
- email
- secret
- project
- database
- bucket
- data 
- id

#### JSON FORMAT FOR Data 
```json
"{'name':'teddy'}"
```

### Method
	POST
### Endpoint 
```sh
\updatedata
```

### Response
```json
{
 "status": "success"	
}

```





## Fetch Data With Query

### Body
- email
- secret
- project
- database
- bucket
- query

#### JSON FORMAT FOR  Query
```json
"{'name':'teddy'}"
```

### Method
	POST
### Endpoint 
```sh
\updatedata
```

### Response
```json
{
"data": {
	"id": "c0c5cc02-7ac8-11ed-a31f-324d38bf6d76",
	"name": "teddy"
},
"status": "success"
}

```

## Fetch Data With ID

### Body
- email
- secret
- project
- database
- bucket
- id


### Method
	POST
### Endpoint 
```sh
\fetchbyid
```

### Response
```json
{
"data": {
	"id": "c0c5cc02-7ac8-11ed-a31f-324d38bf6d76",
	"name": "teddy"
},
"status": "success"
}

```




## Delete Data With Query

### Body
- email
- secret
- project
- database
- bucket
- query

#### JSON FORMAT FOR Data & Query
```json
"{'name':'teddy'}"
```

### Method
	POST
### Endpoint 
```sh
\updatedata
```

### Response
```json
{
 "status": "success"	
}

```

## Delete Data With ID

### Body
- email
- secret
- project
- database
- bucket
- id


### Method
	POST
### Endpoint 
```sh
\updatedata
```

### Response
```json
{
 "status": "success"	
}

```



## Get Projects
### Body
- email
- secret

### Method 
	POST

### Endpoint 
```sh
\getprojects
```

### Response
```json
 

{
 "status": "success"
	"data": {
           "projects": [
             "idea"
           ],
          },

}

```


## Get Databases
### Body
- email
- secret

### Method 
	POST

### Endpoint 
```sh
\getdatabases
```

### Response
```json
 

{
 "status": "success"
	"data": {
          "databases": [
		{
		"name": "appp",
		"project": "idea"
		}
               ],
          },

}

```



## Get Buckets
### Body
- email
- secret

### Method 
	POST

### Endpoint 
```sh
\getbuckets
```

### Response
```json
 

{
 "status": "success"
	"data": {
           "buckets": {
			"database": "appp",
			"modified": "2022-12-14 00:55:30.617538",
			"name": "users",
			"project": "idea"
		},
          },

}

```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/teddyoweh/beardb-api",
    "name": "BeardbAPI",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Teddy Oweh",
    "author_email": "teddy@teddyoweh.net",
    "download_url": "https://files.pythonhosted.org/packages/4d/1e/1ecc8fd4660c1851738e9c2dac7c85fd99793c7e8074b95ddd8dfa1911b0/BeardbAPI-0.0.4.tar.gz",
    "platform": null,
    "description": "# BearDB MicroService\n\n#### ![beardbimg](https://www.beardb.net/assets/logo.d0f8a85f.png)\nA microservice using the Beardb database system is a standalone service that is designed to deploy JSON databases remotely and provide API endpoints for accessing the data stored in these databases. This microservice utilizes the Beardb database system, which is a highly scalable and flexible database management system that is specifically designed to handle large amounts of data in the form of JSON documents.\n\nThe microservice provides a set of API endpoints that allow users to retrieve data from the JSON databases that are deployed on the server. These API endpoints can be accessed using HTTP POST requests, and they return data in the form of JSON objects. This allows users to easily access and manipulate the data stored in the databases, and it also enables them to integrate the microservice with other systems and applications.\n\n\n\n## Introduction\n \n\n### Install Libaries\n```sh\n$ python3 -m pip install BeardbAPI \n```\n```sh\n$ python3 -m pip install gunicorn\n```\n\n### Import Libraries\n```py\nfrom BeardbAPI.API import BeardbAPI\n```\n#### Running the Development MicroService\nrun.py\n```py\ntest = BeardbAPI()\ntest.run(host='127.0.0.1',port=5555)\n```\nTerminal\n```sh\n$ python3 run.py\n```\n#### Running the Production MicroService\nrun.py\n```py\ntest = BeardbAPI()\napi = test.service()\n```\nTerminal\n```sh\n$ gunicorn run:api\n```\nThe file system automatically starts the database environment in the current directory of the driver code.\nTo avoid that pass in the directory you want to make the database enviroment.\nRun the following code\n```py\ntest.storage(app_name='test_app',dir='')\n```\n#### Optimal Driver Code (Development)\nrun.py\n```py\ntest = BeardbAPI()\ntest.storage(app_name='test_app',dir='')\ntest.run(host='127.0.0.1',port=5555)\n```\nTerminal\n```sh\n$ python3 run.py\n```\n#### Optimal Driver Code (Production)\nrun.py\n```py\ntest = BeardbAPI()\ntest.storage(app_name='test_app',dir='')\napi = test.service()\n```\nTerminal\n```sh\n$ gunicorn run:api\n```\n# API Documentation\n\n## API Endpoints\n```sh\n[POST] - \\me\n[POST] - \\newuser\n[POST] - \\newproject\n[POST] - \\newdatabase\n[POST] - \\newbucket\n[POST] - \\insertdata\n[POST] - \\fetchdata\n[POST] - \\fetchbyid\n[POST] - \\updatebyid\n[POST] - \\updatedata\n[POST] - \\deletedata\n[POST] - \\deletebyid\n[POST] - \\getbuckets\n[POST] - \\getdatabases\n[POST] - \\getprojects\n```\n\n## API QuickStart\nTo access any of the endpoint you have to include your email and secret in the body of the API Request.\n\n```json\n{\n\"email\":\"teddyoweh@gmail.com\"\n\"secret\":\"a60e1bb1be7fc59ea08378f2840a8a4f44c07d19b315c3e78a279660a3f8a6f5\"\n}\n```\nYou can get you secret by creating a new user, steps to do so is listed in the API GUIDES Below\nAll of the endpoints require only a **POST** Method\n\n# API GUIDES\n- [Create New User](#create-new-user)\n- [Get User Data](#get-user-data)\n- [Create Project](#create-project)\n- [Create Database](#create-database)\n- [Create Bucket](#create-bucket)\n- [Insert Data](#insert-data)\n- [Update Data With Query](#update-data-with-query)\n- [Update Data With ID](#update-data-with-id)\n- [Fetch Data With Query](#fetch-data-with-query)\n- [Fetch Data With ID](#fetch-data-with-query)\n- [Delete Data With Query](#delete-data-with-query)\n- [Delete Data With ID](#delete-data-with-id)\n- [Get Projects](#get-projects)\n- [Get Databases](#get-databases)\n- [Get Buckets](#get-buckets)\n\n## Headers\n```sh\nServer: gunicorn\nDate: Wed, 14 Dec 2022 08:11:34 GMT\nConnection: close\nContent-Type: application/json\nContent-Length: 582\nAccess-Control-Allow-Origin: *\n```\n\n## Create New User\n### Body\n- email\n- fullname\n- password\n### Method \n\tPOST\n\n### Endpoint \n```sh\n\\newuser\n```\n\n### Response\n```json\n \n\n{\n \"status\": \"success\"\n\t\"data\": {\n \n \t   \"email\": \"teddyoweh@gmail.com\",\n           \"fullname\": \"testt\",\n           \"id\": \"db067f2a-7ac4-11ed-aaf7-324d38bf6d76\",\n           \"password\": \"tstt\",\n           \"secretKey\": \"a60e1bb1be7fc59ea08378f2840a8a4f44c07d19b315c3e78a279660a3f8a6f5\"\n           \"databases\": [\n              {\n               \"name\": \"appp\",\n               \"project\": \"idea\"\n              }\n           ],\n\n           \"projects\": [\n             \"idea\"\n           ],\n           \"buckets\": [\n             {\n              \"database\": \"appp\",\n              \"modified\": \"2022-12-13 03:47:55.373527\",\n              \"name\": \"users\",\n              \"project\": \"idea\"\n             },\n            ]\n            \"created\": \"2022-12-13 03:02:22.519349\",\n\n          },\n\n}\n\n```\n\n\n## Get User Data\n### Body\n- email\n- secret\n### Method\n\tPOST\n### Endpoint \n```sh\n\\me\n```\n\n### Response\n```json\n \n\n{\n \"status\": \"success\"\n\t\"data\": {\n \n \t   \"email\": \"teddyoweh@gmail.com\",\n           \"fullname\": \"testt\",\n           \"id\": \"db067f2a-7ac4-11ed-aaf7-324d38bf6d76\",\n           \"password\": \"tstt\",\n           \"secretKey\": \"a60e1bb1be7fc59ea08378f2840a8a4f44c07d19b315c3e78a279660a3f8a6f5\"\n           \"databases\": [\n              {\n               \"name\": \"appp\",\n               \"project\": \"idea\"\n              }\n           ],\n\n           \"projects\": [\n             \"idea\"\n           ],\n           \"buckets\": [\n             {\n              \"database\": \"appp\",\n              \"modified\": \"2022-12-13 03:47:55.373527\",\n              \"name\": \"users\",\n              \"project\": \"idea\"\n             },\n            ]\n            \"created\": \"2022-12-13 03:02:22.519349\",\n\n          },\n\n}\n\n```\n\n\n\n## Create Project\n\n### Body\n- email\n- secret\n- project\n### Method\n\tPOST\n### Endpoint \n```sh\n\\newproject\n```\n\n### Response\n```json\n{\n \"status\": \"success\"\t\n}\n\n```\n\n\n\n## Create Database\n\n### Body\n- email\n- secret\n- project\n- database\n\n\n### Method\n\tPOST\n### Endpoint \n```sh\n\\newdatabase\n```\n\n### Response\n```json\n{\n \"status\": \"success\"\t\n}\n\n```\n\n\n\n\n## Create Bucket\n\n### Body\n- email\n- secret\n- project\n- database\n- bucket\n\n### Method\n\tPOST\n### Endpoint \n```sh\n\\newbucket\n```\n\n### Response\n```json\n{\n \"status\": \"success\"\t\n}\n\n```\n\n\n\n## Insert Data\n\n### Body\n- email\n- secret\n- project\n- database\n- bucket\n- data \n\n#### JSON FORMAT FOR Data\n```json\n\"{'name':'teddy'}\"\n```\n\n### Method\n\tPOST\n### Endpoint \n```sh\n\\insertdata\n```\n\n### Response\n```json\n{\n \"status\": \"success\"\t\n}\n\n```\n\n\n\n\n## Update Data With Query\n\n### Body\n- email\n- secret\n- project\n- database\n- bucket\n- data \n- query\n\n#### JSON FORMAT FOR Data & Query\n```json\n\"{'name':'teddy'}\"\n```\n\n### Method\n\tPOST\n### Endpoint \n```sh\n\\updatedata\n```\n\n### Response\n```json\n{\n \"status\": \"success\"\t\n}\n\n```\n\n## Update Data With ID\n\n### Body\n- email\n- secret\n- project\n- database\n- bucket\n- data \n- id\n\n#### JSON FORMAT FOR Data \n```json\n\"{'name':'teddy'}\"\n```\n\n### Method\n\tPOST\n### Endpoint \n```sh\n\\updatedata\n```\n\n### Response\n```json\n{\n \"status\": \"success\"\t\n}\n\n```\n\n\n\n\n\n## Fetch Data With Query\n\n### Body\n- email\n- secret\n- project\n- database\n- bucket\n- query\n\n#### JSON FORMAT FOR  Query\n```json\n\"{'name':'teddy'}\"\n```\n\n### Method\n\tPOST\n### Endpoint \n```sh\n\\updatedata\n```\n\n### Response\n```json\n{\n\"data\": {\n\t\"id\": \"c0c5cc02-7ac8-11ed-a31f-324d38bf6d76\",\n\t\"name\": \"teddy\"\n},\n\"status\": \"success\"\n}\n\n```\n\n## Fetch Data With ID\n\n### Body\n- email\n- secret\n- project\n- database\n- bucket\n- id\n\n\n### Method\n\tPOST\n### Endpoint \n```sh\n\\fetchbyid\n```\n\n### Response\n```json\n{\n\"data\": {\n\t\"id\": \"c0c5cc02-7ac8-11ed-a31f-324d38bf6d76\",\n\t\"name\": \"teddy\"\n},\n\"status\": \"success\"\n}\n\n```\n\n\n\n\n## Delete Data With Query\n\n### Body\n- email\n- secret\n- project\n- database\n- bucket\n- query\n\n#### JSON FORMAT FOR Data & Query\n```json\n\"{'name':'teddy'}\"\n```\n\n### Method\n\tPOST\n### Endpoint \n```sh\n\\updatedata\n```\n\n### Response\n```json\n{\n \"status\": \"success\"\t\n}\n\n```\n\n## Delete Data With ID\n\n### Body\n- email\n- secret\n- project\n- database\n- bucket\n- id\n\n\n### Method\n\tPOST\n### Endpoint \n```sh\n\\updatedata\n```\n\n### Response\n```json\n{\n \"status\": \"success\"\t\n}\n\n```\n\n\n\n## Get Projects\n### Body\n- email\n- secret\n\n### Method \n\tPOST\n\n### Endpoint \n```sh\n\\getprojects\n```\n\n### Response\n```json\n \n\n{\n \"status\": \"success\"\n\t\"data\": {\n           \"projects\": [\n             \"idea\"\n           ],\n          },\n\n}\n\n```\n\n\n## Get Databases\n### Body\n- email\n- secret\n\n### Method \n\tPOST\n\n### Endpoint \n```sh\n\\getdatabases\n```\n\n### Response\n```json\n \n\n{\n \"status\": \"success\"\n\t\"data\": {\n          \"databases\": [\n\t\t{\n\t\t\"name\": \"appp\",\n\t\t\"project\": \"idea\"\n\t\t}\n               ],\n          },\n\n}\n\n```\n\n\n\n## Get Buckets\n### Body\n- email\n- secret\n\n### Method \n\tPOST\n\n### Endpoint \n```sh\n\\getbuckets\n```\n\n### Response\n```json\n \n\n{\n \"status\": \"success\"\n\t\"data\": {\n           \"buckets\": {\n\t\t\t\"database\": \"appp\",\n\t\t\t\"modified\": \"2022-12-14 00:55:30.617538\",\n\t\t\t\"name\": \"users\",\n\t\t\t\"project\": \"idea\"\n\t\t},\n          },\n\n}\n\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Microservice to deploy Beardb Secured Databases Remotely.",
    "version": "0.0.4",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d1e1ecc8fd4660c1851738e9c2dac7c85fd99793c7e8074b95ddd8dfa1911b0",
                "md5": "d3bfcf8ea50c35dda52798fb82552280",
                "sha256": "236ee53c40e914d43729c3dd1ddc4431bb883d7ededc7dc06d502982ca40e814"
            },
            "downloads": -1,
            "filename": "BeardbAPI-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d3bfcf8ea50c35dda52798fb82552280",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 8790,
            "upload_time": "2023-03-19T07:48:40",
            "upload_time_iso_8601": "2023-03-19T07:48:40.524777Z",
            "url": "https://files.pythonhosted.org/packages/4d/1e/1ecc8fd4660c1851738e9c2dac7c85fd99793c7e8074b95ddd8dfa1911b0/BeardbAPI-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-19 07:48:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "teddyoweh",
    "github_project": "beardb-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "beardbapi"
}
        
Elapsed time: 0.10368s