Giter VIP home page Giter VIP logo

react_qr_app's Introduction

Getting Started with the LaunchDarkly React QR Demo

This project was bootstrapped with Create React App.

Usage

Want to use GitHub Pages to publish your own copy of this? You've come to the right place!

Duplicating the repository and creating a GitHub Page

  1. Fork this repository
  2. Clone the new repository to your local machine, cloud editor, or whatever
  3. Run npm install in your local root directory of the project
    1. NOTE: Due to an outstanding issue with Webpack and version 17+ of Node, you must use Node version 16.X or below.
    2. NOTE: If you receive dependency errors, you can add the --legacy-peer-deps flag
  4. In your GitHub repository, go to Settings > Pages and create a GitHub Page. Copy the URL of your GitHub Page, for use in the next section.

Modifying variables for your own usage

  1. In src/components/qrCode.js, modify QRURL to be your github pages URL
  2. In package.json, modify the "homepage" to point to your github pages URL
  3. In src/index.js, modify CLIENTKEY to be your own LaunchDarkly client-side SDK key

Flags used by the app

  • config-background-color: A string flag with gray, purple, blue, and red as string variations.
  • config-customer-logo: A string flag with variations containing URLs of images.
  • show-qr-code: boolean
  • release-new-ui: A boolean placeholder flag which you can use as a prerequisite for other flags
  • release-header-logo: boolean
  • release-astronaut: boolean
  • show-customer-logo: boolean
  • release-heart: boolean

Creating LaunchDarkly flags

The project React QR Demo exists on the LD Production account with all the necessary flags. You can add a new environment for yourself.

If you want to create a new project with all the right flags, then you can either use the LaunchDarkly Terraform integration to set all the flags up in one go (see below), or do it manually using the list above.

Creating flags with Terraform

  1. Ensure that you have:
    1. An empty LaunchDarkly project, ready for some funky fresh flags
    2. An API access token with Writer permissions. Go to the Authorizations page to create it.
    3. Terraform installed
  2. See the terraform.tfvars.example file in the root directory? Rename it to terraform.tfvars.
  3. Then edit the terraform.tfvars file, replacing the access_token and project_key values.
  4. Run: terraform init to initialize the configuration
  5. Run: terraform plan
  6. If that ran with no errors, then run: terraform apply
  7. Go enjoy your lovely new flags!

Testing

  1. To test that it's working locally, run npm start in the root directory of your project
  2. On your LaunchDarkly dashboard, try turning the show-qr-code flag on and off, and serve different colors in the config-background-color flag

Deploying

  1. When you're ready, npm run deploy to deploy to a new gh-pages branch of your repository
  2. On your GitHub repository, go to Settings > Pages and ensure you're using the gh-pages branch in the root directory

react_qr_app's People

Contributors

ttotenberg-ld avatar yozlet avatar kevincloud avatar nfinnegan avatar bradbunce-ld avatar cgreenld avatar kwatkins-ld avatar roderick-clemente avatar

Forkers

bharwani

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.