Coder Social home page Coder Social logo

resir014 / nodecg-react-typescript-tailwind-quickstart Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 123 KB

Get started creating NodeCG bundles with React + TypeScript + TailwindCSS in seconds.

License: The Unlicense

JavaScript 52.92% TypeScript 37.95% CSS 1.39% HTML 7.74%
nodecg nodecg-bundle react starter-kit tailwindcss typescript

nodecg-react-typescript-tailwind-quickstart's Introduction

nodecg-react-typescript-tailwind-quickstart

Get started creating NodeCG bundles with React + TypeScript + TailwindCSS in seconds.

Getting started

Prerequisites

You will need:

Install NodeCG

Follow this guide to install and run NodeCG locally.

In summary:

# Install nodecg + dependencies
npm install --global nodecg-cli
mkdir nodecg
cd nodecg
nodecg setup

Setup the bundle

On your root NodeCG bundle, install the bundle via the NodeCG CLI

cd bundles
git clone https://github.com/resir014/nodecg-react-typescript-tailwind-quickstart.git my-bundle-name
cd my-bundle-name
yarn

Then, update the bundle's package.json to match the new bundle name.

{
  "name": "my-bundle-name"
}

Start developing

On one terminal window, run a local server for development.

yarn watch

On another terminal window, navigate to the NodeCG root folder, and start the server.

# Run nodecg locally
nodecg start

Creating bundle files

The Webpack config is set up so you can easily create multiple dashboard/graphics files and will be bundled separately.

As long as you follow these naming conventions, all files are automatically generated in the main dashboard/graphics folders.

my-bundle/
├─ package.json
├─ webpack.config.js
└─ src/
   ├─ dashboard/
   │  ├─ [name].dashboard.html
   │  ├─ [name].dashboard.tsx
   │  └─ [name].dashboard.css
   └─ graphics/
      ├─ [name].graphics.html
      ├─ [name].graphics.tsx
      └─ [name].graphics.css

Then, you can manually add these into your bundle config on the package.json file.

{
  "nodecg": {
    "dashboardPanels": [
      {
        "name": "index",
        "title": "Index",
        "width": 6,
        "file": "index.html",
        "headerColor": "#68717b"
      },
      {
        "name": "second",
        "title": "Second Panel",
        "width": 4,
        "file": "second.html",
        "headerColor": "#0070f3"
      }
    ],
    "graphics": [
      {
        "file": "index.html",
        "width": 1920,
        "height": 1080
      },
      {
        "file": "other-graphic.html",
        "width": 1920,
        "height": 1080
      }
    ]
  }
}

nodecg-react-typescript-tailwind-quickstart's People

Contributors

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