Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit bdafa27

Browse files
authored
Merge pull request #76 from Tim-Tech-Dev/maintenance/improve-sample-docs
Improve getting started section
2 parents f3d2783 + a7ae69f commit bdafa27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1168
-859
lines changed

docs/assets/log_in_screen.png

35.2 KB
Loading

docs/assets/nodcg-io-colored.png

120 KB
Loading

docs/assets/nodcg-io-dashboard.png

42.7 KB
Loading

docs/assets/run_from_vscode.png

23.8 KB
Loading

docs/getting_started/install.md

Lines changed: 129 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,57 @@
22

33
## Prerequisites
44

5-
In order to download necessary tools and to install nodecg-io using the CLI you need network access.
5+
In order to download necessary tools and to install nodecg-io using the CLI you
6+
need network access.
67

78
### Required Applications
89

910
You'll need the following tools:
1011

1112
- [Git](https://git-scm.com)
12-
- [Node.JS](https://nodejs.org/en/) v12.0.0 or newer
13-
- [Npm](https://www.npmjs.com/get-npm) 7.0.0 or newer
13+
- [Node.js](https://nodejs.org/en/) v12.0.0 or newer
14+
- [npm](https://www.npmjs.com/get-npm) 7.0.0 or newer
1415
- [NodeCG](https://nodecg.dev/) 1.4.0 or newer (1.7.0 or higher recommended)
1516

1617
### Native Build Tools
1718

18-
Some services depend on packages that require native build tools. You _ONLY_ need to install these if you want to use a service that depends on native modules or if you want to install a development version.
19+
Some services depend on packages that require native build tools. You _ONLY_
20+
need to install these if you want to use a service that depends on native
21+
modules or if you want to install a development version.
1922

20-
The services that require these include StreamDeck, Midi and Serial. Please note that this list might not be up-to-date.
23+
The services that require these include StreamDeck, Midi and Serial. Please note
24+
that this list might not be up-to-date.
2125

22-
Here's how to install the native build tools on the most popular operating systems, if you need them:
26+
Here's how to install the native build tools on the most popular operating
27+
systems, if you need them:
2328

2429
#### Windows
2530

26-
For Windows, you'll need the Visual Studio Build Tools, if you have Visual Studio installed you should already have them.
27-
If you don't have Visual Studio just install the Visual Studio Build Tools by running the following command as an **Administrator**:
31+
For Windows, you'll need the Visual Studio Build Tools, if you have Visual
32+
Studio installed you should already have them. If you don't have Visual Studio
33+
just install the Visual Studio Build Tools by running the following command as
34+
an **Administrator**:
2835

2936
```shell
3037
npm install -g windows-build-tools
3138
```
3239

3340
#### Linux
3441

35-
For Linux, you'll need a C++ compiler and some other packages. On Ubuntu/Debian based operating systems run the following command:
42+
For Linux, you'll need a C++ compiler and some other packages. On Ubuntu/Debian
43+
based operating systems run the following command:
3644

3745
```shell
3846
sudo apt install build-essential libusb-1.0-0-dev libasound2-dev libudev-dev
3947
```
4048

41-
For other Linux distros you'll need the corresponding packages, just search on the internet how the packages are named for your specific distro.
49+
For other Linux distros you'll need the corresponding packages, just search on
50+
the internet how the packages are named for your specific distro.
4251

4352
#### macOS
4453

45-
For macOS, you'll need the Xcode command line tools. To install them run the following command:
54+
For macOS, you'll need the Xcode command line tools. To install them run the
55+
following command:
4656

4757
```shell
4858
xcode-select --install
@@ -56,33 +66,119 @@ Install the nodecg-io CLI using the following command:
5666
npm install -g nodecg-io-cli
5767
```
5868

59-
_Note:_ If you are running on Linux, you may need to use `sudo` if your npm installation uses a non-writeable path (default on Ubuntu apt packages, usually does not apply to packages installed using [nvm](https://github.com/nvm-sh/nvm))
69+
_Note:_ If you are running on Linux, you may need to use `sudo` if your npm
70+
installation uses a non-writeable path (default on Ubuntu apt packages, usually
71+
does not apply to packages installed using [nvm](https://github.com/nvm-sh/nvm))
6072

6173
## Install nodecg-io using the nodecg-io CLI
6274

63-
With the nodecg-io CLI installed you can run this command inside a nodecg installation to install nodecg-io:
75+
> nodecg-io will always be installed into a `nodecg-io/` directory inside your
76+
> NodeCG installation so that your bundles and all bundles from nodecg-io are
77+
> separated. The CLI will add this path to the loaded bundles in your NodeCG
78+
> configuration automatically, you don't need to worry about it.
79+
80+
With the nodecg-io CLI installed you can run this command inside a NodeCG
81+
installation to install nodecg-io:
6482

6583
```shell
66-
nodecg-io install
84+
$ nodecg-io install
85+
Installing nodecg-io...
6786
```
6887

69-
You will get a prompt which asks you which version you want to install.
70-
71-
- By selecting an actual version (e.g., `0.1`) you create a production install that downloads the required packages from npm and setups a npm workspace to install all dependencies. Here you can choose which services you want to install.
72-
73-
- By selecting `development` you create a development install that clones the nodecg-io git repo and builds everything from scratch. We only recommend a dev install if you are sure that you want to contribute to nodecg-io. Here you always must install all services.
74-
75-
For starters, we recommend using the latest non-development version.
76-
77-
nodecg-io will always be installed into a `nodecg-io/` directory inside your nodecg installation so that your bundles and all bundles from nodecg-io are separated. The CLI will add this path to the loaded bundles in your nodecg configuration automatically, you don't need to worry about it.
78-
79-
If you want to every change your nodecg-io installation to add/remove a service or change the version, you can always re-run `nodecg-io install`. If a nodecg-io installation is found, its options will be preselected in the prompt. Re-running `nodecg-io install` will also update all packages to the latest patch version, if you have a production installation, and pull the repository and rebuild, if you have a development installation.
80-
81-
## Start nodecg
82-
83-
When starting nodecg you should see that all nodecg-io related bundles should be loaded and that you can now access nodecg-io in your nodecg dashboard.
84-
85-
Now you can either install an already existing bundle that uses nodecg-io, [create a new bundle](./create_new_bundle.md) or [integrate an existing bundle](./existing_bundle.md).
88+
You will get a prompt which asks you which version you want to install:
89+
90+
<pre><b><span style="color:#1cdc9a">user@computer</span>:<span style="color:#3daee9">~/nodecg</span></b>$ nodecg-io install
91+
Installing nodecg-io...
92+
Detected nodecg installation at /home/user/nodecg.
93+
<span style="color:#11d116">?</span> <b>Which version do you want to install?</b> (Use arrow keys)
94+
development
95+
<span style="color:#1abc9c">❯ 0.1</span></pre>
96+
97+
There are two possible installation types:
98+
99+
- By selecting an actual version (e.g., `0.1`) you create a production install
100+
that downloads the required packages from npm and setups a npm workspace to
101+
install all dependencies. Here you can choose which services you want to
102+
install. Here you can not easily install our premade examples.
103+
104+
- By selecting `development` you create a development install that clones the
105+
nodecg-io git repo and builds everything from scratch. We only recommend a
106+
development install if you are sure that you want to contribute to nodecg-io
107+
or want to try an included example. Here you always must install all
108+
services and examples.
109+
110+
For starters, we recommend using the development version, so you may try our
111+
premade examples.
112+
113+
### Production install
114+
115+
<details>
116+
<summary>Click to see more!</summary>
117+
118+
Because you selected a production install you may select the services to be
119+
included in this next step:
120+
121+
<pre><b><span style="color:#1cdc9a">user@computer</span>:<span style="color:#3daee9">~/nodecg</span></b>$ nodecg-io install
122+
Installing nodecg-io...
123+
Detected nodecg installation at /home/user/nodecg.
124+
<span style="color:#11d116">?</span> <b>Which version do you want to install?</b> <span style="color:#1abc9c">0.1</span>
125+
<span style="color:#11d116">?</span> <b>Which services do you want to use?</b> (Press <span style="color:#16a085">&lt;space&gt;</span> to select, <span style="color:#16a085">&lt;a&gt;</span> to toggle all,
126+
<span style="color:#16a085">&lt;i&gt;</span> to invert selection, and <span style="color:#16a085">&lt;enter&gt;</span> to proceed)
127+
<span style="color:#1abc9c">❯◯ ahk</span>
128+
◯ android
129+
◯ curseforge
130+
◯ discord
131+
◯ intellij
132+
◯ irc
133+
◯ midi-input
134+
(Move up and down to reveal more choices)</pre>
135+
136+
If you want to every change your nodecg-io installation to add/remove a service
137+
or change the version, you can always re-run `nodecg-io install`. If a nodecg-io
138+
installation is found, its options will be preselected in the prompt. Re-running
139+
`nodecg-io install` will also update all packages to the latest patch version.
140+
141+
</details>
142+
143+
### Development install
144+
145+
<details>
146+
<summary>Click to see more!</summary>
147+
148+
Because you selected a production install you may select to use the samples and
149+
documentation to be included in these next steps:
150+
151+
<pre><b><span style="color:#1cdc9a">user@computer</span>:<span style="color:#3daee9">~/nodecg</span></b>$ nodecg-io install
152+
Installing nodecg-io...
153+
Detected nodecg installation at /home/user/nodecg.
154+
<span style="color:#11d116">?</span> <b>Which version do you want to install?</b> <span style="color:#1abc9c">development</span>
155+
<span style="color:#11d116">?</span> <b>Would you like to use the provided samples?</b> (y/N) </pre>
156+
157+
<pre><b><span style="color:#1cdc9a">user@computer</span>:<span style="color:#3daee9">~/nodecg</span></b>$ nodecg-io install
158+
Installing nodecg-io...
159+
Detected nodecg installation at /home/user/nodecg.
160+
<span style="color:#11d116">?</span> <b>Which version do you want to install?</b> <span style="color:#1abc9c">development</span>
161+
<span style="color:#11d116">?</span> <b>Would you like to use the provided samples?</b> <span style="color:#1abc9c">No</span>
162+
<span style="color:#11d116">?</span> <b>Would you like to clone the documentation?</b> (y/N) </pre>
163+
164+
If you want to every change your nodecg-io installation to add/remove a service
165+
or change the version, you can always re-run `nodecg-io install`. If a nodecg-io
166+
installation is found, its options will be preselected in the prompt. Re-running
167+
`nodecg-io install` will also pull the repository and rebuild it.
168+
169+
</details>
170+
171+
### Continue reading
172+
173+
There are many example bundles premade for most services, so you may take a look
174+
at the
175+
[“Try an included sample”](../getting_started/try_example_bundle.md)-Guide (It
176+
will also tell you how to start NodeCG, log in and how to use the GUI). Or you
177+
could directly take a deep dive into our framework and either
178+
[create a new bundle](./create_new_bundle.md) or
179+
[integrate an existing bundle](./existing_bundle.md). There are other bundles
180+
using nodecg-io, witch you could try, so may take a look around GitHub or
181+
GitLab.
86182

87183
## Uninstall nodecg-io
88184

@@ -92,4 +188,5 @@ If you want to uninstall nodecg-io you can run the following command:
92188
nodecg-io uninstall
93189
```
94190

95-
This will remove the `nodecg-io` directory inside your nodecg installation and also will remove it from the loaded bundle paths in your nodecg configuration.
191+
This will remove the `nodecg-io` directory inside your NodeCG installation and
192+
also will remove it from the loaded bundle paths in your NodeCG configuration.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Try an included sample
2+
3+
Trying one of the premade example bundles is a good way to get to know the
4+
framework and especially the selected service.
5+
6+
> In case you installed the **production** branch of nodecg-io, you are out of
7+
> luck. Because the build process will cause problems if you just take one of
8+
> the samples and rebuild elsewhere.
9+
10+
If you installed **dev** branch via the `nodecg-io-cli` and did not select the
11+
“use the samples”-option run `nodecg-io install` and select it.
12+
13+
In case you cloned the repository directly from GitHub, everything should be
14+
included. But you may want to pull recent changes and rebuild the project.
15+
16+
## Step 1: Run NodeCG
17+
18+
Now you need to start NodeCG. There are a couple of different ways to do this:
19+
20+
### Using VS Code
21+
22+
If you have nodecg-io open in your VS Code instance, you can launch NodeCG using
23+
the `Run and Debug` Explorer View:
24+
25+
![Run and Debug Explorer View](../assets/run_from_vscode.png)
26+
27+
### Using the terminal
28+
29+
You may also launch NodeCG using your terminal with:
30+
31+
<pre><b><span style="color:#1cdc9a">user@computer</span>:<spanstyle="color:#3daee9">~/nodecg</span></b>$ npm run start
32+
33+
34+
> node index.js
35+
36+
info: [nodecg/lib/server] Starting NodeCG 1.8.1 (Running on Node.js v16.11.1)
37+
info: [nodecg-io-core] Minzig!
38+
39+
// A whole host of logging output
40+
41+
info: [nodecg/lib/server] NodeCG running on http://localhost:9090</pre>
42+
43+
Now you can open the NodeCG dashboard (by default) under
44+
<http://localhost:9090>.
45+
46+
## Step 2: Log in to nodecg-io
47+
48+
Now navigate to the `nodecg-io` tab in the NodeCG dashboard.
49+
50+
If you are logging in for the first time you will have to set your password.
51+
52+
![Log in screen](../assets/log_in_screen.png)
53+
54+
Else you simply have to log in with your previously chosen password.
55+
56+
Now you are looking at the `nodecg-io` config menu. It should look like this:
57+
58+
![`nodcg-io` config menu](../assets/nodcg-io-dashboard.png)
59+
60+
## Step 3: Learning how to use the GUI
61+
62+
The current GUI is just intended to make the project usable, but it is not very
63+
user-friendly. As a more long term solution, a new GUI will be developed that
64+
also focuses on user experience. Until the new GUI is developed, you will have
65+
to arrange yourself with this one. So, to get started:
66+
67+
![`nodcg-io` colour coded](../assets/nodcg-io-colored.png)
68+
69+
### In <span style="color:#b06770">pink</span>: NodeCG Tabs
70+
71+
Here you will find every NodeCG-bundle that has a dashboard. Here you may select
72+
the [`nodecg-io-debug`](../samples/debug.md)-dashboard, if it is installed.
73+
74+
### In <span style="color:#b6b61c">yellow</span>: Monaco editor
75+
76+
It is basically only a text editor which is used to save configurations for
77+
service instances.
78+
79+
### In <span style="color:#21885c">green</span>: Services section
80+
81+
Here you may create, update and delete instances of a service. Each instance has
82+
its own name and configuration. The menu will expand depending on the option
83+
selected in the first dropdown.
84+
85+
_Creating a new service instance_:
86+
87+
This can be accomplished by selecting the item `'New'`. Then a new dropdown will
88+
be revealed, in witch you may select the service type. Additionally, you must
89+
select an instance name. Then click `'Create'`. The newly created instance
90+
should be selected.
91+
92+
_Configure a service instance_:
93+
94+
While a supported service instance is selected, you may change the config in
95+
monaco, then click `'Save'`.
96+
97+
_Deleting a service instance_:
98+
99+
This can be accomplished by selecting an existing instance. Then click
100+
`'Delete Instance'`.
101+
102+
### In <span style="color:#69318e">violet</span>: Bundles section
103+
104+
This section has three dropdowns:
105+
106+
1. Bundle: Here you can select a bundle to configure.
107+
2. Service: If this bundle uses more than one service, you may select the
108+
service to set or unset here.
109+
3. Service Instance: Here you can select one instance of the service type set at
110+
2 or `none`.
111+
112+
### In <span style="color:#b71424">red</span>: Unset all Button
113+
114+
This button will set the service instance for every bundle/service combination
115+
to none, effectively removing the access to every service from all bundles.
116+
**Caution**: This can not be undone, and you will have to set up all the bundles
117+
again. _The service instances will be unaffected._
118+
119+
## Step 4: Configure the sample
120+
121+
The configurations for every sample bundle differ too greatly from each other to
122+
be included here, so you have to take a look at the documentation for your
123+
sample bundle. You will find it on the left-hand side of this page in the
124+
category `Services`.

docs/samples/ahk.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
## Using the AHK sample bundle
1+
## Using the AutoHotkey sample bundle
22

3-
The AHK sample bundle in `samples/ahk-sendcommand` shows how to send a command to a HotkeylessAHK server.
3+
The AutoHotkey sample bundle in `samples/ahk-sendcommand` shows how to send a
4+
command to a HotkeylessAHK server.
45

56
### Prerequisites
67

7-
- Working NodeCG & nodecg-io installation
8-
- A running [HotkeylessAHK](https://github.com/sebinside/HotkeylessAHK) setup.
9-
10-
### Configure the ahk sample bundle
11-
12-
1. Start nodecg with nodecg-io installed. The ahk bundle is currently part of it, so it should also be loaded.
8+
You will need a working `nodecg-io` installation. If you have non yet take a
9+
look at [installation guide](../getting_started/install.md). You may need to
10+
install this bundle, so take a look at the
11+
[“Try an included sample”](../getting_started/try_example_bundle.md)-Guide. It
12+
will also tell you how to log in and how to use the GUI.
1313

14-
2. Go to the `nodecg-io` tab in the nodecg dashboard.
14+
**You also need:**
1515

16-
3. Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials.
17-
18-
4. Create a new ahk service instance using the left upper menu.
16+
- A running [HotkeylessAHK](https://github.com/sebinside/HotkeylessAHK) setup.
1917

20-
5. Enter the host and port of the HotkeylessAHK Server.
18+
### Configure the AutoHotkey sample bundle
2119

22-
The created instance should be automatically selected, if not select it in the upper left menu. Enter your host and port in monaco (the text-editor on the right) in this format:
20+
1. In NodeCG, create a new ahk service instance.
21+
2. Enter the host and port of the HotkeylessAHK Server:
2322

2423
```json
2524
{
@@ -30,6 +29,6 @@ The AHK sample bundle in `samples/ahk-sendcommand` shows how to send a command t
3029

3130
After entering it, click save.
3231

33-
6. Set the created ahk service instance to the service dependency of the ahk bundle.
34-
35-
7. A small window with the text “Hello World” should have popped up.
32+
3. Set the sample's (`ahk-sendcommand`) dependency to be the newly created
33+
service instance (of type `ahk`).
34+
4. A small window with the text “Hello World” should have popped up.

0 commit comments

Comments
 (0)