Giter VIP home page Giter VIP logo

restappcards's Introduction

Miro REST Stickies with Tags

This sample app demonstrates the use of the Miro REST API's Sticky Note and Tags endpoints to import external structured data (.csv) into Miro. It makes use of each of the available CRUD (create, read, update, delete) methods to add and manage stickies with tags on a Miro board.

Miro capabilities covered in this sample app:

  1. Miro Sticky Note items
  2. Miro Tag items
  3. CSV data —> Stickies with tags

Prerequisites:

  1. Create an app in Miro
  2. Create a board in Miro that you'd like to import / create stickies to
  3. Localtunnel to host localhost online (see installation section below)

Dependencies:

How to start

  1. Clone or download repo
  2. cd to root folder
  3. Run npm install to install dependencies.
  4. Create a .env file in the root folder, and set the following variables:
clientID={YOUR_CLIENT_ID)
clientSecret={YOUR_CLIENT_SECRET}
redirectURL={YOUR_REDIRECT_URL}
boardId={MIRO_BOARD_ID}
  1. cd to authorization folder
  2. Run npm install in the authorization folder to install dependencies
  3. Create a .env file in the authorization folder, and set the following variables:
clientID={YOUR_CLIENT_ID)
clientSecret={YOUR_CLIENT_SECRET}
redirectURL={YOUR_REDIRECT_URL}
boardId={MIRO_BOARD_ID}

Set up localtunnel for https environment / authorization

In this example, we will host our local environment over HTTPS using Localtunnel. (You can use other services such as ngrok as well.)

  1. Install localtunnel (or your preferred service) by running npx localtunnel --port 8000 -s reststickiestunnel (include a custom subdomain to ensure your lt url persists) to generate your HTTPS URL for localhost
  2. Copy this HTTPS URL and paste it in the Redirect URI for OAuth2.0 box in your Miro app settings
  3. Paste this same HTTPS URL into your .env redirectURL variable (above)
  4. From your desired Miro board, grab the board ID from the URL and paste it into your .env boardId variable (above)
  5. From your Miro app settings, grab the Client ID and Client Secret. Paste this into your .env clientId and clientSecret variables (above)

How to run the project

  1. From the root folder of the project, cd to the authorization folder
  2. Run npm run start to start the server for the authorization flow on Port 3000
  3. cd back to the root folder of the project
  4. Run npm run start to start the server for the Handlebars app
  5. Your express server console should reflect "The web server has started on port 8000" (or the port of your choice) (Make sure you leave both of these servers running)

Folder structure

.
├── package.json <-- The dependencies for the main app.js
└── app.js <-- The main Node.js script to run the Express server and render our Handlebars app
└── .env <-- File where you are storing your sensitive credentials
└── node_modules <-- Node modules that are installed based on dependencies
└── authorization
      └── auth.js
      └── package.json <-- The dependencies for auth.js
└── views
      └── authorizeApp.hbs <-- Handebars file to render authorization success page
      └── createCard.hbs <-- Handlebars file to render sticky creation page
      └── deleteCard.hbs <-- Handlebars file to render sticky deletion page
      └── updateCard.hbs <-- Handlebars file to render sticky update page
      └── uploadCSV.hbs <-- Handlebars file to render CSV upload page
      └── viewCard.hbs <-- Handebars file to render sticky list page
      └── home.hbs <-- main Handlebars file to render universal/root rendering
      └── layouts
            └── main.hbs <-- the Handlebars 'app' itself

About the app

This is a backend app built on Node.js and Express.js, with Handlebars.js for rendering. We've used localtunnel for hosting our localhost port over HTTPS. Localtunnel exposes your local environment online so that you can more easily test. Per localtunnel, it's "Great for working with browser testing tools like browserling or external api callback services...which require a public url for callbacks."

restappcards's People

Contributors

bishopwm avatar

Watchers

James Cloos avatar  avatar

Forkers

joannasmith

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.