All Projects → davidesantangelo → Datoji

davidesantangelo / Datoji

Licence: mit
A tiny JSON storage service. Create, Read, Update, Delete and Search JSON data.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Datoji

Jsonapi parameters
Rails-way to consume JSON:API input
Stars: ✭ 50 (-77.48%)
Mutual labels:  api, json-api, json, rails
Jsonapi Rails
Rails gem for fast jsonapi-compliant APIs.
Stars: ✭ 242 (+9.01%)
Mutual labels:  api, json-api, json, rails
Json Api Dart
JSON:API client for Dart/Flutter
Stars: ✭ 53 (-76.13%)
Mutual labels:  api, rest-api, json-api, json
Pantry
🥑 Free data storage as a service that allows devs to store JSON for multiple apps & users. A good resource when building personal projects, apps for hackathons, and prototypes alike.
Stars: ✭ 42 (-81.08%)
Mutual labels:  api, json, redis, storage
Jsonapi Utils
Build JSON API-compliant APIs on Rails with no (or less) learning curve.
Stars: ✭ 191 (-13.96%)
Mutual labels:  api, json-api, json, rails
Jsonapi.rb
Lightweight, simple and maintained JSON:API support for your next Ruby HTTP API.
Stars: ✭ 116 (-47.75%)
Mutual labels:  api, json-api, rails
Dato.rss
The best RSS Search experience you can find
Stars: ✭ 122 (-45.05%)
Mutual labels:  rest-api, postgresql, rails
Coolstore Microservices
A full-stack .NET microservices build on Dapr and Tye
Stars: ✭ 1,903 (+757.21%)
Mutual labels:  rest-api, redis, postgresql
Grafanajsondatasource
Grafana datasource to load JSON data over your arbitrary HTTP backend
Stars: ✭ 146 (-34.23%)
Mutual labels:  api, rest-api, json
Json Serverless
Transform a JSON file into a serverless REST API in AWS cloud
Stars: ✭ 108 (-51.35%)
Mutual labels:  api, rest-api, json
Bricks
A standard library for microservices.
Stars: ✭ 142 (-36.04%)
Mutual labels:  json-api, json, redis
Dialetus Service
API to Informal dictionary for the idiomatic expressions that each Brazilian region It has
Stars: ✭ 202 (-9.01%)
Mutual labels:  api, rest-api, json
Coronavirus Tracker Api
🦠 A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!
Stars: ✭ 1,577 (+610.36%)
Mutual labels:  api, rest-api, json-api
Symfony Jsonapi
JSON API Transformer Bundle for Symfony 2 and Symfony 3
Stars: ✭ 114 (-48.65%)
Mutual labels:  api, json-api, json
Sabisu Rails
Simple and powerful engine for exploring your Rails api application
Stars: ✭ 129 (-41.89%)
Mutual labels:  api, json, rails
Laravel Api Boilerplate
A Boilerplate Project For Laravel API's (NOT MAINTAINED)
Stars: ✭ 113 (-49.1%)
Mutual labels:  api, rest-api, json-api
Kitsu Server
🚂 Rails API server for Kitsu
Stars: ✭ 145 (-34.68%)
Mutual labels:  api, json-api, rails
Octosql
OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.
Stars: ✭ 2,579 (+1061.71%)
Mutual labels:  json, redis, postgresql
Flexirest
Flexirest - The really flexible REST API client for Ruby
Stars: ✭ 188 (-15.32%)
Mutual labels:  api, json, rails
Flipper
🐬 Beautiful, performant feature flags for Ruby.
Stars: ✭ 2,732 (+1130.63%)
Mutual labels:  api, redis, rails

DatoJi

A FREE RESTful HTTP based JSON API. It lets you create, read, update, delete and search JSON data over HTTP APIs. Ideal for small hobbies projects, MVP or just for fun, where you don't need to create your personal data storage.

Schema

All API access is over HTTPS, and accessed from https://datoji.dev. All data is sent and received as JSON.

Blank fields are included as null instead of being omitted.

All timestamps return in ISO 8601 format:

YYYY-MM-DDTHH:MM:SSZ

All responses follow the JSON:API guidelines:

JSON:API is a specification for how a client should request that resources be fetched or modified, and how a server should respond to those requests.

JSON:API is designed to minimize both the number of requests and the amount of data transmitted between clients and servers. This efficiency is achieved without compromising readability, flexibility, or discoverability.

{
  "data": {
    "type": "entry",
    "id": "1",
    "attributes": {
      // ... this entry's attributes
    },
    "relationships": {
      // ... this entry's relationships
    }
  }
}

Pagination

Requests that return multiple items will be paginated to 20 items by default. You can specify further pages with the ?page parameter. Pagination information is available inside headers. Example:

