All Projects β†’ vasanthv β†’ Jsonbox

vasanthv / Jsonbox

Licence: mit
HTTP-based JSON storage.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to Jsonbox

Deepkit Framework
A new full-featured and high-performance web framework for sophisticated Typescript projects like complex admin interfaces, websites, games, desktop and mobile apps.
Stars: ✭ 307 (-87.42%)
Mutual labels:  json, mongodb
Mongodb Json Files
πŸ“¦ A curated list of JSON / BSON datasets from the web in order to practice / use in MongoDB
Stars: ✭ 456 (-81.31%)
Mutual labels:  json, mongodb
Bson4jackson
A pluggable BSON generator and parser for the Jackson JSON processor.
Stars: ✭ 244 (-90%)
Mutual labels:  json, mongodb
Treefrog Framework
TreeFrog Framework : High-speed C++ MVC Framework for Web Application
Stars: ✭ 885 (-63.73%)
Mutual labels:  json, mongodb
Kafka Connect Mongodb
**Unofficial / Community** Kafka Connect MongoDB Sink Connector - Find the official MongoDB Kafka Connector here: https://www.mongodb.com/kafka-connector
Stars: ✭ 137 (-94.39%)
Mutual labels:  json, mongodb
Qxorm
QxOrm library - C++ Qt ORM (Object Relational Mapping) and ODM (Object Document Mapper) library - Official repository
Stars: ✭ 176 (-92.79%)
Mutual labels:  json, mongodb
Bigchaindb
Meet BigchainDB. The blockchain database.
Stars: ✭ 3,768 (+54.43%)
Mutual labels:  json, mongodb
Avocado
Strongly-typed MongoDB driver for Rust
Stars: ✭ 70 (-97.13%)
Mutual labels:  json, mongodb
Mongoose Patch History
Mongoose plugin that saves a history of JSON patch operations for all documents belonging to a schema in an associated 'patches' collection
Stars: ✭ 82 (-96.64%)
Mutual labels:  json, mongodb
Bricks
A standard library for microservices.
Stars: ✭ 142 (-94.18%)
Mutual labels:  json, mongodb
Autoserver
Create a full-featured REST/GraphQL API from a configuration file
Stars: ✭ 188 (-92.3%)
Mutual labels:  json, mongodb
Zkillboard
Easy does it
Stars: ✭ 212 (-91.31%)
Mutual labels:  mongodb
Jsontreeviewer
json formatter/viewer/pretty-printer (with jsonTree javascript-library)
Stars: ✭ 211 (-91.35%)
Mutual labels:  json
Webdis
A Redis HTTP interface with JSON output
Stars: ✭ 2,465 (+1.02%)
Mutual labels:  json
Bilibili Api Collect
ε“”ε“©ε“”ε“©-API攢集整理【不断更新中....】
Stars: ✭ 4,497 (+84.3%)
Mutual labels:  json
Chartbrew
Open-source web platform for creating charts out of different data sources (databases and APIs) πŸ“ˆπŸ“Š
Stars: ✭ 199 (-91.84%)
Mutual labels:  mongodb
Json Flatfile Datastore
Simple JSON flat file data store with support for typed and dynamic data.
Stars: ✭ 212 (-91.31%)
Mutual labels:  json
Jansson
C library for encoding, decoding and manipulating JSON data
Stars: ✭ 2,504 (+2.62%)
Mutual labels:  json
Socialite
Social Data Reference Architecture - This Repository is NOT a supported MongoDB product
Stars: ✭ 210 (-91.39%)
Mutual labels:  mongodb
Cornichon
Scala DSL for testing HTTP JSON API
Stars: ✭ 211 (-91.35%)
Mutual labels:  json

⚠️ Jsonbox.io cloud instance was shut down on May 31st, 2021 due to a lack of maintenance time. The Jsonbox.io's source code will continue to be open-sourced in this repository.

jsonbox.io

A HTTP based JSON storage. It lets you store, read & modify JSON data over HTTP APIs for FREE. Ideal for small projects, prototypes or hackathons, where you don't have to spin up your own data store.

With the new protected boxes (introduced in v2), you can even power your websites with jsonbox.io.

API Documentation

