You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn/getting-started/create-your-first-application.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -152,7 +152,7 @@ With the `schema.graphql` and `config.yaml` in place, now its time to run your a
152
152
153
153
If Harper is still running, shut it down using `CTRL/CMD + C`.
154
154
155
-
Within your application directory, open a command line and run `harperdb dev .`
155
+
Within your application directory, open a command line and run `harper dev .`
156
156
157
157
The `dev` command will watch all files (except for `node_modules` directory) within your application directory and restart Harper when changes are detected.
158
158
@@ -325,8 +325,8 @@ Search queries return a list of records that match the specified conditions, in
One of Harper's primary goals since day 1 was to be easy to install and get started with. The core Harper application itself is just a Node.js application with some native module dependencies. The simplest and easiest way to get started using Harper is by installing it using npm (or any npm compatible Node.js package manager). In addition to installing Harper directly to your local development environment, the Harper team provides a Docker image ([`harperdb/harperdb`](https://hub.docker.com/r/harperdb/harperdb)), and most recently a platform service called [Harper Fabric](https://fabric.harper.fast).
10
+
One of Harper's primary goals since day one was to be easy to install and get started with. The core Harper application itself is just a Node.js application with some native module dependencies. The simplest and easiest way to get started using Harper is by installing it using npm (or any npm compatible Node.js package manager). In addition to installing Harper directly to your local development environment, the Harper team provides a Docker image ([`harperdb/harperdb`](https://hub.docker.com/r/harperdb/harperdb)), and most recently a platform service called [Harper Fabric](https://fabric.harper.fast).
11
11
12
12
This guide will demonstrate all three ways to get started as well as introduce some basic Harper features such as the CLI and our built in health endpoint.
13
13
14
14
## What You Will Learn
15
15
16
16
- How to install Harper locally using a Node.js package manager or a container
17
-
- How to use the `harperdb` CLI
17
+
- How to use the `harper` CLI
18
18
- How to get setup using Harper Fabric
19
19
- How to perform a health check using the built-in Harper Operations API health endpoint
20
20
@@ -41,64 +41,25 @@ The fastest way to get started is by installing Harper globally using an npm com
41
41
npm install -g harperdb
42
42
```
43
43
44
-
</TabItem>
45
-
<TabItemvalue="docker"label="Docker">
46
-
47
-
Harper is readily available as a Docker image [`harperdb/harperdb`](https://hub.docker.com/r/harperdb/harperdb).
48
-
49
-
The image is based off of a Node.js image and the default tag is always published using the latest Harper version and latest Node.js Active LTS version.
50
-
51
-
The image uses sensible default environment variables, agreeing to the terms and conditions, setting a rootpath ensured by the image itself, creating a default admin user with username `HDB_ADMIN` and password `password`, and enabled standard streams logging.
52
-
53
-
Using a Docker compatible container manager of choice, the simplest way to get started is using:
54
-
55
-
```bash
56
-
docker pull harperdb/harperdb
57
-
docker run -it \
58
-
--name harper \
59
-
-v /Users/<user>/hdb:/home/harperdb/hdb \
60
-
-v /Users/<user>/dev:/home/harperdb/dev \
61
-
-e DEFAULTS_MODE=dev \
62
-
-e REPLICATION_HOSTNAME=localhost \
63
-
-p 9925:9925 \
64
-
-p 9926:9926 \
65
-
harperdb/harperdb \
66
-
/bin/bash
67
-
```
68
-
69
-
The `-v` options will mount the Harper installation (`hdb/`) as well as a development directory (`dev/`) to the container host which is useful for development purposes. Now the `hdb/` path will contain the Harper installation parts (once you install), and the `dev/` directory can be used to create projects (which future guides will require).
70
-
71
-
The additional environment variables specified by `-e` options ensures the installation is setup for local development.
72
-
73
-
Without the `-it` and `/bin/bash` parts, the image will start (and install) the Harper application by default. For the purposes of these guides, access to the `harperdb` CLI is necessary, so we recommend to always exec into the container.
74
-
75
-
</TabItem>
76
-
</Tabs>
77
-
78
-
Then, execute the Harper CLI to start the installation process:
44
+
Then, execute the Harper CLI:
79
45
80
46
```bash
81
-
harperdb install
47
+
harper
82
48
```
83
49
84
-
The Harper installation process is an interactive prompt, however it also supports overrides using environment variables or CLI arguments. It supports partial or complete overrides for the installation prompts and even allows additional configuration options to be specified too.
85
-
86
-
This guide focusses on a happy path in order to keep things simple. If you're interested in learning more about all of Harper's configuration options see the the [Harper CLI](../../docs/deployments/harper-cli) reference docs.
87
-
88
-
<TabsgroupId="local-install">
89
-
<TabItemvalue="npm"label="npm">
50
+
When installing locally on your machine, you can specify any destination for Harper, we recommend using something within your home directory such as `$HOME/hdb`. Keep note of what you specify for the username and password, and make sure you select the `dev` default config and set the hostname to `localhost`.
90
51
91
-
When installing locally on your machine, you can specify any destination for Harper, we recommend using something within your user directory such as `/User/<user>/hdb`. Keep note of what you specify for the username and password, and make sure you select the `dev` default config and set the hostname to `localhost`.
52
+
:::important
53
+
Do not actually enter `$HOME` in the destination prompt; it should automatically fill in the value of your home directory. Otherwise, specify the absolute path for the Harper installation.
54
+
:::
92
55
93
56
```
94
-
> harperdb install
95
-
96
57
Starting HarperDB install...
97
58
98
59
Terms & Conditions can be found at https://harperdb.io/legal/end-user-license-agreement
99
60
and can be viewed by typing or copying and pasting the URL into your web browser.
100
61
I agree to the HarperDB Terms and Conditions: (yes/no) yes
101
-
Please enter a destination for HarperDB: /User/<user>/hdb
62
+
Please enter a destination for HarperDB: $HOME/hdb
102
63
Please enter a username for the administrative user: HDB_ADMIN
103
64
Please enter a password for the administrative user: [hidden]
104
65
Default Config - dev (easy access/debugging) or prod (security/performance): (dev/prod) dev
@@ -112,46 +73,45 @@ HarperDB installation was successful.
112
73
</TabItem>
113
74
<TabItemvalue="docker"label="Docker">
114
75
115
-
The base image presets a number of configuration environment variables. The additional `DEFAULTS_MODE` and `REPLICATION_HOSTNAME` variables included in the `docker run` command complete the installation prompts making the whole command non-interactive.
116
-
117
-
```
118
-
> harperdb install
76
+
Harper is readily available as a Docker image [`harperdb/harperdb`](https://hub.docker.com/r/harperdb/harperdb).
119
77
120
-
Starting HarperDB install...
78
+
The image is based off of a Node.js image and the default tag is always published using the latest Harper version and latest Node.js Active LTS version.
121
79
122
-
Terms & Conditions can be found at https://harperdb.io/legal/end-user-license-agreement
123
-
and can be viewed by typing or copying and pasting the URL into your web browser.
124
-
I agree to the HarperDB Terms and Conditions: (yes/no) yes
125
-
Please enter a destination for HarperDB: /home/harperdb/hdb
126
-
Please enter a username for the administrative user: HDB_ADMIN
127
-
Please enter a password for the administrative user: [hidden]
128
-
Default Config - dev (easy access/debugging) or prod (security/performance): (dev/prod) dev
129
-
Please enter the hostname for this server: localhost
80
+
The image uses sensible default environment variables, agreeing to the terms and conditions, setting a rootpath ensured by the image itself, creating a default admin user with username `HDB_ADMIN` and password `password`, and enabled standard streams logging.
130
81
131
-
HarperDB installation was successful.
82
+
Using a Docker compatible container manager of choice, the simplest way to get started is using:
132
83
133
-
[main/0] [notify]: HarperDB installation was successful.
84
+
```bash
85
+
docker pull harperdb/harperdb
86
+
docker run -it \
87
+
--name harper \
88
+
-v $HOME/hdb:/home/harperdb/hdb \
89
+
-v $HOME/dev:/home/harperdb/dev \
90
+
-e DEFAULTS_MODE=dev \
91
+
-e REPLICATION_HOSTNAME=localhost \
92
+
-p 9925:9925 \
93
+
-p 9926:9926 \
94
+
harperdb/harperdb
134
95
```
135
96
136
-
Keep in mind that Harper is installed at the `/home/harperdb/hdb` path within the container (which is mounted to some path on the host system if you used `-v` in the `docker run` command), and that the username and password are defaulted to `HDB_ADMIN` and `password` respectively.
97
+
The `-v` options will mount the Harper installation (`hdb/`) as well as a development directory (`dev/`) to the container host which is useful for development purposes. The `hdb/` path will contain the Harper installation parts, and the `dev/` directory can be used to create projects (which future guides will require).
137
98
138
-
</TabItem>
139
-
</Tabs>
99
+
The additional environment variables specified by `-e` options ensures the installation is setup for local development.
140
100
141
-
### Running Harper
101
+
The image is configured to automatically run the `harper` command upon startup. During container creation, this will automatically complete the Harper installation step.
142
102
143
-
After completing the installation, runHarper using:
103
+
The Harper installation process is normally an interactive prompt; however, it also supports overrides using environment variables or CLI arguments. Since the image contains preset environment variables and additional environment variables `DEFAULTS_MODE` and `REPLICATION_HOSTNAME` are included in the `docker run` command, Harper will complete its installation step completely non-interactively.
144
104
145
-
```bash
146
-
harperdb
147
-
```
105
+
</TabItem>
106
+
</Tabs>
148
107
149
-
This command runs Harper in the current command process. As long as the `logging.stdStream` configuration option is set to `true` (which is the default when using the `dev` default mode), Harper will also stream all logs to the `stdout` and `stderr` streams too.
108
+
After completing the installation step, Harper should now be running in the active process.
109
+
110
+
As long as the `logging.stdStream` configuration option is set to `true` (which is the default when using the `dev` default mode), Harper will also stream all logs to the `stdout` and `stderr` streams too.
150
111
151
112
If all is working correctly, you should see the following output in your command line:
152
113
153
114
```
154
-
> harperdb
155
115
Starting HarperDB...
156
116
157
117
▒▒▒▓▓▓▓▓▓▓▓▓▓▓▒▒
@@ -227,16 +187,14 @@ To check if everything is configured correctly and ready to go for development,
227
187
The Operations API provides a full set of capabilities for configuring, deploying, administering, and controlling Harper. We'll learn more about it throughout all of the guide pages.
228
188
229
189
:::note
230
-
If you configured a different Operations API port, use that instead of `9925` here.
231
-
232
-
Similarly, if you are using a Harper Fabric cluster, replace the `http://localhost` with the cluster URL.
190
+
If you are using a Harper Fabric cluster, replace the `http://localhost` with the cluster URL.
0 commit comments