Git Product home page Git Product logo

rapid-gas's Introduction

Rapid development framework for Google Apps Scripts (rapid-gas)

Google Apps Scripts (GAS) is a powerful platform where Google products and third party services can be integrated and automated to create a products. GAS combined with Google Spreadsheets can be used to rapidly build applications/products in a blazingly shorter time. The idea is that;

  • Use Google spreadsheets as the data storing and administration platform
  • Each spreadsheet (multiple sheets) will act as a business module providing users data manipulation functioanlity
  • Spreadsheets can have own REST API making them act as micro services
  • External systems such as mobile, web front ends can be built on top of the REST APIs

Rapid-gas project provide necessary framework functions to rapidly develop these microservices and allows easy integrations inbetween. Also it introduces conventions that can make the spreadsheets to look more like datatables with business schemas.

How to use Rapid-gas

Rapid-gas is available as a GAS library. If you want your spreadsheet to be available as a REST API follow following steps. Create the spreadsheet and add the column names to the header row as below: alt tag

Now go to Tools->Script Editor and paste below code

var config = {
  entities: {
    students: {
      spreadsheetId: "spreadsheet_id",
      sheetName: "sheet_name",
      endpoint: "webapp_url",
      columns: ["Name", "Age", "Birthday", "Address"]
    }
  }
};

RapidGas.initializeByJson(config);

function doGet(request) {
  var response = RapidGas.REST.getResponse(request, "students");
  return ContentService.createTextOutput(response);
}

Replace "spreadsheet_id" with https://docs.google.com/spreadsheets/d/spreadsheet_id/edit you find on the URL
"sheet_name" is the name of the sheet you want to expose as a web api
Update the "columns" array to suit your column names in the spreadsheet
Now "publish -> deploy as webapp" and deploy a new version of this service to obtain the "webapp_url" and update the same

Go to "Resources -> Libraries" to refer to RapidGas library by the project key "M4fJ-YgsEJvPfAud5g00eJ3mq3AJFwtDu" and add the latest version.

Now if you go to the "webapp_url" of your published service, you should get the Json results of your spreadsheet data.

If you want to query data, follow a similar syntax as below: https://script.google.com/macros/s/spreadsheet_id/exec?$filter=Name eq 'Jehan'

Limitations

Currently only filtering on GET requests is implemented. Filtering is only possible on one field as of now.

rapid-gas's People

Contributors

hasith avatar harshanas avatar lakindu95 avatar ectechno avatar

Watchers

Ashan Fernando avatar James Cloos avatar  avatar Manoj Fernando avatar  avatar Sachith Perera avatar  avatar

rapid-gas's Issues

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.