/BunDL

Primary LanguageJavaScriptMIT LicenseMIT


AppVeyor contributions welcome LicenseMIT

bunDL

bundl logo is an intuitive, skinny GraphQL interceptor, that checks for cached data, handles mutations with PouchDB, and only sends modified or non-cached queries to the server. The returned data is then cached for future requests.

Bun JavaScript Redis GraphQL MongoDB pouchDB

CouchDB IBM Cloudant React Prettier ESLint

Installation

Install bunDL-server

bun install bundl-server

Install bunDL-cache

bun install bundl-cache

Features:

🗂️ Caching with Redis Stack (Server) & LRU Cache (Client)

retrieves data from the local cache with lightning speed

🥟 In-Memory Storage: Fast access to frequently used data.

🥟 Disk-Based Storage: Suitable for larger datasets that don't fit into memory.

🥟 Time-to-Live (TTL): Automatic eviction of old data based on time or size constraints.


🗄️ Database Integration

seamlessly integrates with both relational and document based databases.

🥟 SQL Support: Easily connect to MySQL, PostgreSQL, and SQLite databases.

🥟 NoSQL Support: Options for integrating with MongoDB, Redis, and other NoSQL databases.

🥟 Syncing with PouchDB and CouchDB to provide offline access to data


🔎 Query Optimization

ensures

🥟 Lazy Loading: Fetch only the data that is needed, reducing initial load times.

🥟 Batch Processing: Perform bulk operations for improved efficiency.

🥟 Indexing: Speed up data retrieval operations with intelligent indexing.


🎁 Plus More!

🥟 RESTful API: Easy integration with other services.

🥟 Data Validation: Robust validation mechanisms to ensure data integrity.

🥟 Real-Time Analytics: Keep track of various metrics in real-time.



Server Side Implementation:

makes use of Redis Stack for caching data as JSON objects; Redis Stack needs to be installed independently. Installation instructions can be found on the Redis website here.

1️⃣ Install Bun runtime

npm install -g bun

2️⃣ Install :

bun install bundl-server

3️⃣ Define your schema shape

For Unix / Linux / macOS:

Open a terminal command line in the root directory folder that houses your server file.

Run the following commands:

touch .env  # will create a new `.env` file if one doesn't exist
echo "QUERY=\"[enter your query here]\"" >> .env

For example, if your GraphQL schema looks like this:

query samplePokeAPIquery {
  pokemon_v2_pokemon_by_pk(id: ) {
    name
    id
    height
    base_experience
    weight
    pokemon_v2_pokemonsprites {
      id
      pokemon_id
      sprites
    }
  }
}

Your QUERY="[...]" input will look like this:

touch .env  // This will create a new `.env` file if one doesn't exist
echo "QUERY=\"{ pokemon_v2_pokemon_by_pk(id: ) { name id height base_experience weight pokemon_v2_pokemonsprites { id pokemon_id sprites } } }\"" >> .env

Client Side Documentation:

works best with GraphQL, LRU Cache, PouchDB, and CouchDB style database.

For information on the client side implementation, please visit the bunDL Client README

Contributing

We believe in the power of open source. By contributing to bunDL, you're not just making an impact on this project but also supporting the wider open source community. Our mission with bunDL is to create an accessible tool, and every contribution, big or small, pushes this vision forward.

This project, bunDL, is an open source endeavor. If you're looking to understand our project's journey and how to contribute, visit our Demo Repository


BunDL Contributors

Accelerated by OS Labs and devloped by Ken Iwane, Shi Kuang, Brandon Do, Gio Mogi, & Andrew Wicker.