This repository was archived by the owner on Apr 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Improve getting started section #76
Merged
hlxid
merged 4 commits into
codeoverflow-org:master
from
TimTechDev:maintenance/improve-sample-docs
Oct 30, 2021
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
# Try an included sample | ||
|
||
Trying one of the premade example bundles is a good way to get to know the | ||
framework and especially the selected service. | ||
|
||
## Step 1: Installing the Sample | ||
|
||
If you installed **dev** branch or cloned nodecg-io directly from GitHub all the | ||
samples should be already installed (you can move to step 2). In case you | ||
installed the **production** branch of nodecg-io, you may have to download the | ||
sample before you can use it. Installing and uninstalling of sample bundles can be done with the nodecg-io | ||
CLI. This can be done as follows. | ||
|
||
Run this command inside your NodeCG folder: | ||
|
||
```shell | ||
$ nodecg-io install | ||
Installing nodecg-io... | ||
``` | ||
|
||
You will be presented with a pair of options: | ||
|
||
<!-- prettier-ignore-start --> | ||
|
||
1. You can select the version of nodecg-io to install. **Select the version that is already installed here.** (Since this is not the migration guide) | ||
<pre><b><span style="color:#1cdc9a">user@computer</span>:<span style="color:#3daee9">~/nodecg</span></b>$ nodecg-io install | ||
Installing nodecg-io... | ||
Detected nodecg installation at /home/user/nodecg. | ||
<span style="color:#11d116">?</span> <b>Which version do you want to install?</b> (Use arrow keys) | ||
development | ||
<span style="color:#1abc9c">❯ 0.1</span></pre> | ||
2. You can select the sample bundles to be included. **Select the sample(s) you want to try here.** | ||
<pre><b><span style="color:#1cdc9a">user@computer</span>:<span style="color:#3daee9">~/nodecg</span></b>$ nodecg-io install | ||
Installing nodecg-io... | ||
Detected nodecg installation at /home/user/nodecg. | ||
<span style="color:#11d116">?</span> <b>Which version do you want to install?</b> <span style="color:#1abc9c">0.1</span> | ||
<span style="color:#11d116">?</span> <b>Which services do you want to use?</b> (Press <span style="color:#16a085"><space></span> to select, <span style="color:#16a085"><a></span> to toggle all, <span style="color:#16a085"><i></span> to invert selection, and <span style="color:#16a085"><enter></span> to proceed) | ||
<span style="color:#1abc9c">❯◯ ahk</span> | ||
◯ android | ||
◯ curseforge | ||
◯ discord | ||
◯ intellij | ||
◯ irc | ||
◯ midi-input | ||
(Move up and down to reveal more choices)</pre> | ||
|
||
<!-- prettier-ignore-end --> | ||
|
||
## Step 2: Run NodeCG | ||
|
||
Now you need to start NodeCG. There are a couple of different ways to do this: | ||
|
||
### Using VS Code | ||
|
||
If you have nodecg-io open in your VS Code instance, you can launch NodeCG using | ||
the `Run and Debug` Explorer View: | ||
|
||
 | ||
|
||
### Using the terminal | ||
|
||
You may also launch NodeCG using your terminal with: | ||
|
||
<pre><b><span style="color:#1cdc9a">user@computer</span>:<spanstyle="color:#3daee9">~/nodecg</span></b>$ npm run start | ||
|
||
> [email protected] start | ||
> node index.js | ||
|
||
info: [nodecg/lib/server] Starting NodeCG 1.8.1 (Running on Node.js v16.11.1) | ||
info: [nodecg-io-core] Minzig! | ||
|
||
// A whole host of logging output | ||
|
||
info: [nodecg/lib/server] NodeCG running on http://localhost:9090</pre> | ||
|
||
Now you can open the NodeCG dashboard (by default) under <http://localhost:9090>. | ||
|
||
## Step 3: Log in to nodecg-io | ||
|
||
Now navigate to the `nodecg-io` tab in the NodeCG dashboard. | ||
|
||
If you are logging in for the first time you will have to set your password. | ||
|
||
 | ||
|
||
Else you simply have to log in with your previously chosen password. | ||
|
||
Now you are looking at the `nodecg-io` config menu. It should look like this: | ||
|
||
 | ||
|
||
## Step 4: Learning how to use the GUI | ||
|
||
The current GUI is just intended to make the project usable, but it is not very | ||
user-friendly. As a more long term solution, a new GUI will be developed that | ||
also focuses on user experience. Until the new GUI is developed, you will have | ||
to arrange yourself with this one. So, to get started: | ||
|
||
 | ||
