Code Monkey home page Code Monkey logo

dataconnector's Introduction

Data Connector

Data Connector is a Google Sheets Add-on that lets you import (and export) data to/from Google Sheets. Our roadmap:

  1. Connect to JSON/XML/CSV APIs
  2. Import data from any website, including those with JavaScript via a headless browser
  3. JMESPath/XPath/JSONPath/Pup/JQ and other filters
  4. Connect to PostgreSQL, MySQL, and other databases
  5. Run your commands in Google Sheets/Excel/Slack/Airtable

Q: Why create this when there's like a bazillion Add-ons that do the same thing?

A: Privacy! Add-ons in Google Sheets have a lot of power to read your Sheet. Further, connecting to various APIs and databases means we may need to store your API Keys and other information securely (unless, of course, you parameterize your queries). We want to be transparent about our methods and are always open to suggestions on how to improve the code. While other Add-ons might claim to be privacy-centric, you can never be assured until you see the code. Further, no other Add-on fulfilled our wishlist above.

More about how we stack up to our competitors can be found on our website

๐Ÿƒ How do I run this?

The easiest way to run the Data Connector Add-on is to install it from the Google Workspace Marketplace: https://workspace.google.com/marketplace/app/appname/529655450076

๐Ÿ”จ If, instead, you want to run your own version you will need to setup both the backend API and the Google Sheets parts.

  • Clone this repo:

    git clone https://github.com/brentadamson/dataconnector.git

Backend

  • Set your environment variables:

    IMPORTANT: The JWT_SECRET MUST be the same as the JWT_SECRET environment variable set below in the Google Sheets section.

    export DATACONNECTOR_POSTGRESQL_USER=user
    export DATACONNECTOR_POSTGRESQL_PASSWORD=mypassword
    export DATACONNECTOR_POSTGRESQL_HOST=localhost
    export DATACONNECTOR_POSTGRESQL_DATABASE=mydatabase
    export DATACONNECTOR_POSTGRESQL_PORT=5432
    export DATACONNECTOR_JWT_SECRET=secret
    
  • cd backend/backend/cmd

  • go run .

    Your backend service will be listening at http://127.0.0.1:8000 by default

Google Sheets

  • From the main dataconnector directory:

    cd googlesheets

    npm install

  • Login to clasp, which lets you manage Apps scripts from the commandline:

    npm run login

  • Setup a new Sheet and script by running:

    npm run setup

    If you already have an existing Sheet and script:

    npm run setup:use-id <script_id>

  • In your new Sheets script, create a new file called env.gs and paste the following code:

    function updateEnvVariables(){
      PropertiesService.getScriptProperties().setProperty('DOMAIN', 'https://api.example.com');
      PropertiesService.getScriptProperties().setProperty('JWT_SECRET', 'secret');
    }
    

    Update the DOMAIN and JWT_SECRET, select the updateEnvVariables in the functions dropdown list and hit the play button.

    IMPORTANT: The JWT_SECRET MUST be the same as the JWT_SECRET environment variable set above in the Backend section.

    Once that's complete, you can delete the env.gs file

  • To make changes to the Add-on, enable hot reloading:

    mkcert -install

    npm run setup:https

    npm run start

    Make some changes in the code and see the changes instantly in the Add-on.

    Note: changes to Code.js will require a restart.

  • To deploy:

    npm run deploy

To contribute

Before you do anything, please open up an issue or assign yourself an existing one. This helps coordinate things.

dataconnector's People

Contributors

brentadamson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.