Base URL: https://jsonbox.io/

Create

You can create a record (or add a record) to a box by using HTTP post to jsonbox.io/${BOX_ID}.

curl -X POST 'https://jsonbox.io/demobox_6d9e326c183fde7b' \
    -H 'content-type: application/json' \
    -d '{"name": "Jon Snow", "age": 25}'

Response:

{
  "_id": "5d776a25fd6d3d6cb1d45c51",
  "name": "Jon Snow",
  "age": 25,
  "_createdOn": "2019-09-10T09:17:25.607Z"
}

You can also create multiple records at once by passing an array

curl -X POST 'https://jsonbox.io/demobox_6d9e326c183fde7b' \
    -H 'content-type: application/json' \
    -d '[{"name": "Daenerys Targaryen", "age": 25}, {"name": "Arya Stark", "age": 16}]'
[
  {
    "_id": "5d776b75fd6d3d6cb1d45c52",
    "name": "Daenerys Targaryen",
    "age": 25,
    "_createdOn": "2019-09-10T09:23:01.105Z"
  },
  {
    "_id": "5d776b75fd6d3d6cb1d45c53",
    "name": "Arya Stark",
    "age": 16,
    "_createdOn": "2019-09-10T09:23:01.105Z"
  }
]

You can also pass in an optional collections parameter in the URL to group records jsonbox.io/${BOX_ID}/${COLLECTION}.

Note: A valid ${BOX_ID} & ${COLLECTION} should contain only alphanumeric characters & _. ${BOX_ID} should be at least 20 characters long.

Read

Use HTTP GET to read all the records or a single record. You can also query & sort the records.

curl -X GET 'https://jsonbox.io/demobox_6d9e326c183fde7b'
[
  {
    "_id": "5d776b75fd6d3d6cb1d45c52",
    "name": "Daenerys Targaryen",
    "age": 25,
    "_createdOn": "2019-09-10T09:23:01.105Z"
  },
  {
    "_id": "5d776b75fd6d3d6cb1d45c53",
    "name": "Arya Stark",
    "age": 16,
    "_createdOn": "2019-09-10T09:23:01.105Z"
  },
  {
    "_id": "5d776a25fd6d3d6cb1d45c51",
    "name": "Jon Snow",
    "age": 25,
    "_createdOn": "2019-09-10T09:17:25.607Z"
  }
]

To get all records inside a collection Sample collection name: "users":

curl -X GET 'https://jsonbox.io/demobox_6d9e326c183fde7b/users'

To sort the records by a specific field use sort query param. In the below example the output will be sorted in the descending order of the age.

curl -X GET 'https://jsonbox.io/demobox_6d9e326c183fde7b?sort=-age'

To read a specific record use jsonbox.io/${BOX_ID}/${RECORD_ID}.

curl -X GET 'https://jsonbox.io/demobox_6d9e326c183fde7b/5d776a25fd6d3d6cb1d45c51'

To query records, you have to pass the key & value as shown below.

curl -X GET 'https://jsonbox.io/demobox_6d9e326c183fde7b?q=name:arya%20stark'

All the accepted query params are as follows.

Param Description Default
sort Used to sort the result set by the specific field. Add a prefix "-" to sort in reverse order. -_createdOn
skip Used to skip certain no. of records. Can be used for pagination. 0
limit Used to limit the results to a specific count. Can be used for pagination. Max. is 1000. 20
q Query for filtering values. Check out the format below.

Filtering

You can pass a filter in a query by passing them in URL param q as shown below:

curl -X GET 'https://jsonbox.io/demobox_6d9e326c183fde7b?q=name:arya%20stark,age:>13'

The above sample will look for the name arya stark and age greater than 13. You can filter on Number, String & Boolean values only.

Different filters for Numeric values.

Sample
To filter values greater than or less than a specific value q=age:>10 or q=age:<10
To filter values greater (or less) than or equal to a specific value q=age:>=10 or q=age:<=10
To filter values that match a specific value. q=age:=10

Different filters for String values.

Sample
Filter values that start with a specific string q=name:arya*
Filter values that end with a specific string q=name:*stark
Filter values where a specific string appears anywhere in a string q=name:*ya*
Filter values that match a specific string q=name:arya%20stark

