Skip to content

MdSadiqMd/GistDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

gistDB_logo AGPL-3.0 License API Version

A Rust-powered database that uses GitHub Gists as a storage layer. Simple, Reliable, and Secure.

๐Ÿ“Œ Features

  • GitHub Gists Integration: Leverage GitHub's infrastructure for document storage
  • Rust-Powered Backend: High-performance API server built with Cloudflare Workers
  • Collection Management: Organize documents into named collections
  • Search Capabilities: Document search within collections
  • Health Monitoring: Built-in system health checks and status reporting

โšก Getting Started

1. Production API URL

curl https://gist-db.mohammadsadiq4950.workers.dev/

2. Documentation

https://gist-db.mohammadsadiq4950.workers.dev/docs

๐Ÿ” Authentication

All protected endpoints require a GitHub Personal Access Token within gist scope:

curl -H "Authorization: Bearer YOUR_GITHUB_TOKEN" \
  https://gist-db.mohammadsadiq4950.workers.dev/api/databases

๐Ÿ“š API Reference

1. System Information

Get API Information

GET /

Health Check

GET /health

2. Documentation

Get OpenAPI Specification

GET /docs/openapi.yaml

Response:
Returns the OpenAPI specification in YAML format.

Interactive API Documentation

GET /docs

Response:
Returns the Swagger UI for interactive API exploration.


3. Database Operations

Create Database

POST /api/databases
Content-Type: application/json
Authorization: Bearer <token>

{
  "name": "my_database"
}

Response:

{
  "status": 201,
  "data": {
    "gist_id": "2b4d4b3e6a04a54d5a9d"
  },
  "message": "Database created successfully",
  "error": null
}

Delete Database

DELETE /api/databases
Content-Type: application/json
Authorization: Bearer <token>

{
  "gist_id": "2b4d4b3e6a04a54d5a9d"
}

Response:

{
  "status": 200,
  "data": null,
  "message": "Database deleted successfully",
  "error": null
}

4. Collection Operations

Create Collection

POST /api/collections
Content-Type: application/json
Authorization: Bearer <token>

{
  "gist_id": "2b4d4b3e6a04a54d5a9d",
  "name": "users"
}

Response:

{
  "status": 201,
  "data": {
    "collection_name": "users"
  },
  "message": "Collection created successfully",
  "error": null
}

Delete Collection

DELETE /api/collections
Content-Type: application/json
Authorization: Bearer <token>

{
  "gist_id": "2b4d4b3e6a04a54d5a9d",
  "collection_name": "users"
}

Response:

{
  "status": 200,
  "data": null,
  "message": "Collection deleted successfully",
  "error": null
}

5. Document Operations

Create Object

POST /api/objects
Content-Type: application/json
Authorization: Bearer <token>

{
  "gist_id": "2b4d4b3e6a04a54d5a9d",
  "collection_name": "users",
  "data": {
    "name": "Alice",
    "age": 28,
    "email": "[email protected]"
  }
}

Response:

{
  "status": 201,
  "data": {
    "object_id": "12345"
  },
  "message": "Object created successfully",
  "error": null
}

Update Object

PUT /api/objects
Content-Type: application/json
Authorization: Bearer <token>

{
  "gist_id": "2b4d4b3e6a04a54d5a9d",
  "collection_name": "users",
  "object_id": "12345",
  "data": {
    "age": 29
  }
}

Response:

{
  "status": 200,
  "data": {
    "object_id": "12345"
  },
  "message": "Object updated successfully",
  "error": null
}

Delete Object

DELETE /api/objects
Content-Type: application/json
Authorization: Bearer <token>

{
  "gist_id": "2b4d4b3e6a04a54d5a9d",
  "collection_name": "users",
  "object_id": "12345"
}

Response:

{
  "status": 200,
  "data": null,
  "message": "Object deleted successfully",
  "error": null
}

6. Search Operations

Search Objects

POST /api/search
Content-Type: application/json
Authorization: Bearer <token>

{
  "gist_id": "2b4d4b3e6a04a54d5a9d",
  "collection_name": "users",
  "query": "Alice",
  "field": "name"
}

Response:

{
  "status": 200,
  "data": [
    {
      "object_id": "12345",
      "data": {
        "name": "Alice",
        "age": 28,
        "email": "[email protected]"
      }
    }
  ],
  "message": "Search completed",
  "error": null
}

๐Ÿค Contributing

Contributions welcome! Please follow guidelines:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“œ License

This project is licensed under the GNU AGPLv3.

  • Any modifications or usage in a networked environment must be open-sourced.
  • If you wish to use this project commercially without open-sourcing modifications, please contact me for a commercialย license.

๐Ÿ“ฌ Contact

Creator and Maintainer: Md.Sadiq

About

A Serverless Database which uses Github Gists as it's storage engine, written in Rust and built on Cloudflare workers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages