Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oslabs-beta/polybase

A JavaScript library designed to simplify data integration and synchronization within polyglot environments.
https://github.com/oslabs-beta/polybase

database database-management influxdb javascript javascript-library mongodb neo4j nodejs postgresql react redis

Last synced: about 2 months ago
JSON representation

A JavaScript library designed to simplify data integration and synchronization within polyglot environments.

Awesome Lists containing this project

README

        

![polybase-logo](https://github.com/user-attachments/assets/041ba430-00bc-41bf-8159-dcd3d02a877a)

## About

[![License](https://img.shields.io/badge/License-MIT-008CBA)](#)
[![Release](https://img.shields.io/badge/Release-v1.0.3-00A676)](#)
[![Contributions](https://img.shields.io/badge/Contributions-Welcome-FFD700)](#)
[![Polybase Landing Page](https://img.shields.io/badge/Website-polybase.dev-0056D2)](https://www.polybase.dev)

Polybase is a robust Node.js library designed for seamless integration and synchronization across SQL, NoSQL, graph, and time-series databases. With a built-in CLI, developers can easily manage configurations, query databases, and handle cross-database operations efficiently.


## Technologies

### Core Backend
![Node.js](https://img.shields.io/badge/Node.js-339933?logo=node.js&logoColor=white)
![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?logo=javascript&logoColor=black)
![MongoDB](https://img.shields.io/badge/MongoDB-47A248?logo=mongodb&logoColor=white)
![PostgreSQL](https://img.shields.io/badge/PostgreSQL-336791?logo=postgresql&logoColor=white)
![Redis](https://img.shields.io/badge/Redis-DC382D?logo=redis&logoColor=white)
![Neo4j](https://img.shields.io/badge/Neo4j-008CC1?logo=neo4j&logoColor=white)
![InfluxDB](https://img.shields.io/badge/InfluxDB-22ADF6?logo=influxdb&logoColor=white)

### Frontend and Presentation
![React](https://img.shields.io/badge/React-61DAFB?logo=react&logoColor=black)
![Next.js](https://img.shields.io/badge/Next.js-000000?logo=next.js&logoColor=white)
![React Router](https://img.shields.io/badge/React_Router-CA4245?logo=react-router&logoColor=white)
![Vite](https://img.shields.io/badge/Vite-646CFF?logo=vite&logoColor=white)
![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-06B6D4?logo=tailwind-css&logoColor=white)
![HTML](https://img.shields.io/badge/HTML-E34F26?logo=html5&logoColor=white)
![CSS](https://img.shields.io/badge/CSS-1572B6?logo=css3&logoColor=white)

### Build and Deployment Tools
![Jenkins](https://img.shields.io/badge/Jenkins-D24939?logo=jenkins&logoColor=white)
![Rollup](https://img.shields.io/badge/Rollup-EC4A3F?logo=rollup.js&logoColor=white)
![Webpack](https://img.shields.io/badge/Webpack-8DD6F9?logo=webpack&logoColor=black)
![Babel](https://img.shields.io/badge/Babel-F9DC3E?logo=babel&logoColor=black)
![NPM](https://img.shields.io/badge/NPM-CB3837?logo=npm&logoColor=white)


## Features

• Multi-Database Support: Handles MongoDB, PostgreSQL, Redis, Neo4j, and InfluxDB with a unified interface.

• Powerful CLI: Supports 10+ commands (e.g., status, retry, clear) for streamlined debugging and database management.

• State Management: Tracks connections and configurations for local and remote databases.

• Circular Dependency Handling: Ensures scalability and maintainability.

• Robust Rollback Mechanism: Guarantees 100% rollback success for critical commands.

• Seamless Configuration Loading: Reads JSON and .env files for environment-based setups.


## Installation and Usage

Installation

To install Polybase via npm, run:

```
npm install polybase-package
```

Usage

Step 1: Import Polybase into Your Project

```
const Polybase = require('polybase-package');
```

Step 2: Run the following command to start the Polybase CLI:

```
node userRun.js
```

Once initialized, Polybase provides a command-line interface for managing database configurations and connections. It also performs the following configuration file checks in the current working directory:

Polybase-Config.json:
If not found, the CLI creates a template JSON file with placeholders for supported databases.

```
{
"mongo": {
"url": "url",
"database": "your-database-name"
},
"postgres": {
"host": "localhost",
"port": port,
"user": "your-username",
"password": "your-password",
"database": "your-database-name"
},
"redis": {
"host": "localhost",
"port": port
},
"neo4j": {
"url": "url",
"username": "your-username",
"password": "your-password"
},
"influx": {
"url": "url",
"token": "your-token",
"bucket": "your-bucket",
"org": "your-org"
}
}
```

.env File:
If not found, the CLI generates a template .env file with key-value placeholders for environment-based configurations to be used in your own Polybase-Config.js file, which you can export via module.exports.

```
# MongoDB Configuration
MONGO_URI=
MONGO_DATABASE=

# PostgreSQL Configuration
POSTGRES_USER=
POSTGRES_HOST=
POSTGRES_DATABASE=
POSTGRES_PASSWORD=
POSTGRES_PORT=

# Redis Configuration
REDIS_HOST=
REDIS_PORT=
REDIS_USERNAME=
REDIS_PASSWORD=

# InfluxDB Configuration
INFLUX_URL=
INFLUX_TOKEN=
INFLUX_ORG=
INFLUX_BUCKET=

# Neo4j Configuration
NEO4J_URI=
NEO4J_USERNAME=
NEO4J_PASSWORD=
```

```
module.exports = {
mongoUri: process.env.MONGO_URI || 'your-default-mongo-uri',
postgresUser: process.env.POSTGRES_USER || 'your-default-postgres-user',
redisHost: process.env.REDIS_HOST || 'localhost',
influxToken: process.env.INFLUX_TOKEN || 'your-default-influx-token',
neo4jUri: process.env.NEO4J_URI || 'your-default-neo4j-uri'
};
```

Ready for Commands

Once configurations are provided, the CLI is fully operational, allowing users to run commands like status, retry, configs, and more.

• status: View the connection status of all configured databases.

• retry: Retry failed database connections.

• clear: Clears the terminal and resets CLI state.

• configs: Displays the current database configurations.

• help: Lists all available commands and potential query executions.

In this version 1.0.3 launch, the package functions to set up and check database configurations. We are actively working on additional functionality to allow developers to query databases and handle cross-database operations (see 'help' command). More commands coming soon!


Supported Databases

• MongoDB: Document-based NoSQL database.

• PostgreSQL: Relational SQL database.

• Redis: Key-value store for caching and real-time operations.

• Neo4j: Graph database for relationship-based data models.

• InfluxDB: Time-series database for metrics and monitoring.


## The Team


Alazar Aklilu
Software Engineer


GitHub Badge




LinkedIn Badge




Nathan Patterson
Software Engineer


GitHub Badge




LinkedIn Badge




Gavin Shadinger
Software Engineer


GitHub Badge




LinkedIn Badge



## Contributing

We welcome contributions! To get started:

1. Clone the repository:

```
git clone https://github.com/oslabs-beta/Polybase.git
```

2. Create a new branch for your work:

```
git checkout -b feature-name
```

3. Decide where to contribute:

• Contribute to the Polybase-Package

• Contribute to the Polybase-Platform (Website)

4. Commit your changes:

```
git commit -m 'Add feature'
```

Push your branch:

```
git push origin feature-name
```

5. Submit a pull request to one of the following branches, depending on your work:

• main (requires review)

• dev (requires review)

Note: Please do not push or merge any changes into the following branches:

• alazar

• nathan

• gavin


## Acknowledgments

Polybase was developed with a focus on simplifying multi-database operations and enhancing developer productivity. This project was built through OSLabs, a nonprofit tech accelerator dedicated to advancing open-source software and fostering innovation within the tech community.


## License

Polybase is licensed under the MIT License. See LICENSE for details.