|
||
### In <span style="color:#b06770">pink</span>: NodeCG Tabs | ||
|
||
Here you will find every NodeCG-bundle that has a dashboard. Here you may | ||
select the [`nodecg-io-debug`](../samples/debug.md)-dashboard, if it is | ||
installed. | ||
|
||
### In <span style="color:#b6b61c">yellow</span>: Monaco editor | ||
|
||
It is basically only a text editor which is used to save configurations for | ||
service instances. | ||
|
||
### In <span style="color:#21885c">green</span>: Services section | ||
|
||
Here you may create, update and delete instances of a service. Each instance has | ||
its own name and configuration. The menu will expand depending on the option | ||
selected in the first dropdown. | ||
|
||
_Creating a new service instance_: | ||
|
||
This can be accomplished by selecting the item `'New'`. Then a new dropdown will | ||
be revealed, in witch you may select the service type. Additionally, you must | ||
select an instance name. Then click `'Create'`. The newly created instance should | ||
be selected. | ||
|
||
_Configure a service instance_: | ||
|
||
While a supported service instance is selected, you may change the config in | ||
monaco, then click `'Save'`. | ||
|
||
_Deleting a service instance_: | ||
|
||
This can be accomplished by selecting an existing instance. Then click | ||
`'Delete Instance'`. | ||
|
||
### In <span style="color:#69318e">violet</span>: Bundles section | ||
|
||
This section has three dropdowns: | ||
|
||
1. Bundle: Here you can select a bundle to configure. | ||
2. Service: If this bundle uses more than one service, you may select the | ||
service to set or unset here. | ||
3. Service Instance: Here you can select one instance of the service type set at | ||
2 or `none`. | ||
|
||
### In <span style="color:#b71424">red</span>: Unset all Button | ||
|
||
This button will set the service instance for every bundle/service combination | ||
to none, effectively removing the access to every service from all bundles. | ||
**Caution**: This can not be undone, and you will have to set up all the bundles | ||
again. _The service instances will be unaffected._ | ||
|
||
## Step 5: Configure the sample | ||
|
||
The configurations for every sample bundle differ too greatly from each other to be included here, | ||
so you have to take a look at the documentation for your sample bundle. You will | ||
find it on the left-hand side of this page in the category `Services`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,59 @@ | ||
## Using the Android sample bundle | ||
|
||
The Android example bundle in `samples/android` shows how to connect to an android device and turn on WLAN. | ||
|
||
1. Clone [this](https://github.com/noeppi-noeppi/nodecg-io-android) Git Repository | ||
|
||
2. Run `gradlew build` (on Windows) or `./gradlew build` (on Linux) inside the cloned repository. | ||
|
||
3. There will be an apk file generated in `app/build/outputs/apk/debug/app-debug.apk`. Install it on the device. | ||
|
||
4. Launch the app. You'll be asked to grant the system alert window permission. This is required because the app will do its work in the background. However, occasionally when user interaction is required, it needs to launch an activity without the user pressing the app icon in the launcher. | ||
|
||
5. Install the android developer tools and make sure you have the `adb` command in your `PATH` | ||
|
||
6. Enable developer options on you device and enable USB debugging there. See [here](https://developer.android.com/studio/debug/dev-options). | ||
|
||
The Android example bundle in `samples/android` shows how to connect to an | ||
Android device and turn on WLAN. | ||
|
||
### Prerequisites | ||
|
||
You will need a working `nodecg-io` installation. If you have non yet take a | ||
look at [installation guide](../getting_started/install.md). You may need to | ||
install this bundle, so take a look at the | ||
[“Try an included sample”](../getting_started/try_example_bundle.md)-Guide. It | ||
will also tell you how to log in and how to use the GUI. | ||
|
||
**You also need:** | ||
|
||
1. Clone [this](https://github.com/noeppi-noeppi/nodecg-io-android) Git | ||
Repository | ||
2. Run `gradlew build` (on Windows) or `./gradlew build` (on Linux) inside the | ||
cloned repository. | ||
3. There will be an apk file generated in | ||
`app/build/outputs/apk/debug/app-debug.apk`. Install it on the Android | ||
device. | ||
4. Launch the app. You'll be asked to grant the system alert window permission. | ||
This is required because the app will do its work in the background. However, | ||
occasionally when user interaction is required, it needs to launch an | ||
activity without the user pressing the app icon in the launcher. | ||
5. Install the android developer tools and make sure you have the `adb` command | ||
in your `PATH` | ||
6. Enable developer options on you device and enable USB debugging there. See | ||
[here](https://developer.android.com/studio/debug/dev-options). | ||
7. Run `adb start-server` | ||
|
||
8. Connect your device via USB. You'll be prompted whether you want to allow USB debugging. Press `Allow`. | ||
|
||
8. Connect your device via USB. You'll be prompted whether you want to allow USB | ||
debugging. Press `Allow`. | ||
9. Run `adb device -l`. The output might look like this: | ||
|
||
``` | ||
```log | ||
######## device usb:2-1.7 product:######## model:######## device:######## transport_id:2 | ||
``` | ||
|
||
The hexadecimal number in the first column is your device ID. You'll need this later. | ||
|
||
10. Start nodecg with nodecg-io installed. The bundle is currently part of it, so it should also be loaded. | ||
|
||
11. Go to the `nodecg-io` tab in the nodecg dashboard. | ||
|
||
12. Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials. | ||
The hexadecimal number in the first column is your device ID. You'll need | ||
this later. | ||
|
||
13. Create a new android service instance using the left upper menu. | ||
10. In NodeCG, create a new android service instance using the left upper menu. | ||
11. Enter the following: | ||
|
||
14. Enter the following | ||
|
||
``` | ||
```json | ||
{ | ||
"device": "device_id" | ||
} | ||
``` | ||
|
||
Replace `device_id` with your device ID. | ||
|
||
15. Set the created android service instance to the service dependency of the android sample bundle. | ||
|
||
Select the android bundle and the android service in the left bottom menu and then select the service instance that should be used by the android sample bundle (in this case the name of the previously created android instance). | ||
|
||
16. You should see that WLAN is now activated on your device. | ||
12. Set the created android service instance to the service dependency of the | ||
android sample bundle. | ||
Select the android bundle and the android service in the left bottom menu. | ||
Then select the service instance that should be used by the android sample | ||
bundle (in this case the name of the previously created android instance). | ||
13. You should see that WLAN is now activated on your device. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.