Code Monkey home page Code Monkey logo

google_sheets's Introduction

GoogleSheets

This repository was done to go along with this article.

Google API and Google Sheets API Example Integration

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.setup
  • Install Node.js dependencies with npm install inside the assets directory
  • Start Phoenix endpoint with mix phx.server
  • If you need to run in debug mode run iex -S mix phx.server

To run the app

  • Get your OAuth2.0 credentials for the Google Console (don't forget to activate Google Drive API and Google Sheets API in your project)
  • Env vars to declare: GOOGLE_CLIENT_ID={your_google_client_id} GOOGLE_CLIENT_SECRET={your_google_client_secret} GOOGLE_CONSENT_REDIRECT_URI={your_server_host}/api/consent GOOGLE_CLIENT_STATE={Generate a random secret to validate if the outside requests are coming from Google} DEFAULT_PERMISSION_EMAIL={The google email drive account where you want to receive the created spreadsheet}
  • After setting all the environment variables and sourcing them, call the function GoogleSheets.Requests.create_spreadsheet("YOUR_SPREADSHEET_NAME") (run server in debug mode) If you are prompted for a consent url, click on it and allow the permissions. You can change the permissions in the scope of auth.ex file. If you are prompted with a {:ok, SPREADSHEET_ID} go to the google drive of the DEFAULT_PERMISSION_EMAIL and you'll find the newly generated sheet there!

google_sheets's People

Contributors

dependabot[bot] avatar nbernardes avatar

Watchers

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