Current-Page: 1
Per-Page: 20
Link:<https://datoji.dev/packs/{PACK_ID}/entries?page=1>; rel="first", <https://datoji.dev/packs/{PACK_ID}/entries?page=24>; rel="last"
Total: 464

Documentation

Authentication

API uses OAuth 2.0 token for user authorization and API authentication. Applications must be authorized and authenticated before they can fetch data.

curl -X POST 'https://datoji.dev/tokens' -H 'content-type: application/json'


{
  "data": {
    "id": "b14e1665-5ab3-4b71-a669-b6280d64147e",
    "type": "token",
    "attributes": {
      "key": "uBrcpRP3QVgEJeuffuENPeSc2ObAaGoO",
      "created_at": "2020-06-12T12:51:18.971Z"
    }
  }
}

Note

You must use Authorization: Token 80-Pk8MtTMLXT_ThBaCDuDtF1eTyVmQj header for ALL requests.

CRUD PACKS

Create

A Pack is a container of all the entries. Before you can create the entries you must create the container to get the ID with which you can make the calls.

curl -X POST 'https://datoji.dev/packs' -H 'content-type: application/json' -H 'Authorization: Token {KEY}'
    

Body

{
  "entries": [
    { 
      "entry": 
        {
          "name": "Davide Santangelo", 
          "role": "Senior Team Lead" 
        } 
    }
  ]
}

result


{
  "data": {
    "id": "918f6a68-89f7-4f0c-aa6d-73b447d92819",
    "type": "pack",
    "attributes": {
      "entries_count": 0,
      "created_at": "2020-06-11T14:22:12.354Z",
      "updated_at": "2020-06-11T14:22:12.354Z"
    }
  }
}

Read

curl -X GET 'https://datoji.dev/packs/{PACK_ID}' -H 'content-type: application/json' -H 'Authorization: Token {KEY}'
    

Clear

With the clear method you can clean the pack from all entries.

curl -X POST 'https://datoji.dev/packs/{PACK_ID}/clear' -H 'content-type: application/json' -H 'Authorization: Token {KEY}'
    

Delete

With the clear method you can clean the pack from all entries.

curl -X DELETE 'https://datoji.dev/packs/{PACK_ID}' -H 'content-type: application/json' -H 'Authorization: Token {KEY}'
    

CRUD ENTRY

Create

curl -X POST 'https://datoji.dev/{PACK_ID}/entries' \
    -H 'content-type: application/json' \
    -H 'Authorization: Token {KEY}' \
    -d '{ "entry": { "repo": "davidesantangelo/datoji", "private": false, "stargazers_count": 0 } }'
    

{
  "data": {
    "id": "04b7992a-40de-496b-a994-a661a9893df7",
    "type": "entry",
    "attributes": {
      "data": {
        "repo": "davidesantangelo/datoji",
        "private": "false",
        "stargazers_count": 0
      },
      "created_at": "2020-06-11T14:37:34.857Z",
      "updated_at": "2020-06-11T14:37:34.857Z"
    },
    "relationships": {
      "pack": {
        "data": {
          "id": "918f6a68-89f7-4f0c-aa6d-73b447d92819",
          "type": "pack"
        }
      }
    }
  }
}

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

curl -X POST 'https://datoji.dev/{PACK_ID}/entries/bulk' \
    -H 'content-type: application/json' \
    -H 'Authorization: Token {KEY}' \
    -d '{ "entries": [{ "repo": "davidesantangelo/datoji" },{ "repo": "davidesantangelo/tuns" },{ "repo": "davidesantangelo/emailhunter" }]}'
    

The result in case of success is an array of IDs.

[
  "6403b952-ce7d-4759-96d9-c8a913e166ec",
  "5993d6b2-16cd-4d78-a7c8-2aba0f27af0d",
  "b5861049-7c4d-485d-b795-669b9578b78d"
]

Read

Use HTTP GET to read all the records or a single record.

You can also specify a param &order=[asc/desc] by created_at field. Can be one of asc or desc. Default: desc.

curl -X GET 'https://datoji.dev/packs/{PACK_ID}/entries' -H 'Authorization: Token {KEY}'


