Coder Social home page Coder Social logo

mongo-airtable's Introduction

Mongo Airtable

A note

As of February 2020, this is under active development. You may wish to wait a bit before using it.

If you make conflicting changes, one will overwrite the other. Use this tool at your own risk!

Motivation

Airtable is great database/spreadsheet hybrid for holding your data. The problem is that sometimes you don't have internet access, so pulling and saving data using their API isn't feasible. This tool allows you to get and set your data to a MongoDB database, whether or not you have internet access, and then sync whenever is convenient. That way, Airtable is still your ultimate source of truth, but your app's proxy source of truth is MongoDB.

Getting started

Install MongoDB using brew install mongodb or similar.

Let's say you wanted your mongodb database to be called "main" and your collection (which maps to a table in Airtable) to be called "songs". The Airtable view is called "Main View".

Clone this repo, and then create a file called ~/.mongo-airtable.yaml. Make it look like the following.

auth:
  airtable: <your airtable api key (starts with 'key')>
sync:
  - base_name: <your airtable base key (starts with 'app')>
    primary: <your airtable table name (e.g. 'Songs')>
    view: <your airtable view name (e.g. 'Main View')>
    database: <a mongo db name (e.g. 'main')>
    collection: <a mongo db collection name (e.g. 'songs')>
  - base_name: <your airtable base key (starts with 'app')>
    primary: <another airtable table name (e.g. 'Artists')>
    view: <your airtable view name (e.g. 'Main View')>
    database: <another mongo db name (e.g. 'main')>
    collection: <another mongo db collection name (e.g. 'songs')>

Run npm install (or yarn install). Now you're mostly ready to go.

Run the tests by doing npm test. This is important, as it acts as diagnostics for your local setup.

When you want to pull from airtable down to your mongodb collection, run:

npm run pull

When you want to push any changes to your airtables, run:

npm run push

For right now (this will be fixed soon), after doing a push, you should afterward do a pull:

npm run pull

TODO:

  • make this tool use the "modified date" on airtable records
  • make this tool use the "modified date" of mongo records
  • configuration via airtable
  • progress bars
  • confirmation dialogues for conflicts
  • 100% test coverage after the above are complete

mongo-airtable's People

Contributors

phildeschaine0 avatar arro 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.