You can combine multiple fields by separating them with commas as shown below:

https://jsonbox.io/demobox_6d9e326c183fde7b?q=name:arya%20stark,age:>13,isalive:true

Update

Use HTTP PUT to update record one by one. Please note that this will not patch the record, it is full update. A Bulk update is not supported yet.

curl -X PUT 'https://jsonbox.io/demobox_6d9e326c183fde7b/5d776b75fd6d3d6cb1d45c53' \
    -H 'content-type: application/json' \
    -d '{"name": "Arya Stark", "age": 18}'

Delete

Two approaches are available for delete

  • To delete a specific record use HTTP DELETE with jsonbox.io/${BOX_ID}/${RECORD_ID}
curl -X DELETE 'https://jsonbox.io/demobox_6d9e326c183fde7b/5d776b75fd6d3d6cb1d45c53'
  • To delete based on a filter use HTTP DELETE with jsonbox.io/${BOX_ID}?q={QUERY}
curl -X DELETE 'https://jsonbox.io/demobox_6d9e326c183fde7b?q=name:arya%20stark,age:>13'

Protected Box

A protected box is similar to a regular box, but you need an API-KEY to create / update / delete records. Reading records is open and does not need API-KEY. Pass the API-KEY using the X-API-KEY HTTP header.

curl -X POST 'https://jsonbox.io/demobox_6d9e326c183fde7b' \
    -H 'content-type: application/json' \
  --H 'x-api-key: 7b3b910b-a7ad-41e8-89d6-5e28e2e34e70' \
    -d '{"name": "Jon Snow", "age": 25}'

You can also use Authorization: API-KEY 7b3b910b-a7ad-41e8-89d6-5e28e2e34e70 header. An API-KEY should be a valid GUID/UUID.

How to create a protected box?

You create a protected box by pushing your first record to a new box with an API-KEY. All the subsequent write requests to that box expect the API-KEY to be passed. You cannot change a public box to protected or vice versa.

Getting Box metadata

Use /_meta/${BOX_ID} in a GET request to get metadata of a box

https://jsonbox.io/_meta/demobox_6d9e326c183fde7b

The result will have the following format

{
  "_count": 3,
  "_createdOn": "2020-03-12T04:45:22.000Z",
  "_updatedOn": "2020-03-12T06:23:26.000Z"
}
  • _count - the record count in the box
  • _createdOn - the oldest record's created date
  • _updatedOn - the most recent updated date

Optional IP Filtering

When running your own instance localy, you could define IP Address filtering.
Set the value of FILTER_IP_SET in config.js to the set of allowed IP addresses.

Single IP:

FILTER_IP_SET: ['192.168.1.123']

Using CIDR subnet masks for ranges:

FILTER_IP_SET: ['127.0.0.1/24']

Using IP ranges:

FILTER_IP_SET: [['127.0.0.1', '127.0.0.10']]

Using wildcard ip ranges and nginx forwarding:

FILTER_IP_SET: ['10.1.*.*', '123.??.34.8*']

Limitations

This is FREE service, so we have to have some limitations to avoid abuse and stay free forever.

  1. The request body cannot be more than 50KB.
  2. Can't push or pull more than 1000 records at a time.
  3. POST requests are rate-limited to 100 per hour per IP address
  4. There is no limit on the number of records you store in a box, but please don't abuse the API by storing large datasets of more than 5000 records. This is meant for small projects and that's why it is offered FREE of cost.
  5. 30 days of data retention.
  6. No backup. If your data is lost due to some technical issues, its lost forever.

Wrappers

Note: The wrappers listed here are from other sources and have not been tested or validated by us

How to run locally

Fork this repo and then clone it:

git clone https://github.com/<your_name>/jsonbox.git

You need MongoDB to run this application. If you don't already have MongoDB, go to the official documentation and follow the instructions there. Once you have MongoDB installed, run

mongo

to start the MongoDB instance. Then cd into directory where the repo was cloned and install the dependencies:

npm install

Then just run

npm start

to start the development server on port 3000. Your jsonbox instance will be running on http://localhost:3000. Alternatively you can run the application using docker with docker-compose up.

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].