{
  "data": [
    {
      "id": "beb31992-0268-48b4-b5bc-b2cad0add5c7",
      "type": "entry",
      "attributes": {
        "data": {
          "repo": "davidesantangelo/datoji",
          "private": "false",
          "stargazers_count": 0
        },
        "created_at": "2020-06-11T14:59:00.581Z",
        "updated_at": "2020-06-11T14:59:00.581Z"
      },
      "relationships": {
        "pack": {
          "data": {
            "id": "918f6a68-89f7-4f0c-aa6d-73b447d92819",
            "type": "pack"
          }
        }
      }
    },
    {
      "id": "b858bf82-1abf-4cb0-a9e0-2a59f1b7f30d",
      "type": "entry",
      "attributes": {
        "data": {
          "repo": "davidesantangelo/feedirss-api",
          "private": "false",
          "stargazers_count": 326
        },
        "created_at": "2020-06-11T14:37:08.293Z",
        "updated_at": "2020-06-11T14:37:08.293Z"
      },
      "relationships": {
        "pack": {
          "data": {
            "id": "918f6a68-89f7-4f0c-aa6d-73b447d92819",
            "type": "pack"
          }
        }
      }
    }
  ]
}


curl -X GET 'https://datoji.dev/packs/{PACK_ID}/entries/{ENTRY_ID}' -H 'Authorization: Token {KEY}'


{
  "data": {
    "id": "04b7992a-40de-496b-a994-a661a9893df7",
    "type": "entry",
    "attributes": {
      "data": {
        "repo": "davidesantangelo/feedirss-api",
        "private": "false",
        "stargazers_count": 326
       },
      "created_at": "2020-06-11T14:37:34.857Z",
      "updated_at": "2020-06-11T14:37:34.857Z"
    },
    "relationships": {
      "pack": {
        "data": {
          "id": "918f6a68-89f7-4f0c-aa6d-73b447d92819",
          "type": "pack"
        }
      }
    }
  }
}

Update

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

curl -X PUT 'https://datoji.dev/packs/{PACK_ID}/entries/{ENTRY_ID}' \
    -H 'content-type: application/json' \
    -H 'Authorization: Token {KEY}' \
    -d '{ "entry": { "repo": "davidesantangelo/datoji", "private": true, "stargazers_count": 10 } }'
    

{
  "data": {
    "id": "04b7992a-40de-496b-a994-a661a9893df7",
    "type": "entry",
    "attributes": {
      "data": {
        "entry": {
          "repo": "davidesantangelo/datoji",
          "private": true,
          "stargazers_count": 10
        }
      },
      "created_at": "2020-06-11T14:37:34.857Z",
      "updated_at": "2020-06-11T14:43:45.153Z"
    },
    "relationships": {
      "pack": {
        "data": {
          "id": "918f6a68-89f7-4f0c-aa6d-73b447d92819",
          "type": "pack"
        }
      }
    }
  }
}

Delete

To delete a specific record use HTTP DELETE, you will receive in case of success a 204 No Content code.

curl -X DELETE 'https://datoji.dev/packs/{PACK_ID}/entries/{ENTRY_ID}' -H 'Authorization: Token {KEY}'

Search

You can perform searches within the dataset.

Supporting:

  • unquoted text: text not inside quote marks will be converted to terms separated by & operators, as if processed by plainto_tsquery.

  • "quoted text": text inside quote marks will be converted to terms separated by <-> operators, as if processed by phraseto_tsquery.

  • OR: logical or will be converted to the | operator.

  • -: the logical not operator, converted to the the ! operator.

curl -X GET 'https://datoji.dev/packs/{PACK_ID}/search?q=datoji' -H 'Authorization: Token {KEY}'


{
  "data": [
    {
      "id": "b858bf82-1abf-4cb0-a9e0-2a59f1b7f30d",
      "type": "entry",
      "attributes": {
        "data": {
          "repo": "davidesantangelo/datoji",
          "private": true,
          "stargazers_count": 10
        }
        "created_at": "2020-06-11T14:37:08.293Z",
        "updated_at": "2020-06-11T14:37:08.293Z"
      },
      "relationships": {
        "pack": {
          "data": {
            "id": "918f6a68-89f7-4f0c-aa6d-73b447d92819",
            "type": "pack"
          }
        }
      }
    }
  ]
}

Limitations

  • Requests are rate-limited to 400 per 5 minutes per IP address.
  • There is no limit imposed on the number of entries or packs records, but please don't abuse it since it's a service i offer free of charge.

Built With

  • Ruby on Rails — Our back end API is a Rails app. It responds to requests RESTfully in JSON.
  • PostgreSQL — Our main data store is in Postgres.
  • Redis — We use Redis as a cache and for transient data.
  • FastJSONAPI — A lightning fast JSON:API serializer for Ruby Objects.
  • Textacular — Textacular exposes full text search capabilities from PostgreSQL.
  • Rack::Attack — Rack middleware for blocking & throttling abusive requests.
  • Pagy — The ultimate pagination ruby gem.

To Do

  • [x] Bulk Insert
  • [ ] GraphQL
  • [ ] Webhook

Buy me a coffee

If you want to support me in server costs, consider buying me a coffee! Thanks!

Spread The Voice

Tweet

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/davidesantangelo/datoji. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

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].