Skip to content

Commit cb6bb27

Browse files
Overhaul Component docs for v4 (#140)
* just getting started * progress * much more progress. ready for rough review * fix up some things * start working on components directory changes. draft managing.md * beep boop writing is fun * Update docs/developers/components/managing.md Co-authored-by: Chris Barber <[email protected]> * first draft finally complete * fix yaml spacing * update acl-connect link * update summary * many edits * switch to built-in * switch to carets instead of curly braces * s/process/terminal * Apply suggestions from code review Co-authored-by: Chris Barber <[email protected]> * add rolling restart line --------- Co-authored-by: Chris Barber <[email protected]>
1 parent fe24923 commit cb6bb27

File tree

11 files changed

+563
-318
lines changed

11 files changed

+563
-318
lines changed

docs/SUMMARY.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
* [Web Applications](developers/applications/web-applications.md)
1515
* [Example Projects](developers/applications/example-projects.md)
1616
* [Components](developers/components/README.md)
17-
* [Installing](developers/components/installing.md)
18-
* [Writing Extensions](developers/components/writing-extensions.md)
19-
* [Operations](developers/components/operations.md)
20-
* [Google Data Studio](developers/components/google-data-studio.md)
21-
* [SDKs](developers/components/sdks.md)
22-
* [Drivers](developers/components/drivers.md)
17+
* [Managing](developers/components/managing.md)
18+
* [Reference](developers/components/reference.md)
19+
* [Built-In Components](developers/components/built-in.md)
2320
* [REST](developers/rest.md)
2421
* [Operations API](developers/operations-api/README.md)
2522
* [Quick Start Examples](developers/operations-api/quickstart-examples.md)
@@ -65,6 +62,9 @@
6562
* [SQL Functions](developers/sql-guide/functions.md)
6663
* [SQL JSON Search](developers/sql-guide/json-search.md)
6764
* [SQL Geospatial Functions](developers/sql-guide/sql-geospatial-functions.md)
65+
* Miscellaneous
66+
* [Google Data Studio](developers/miscellaneous/google-data-studio.md)
67+
* [SDKs](developers/miscellaneous/sdks.md)
6868

6969
## Administration
7070

docs/developers/components/README.md

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
11
# Components
22

3-
HarperDB is a highly extensible database application platform with support for a rich variety of composable modular components and components that can be used and combined to build applications and add functionality to existing applications. HarperDB tools, components, and add-ons can be found in a few places:
3+
Harper components are a core Harper concept defined as flexible JavaScript based _extensions_ of the highly extensible core Harper platform. They are executed by Harper directly and have complete access to the Harper [Global APIs](../../technical-details/reference/globals.md) (such as `Resource`, `databases`, and `tables`).
44

5-
* [SDK libraries](sdks.md) are available for connecting to HarperDB from different languages.
6-
* [Drivers](drivers.md) are available for connecting to HarperDB from different products and tools.
7-
* [HarperDB-Add-Ons repositories](https://github.com/orgs/HarperDB-Add-Ons/repositories) lists various templates and add-ons for HarperDB.
8-
* [HarperDB repositories](https://github.com/orgs/HarperDB-Add-Ons/repositories) include additional tools for HarperDB.
9-
* You can also [search github.com for ever-growing list of projects that use, or work with, HarperDB](https://github.com/search?q=harperdb\&type=repositories)
10-
* [Google Data Studio](google-data-studio.md) is a visualization tool for building charts and tables from HarperDB data.
5+
A key aspect to components are their extensibility; components can be built on other components. For example, a [Harper Application](../applications/README.md) is a component that uses many other components. The [application template](https://github.com/HarperDB/application-template) demonstrates many of Harper's built-in components such as `rest` (for automatic REST endpoint generation), `graphqlSchema` (for table schema definitions), and many more.
116

12-
## Components
7+
From management to development, the following pages document everything a developer needs to know about Harper components.
138

14-
There are four general categories of components for HarperDB. The most common is applications. Applications are simply a component that delivers complete functionality through an external interface that it defines, and is usually composed of other components. See [our guide to building applications for getting started](../applications/).
9+
- [Managing Components](./managing.md) - developing, installing, deploying, and executing Harper components locally and remotely
10+
- [Technical Reference](./reference.md) - detailed, technical reference for component development
11+
- [Built-In Components](./built-in.md) - documentation for all of Harper's built-in components (i.e. `rest`)
1512

16-
A data source component can implement the Resource API to customize access to a table or provide access to an external data source. External data source components are used to retrieve and access data from other sources.
13+
## Custom Components
1714

18-
The next two are considered extension components. Server protocol extension components provide and define ways for clients to access data and can be used to extend or create new protocols.
15+
The following list is all of Harper's officially maintained, custom components. They are all available on npm and GitHub.
1916

20-
Server resource components implement support for different types of files that can be used as resources in applications. HarperDB includes support for using JavaScript modules and GraphQL Schemas as resources, but resource components may add support for different file types like HTML templates (like JSX), CSV data, and more.
21-
22-
## Server components
23-
24-
Server components can be easily be added and configured by simply adding an entry to your harperdb-config.yaml:
25-
26-
```yaml
27-
my-server-component:
28-
package: 'HarperDB-Add-Ons/package-name' # this can be any valid github or npm reference
29-
port: 4321
30-
```
31-
32-
## Writing Extension Components
33-
34-
You can write your own extensions to build new functionality on HarperDB. See the [writing extension components documentation](writing-extensions.md) for more information.
17+
- [`@harperdb/nextjs`](https://github.com/HarperDB/nextjs)
18+
- [`@harperdb/apollo`](https://github.com/HarperDB/apollo)
19+
- [`@harperdb/status-check`](https://github.com/HarperDB/status-check)
20+
- [`@harperdb/prometheus-exporter`](https://github.com/HarperDB/prometheus-exporter)
21+
- [`@harperdb/acl-connect`](https://github.com/HarperDB/acl-connect)
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Built-In Components
2+
3+
Harper provides extended features using built-in components. They do **not** need to be installed with a package manager, and simply must be specified in a config to run. These are used throughout many Harper docs, guides, and examples. Unlike external components which have their own semantic versions, built-in components follow Harper's semantic version.
4+
5+
- [Built-In Components](#built-in-components)
6+
- [fastifyRoutes](#fastifyroutes)
7+
- [graphql](#graphql)
8+
- [graphqlSchema](#graphqlschema)
9+
- [jsResource](#jsresource)
10+
- [rest](#rest)
11+
- [roles](#roles)
12+
- [static](#static)
13+
14+
<!-- ## authentication -->
15+
16+
<!-- ## clustering -->
17+
18+
## fastifyRoutes
19+
20+
Specify custom endpoints using [Fastify](https://fastify.dev/).
21+
22+
This component is a [Resource Extension](./reference.md#resource-extension) and can be configured with the [`files`, `path`, and `root`](./reference.md#resource-extension-configuration) configuration options.
23+
24+
Complete documentation for this feature is available here: [Define Fastify Routes](https://docs.harperdb.io/docs/developers/applications/define-fastify-routes)
25+
26+
```yaml
27+
fastifyRoutes:
28+
files: './routes/*.js'
29+
```
30+
31+
## graphql
32+
33+
> GraphQL querying is **experimental**, and only partially implements the GraphQL Over HTTP / GraphQL specifications.
34+
35+
Enables GraphQL querying via a `/graphql` endpoint loosely implementing the GraphQL Over HTTP specification.
36+
37+
Complete documentation for this feature is available here: [GraphQL](https://docs.harperdb.io/docs/technical-details/reference/graphql)
38+
39+
```yaml
40+
graphql: true
41+
```
42+
43+
## graphqlSchema
44+
45+
Specify schemas for Harper tables and resources via GraphQL schema syntax.
46+
47+
This component is a [Resource Extension](./reference.md#resource-extension) and can be configured with the [`files`, `path`, and `root`](./reference.md#resource-extension-configuration) configuration options.
48+
49+
Complete documentation for this feature is available here: [Defining Schemas](https://docs.harperdb.io/docs/developers/applications/defining-schemas)
50+
51+
```yaml
52+
graphqlSchema:
53+
files: './schemas.graphql'
54+
```
55+
56+
## jsResource
57+
58+
Specify custom, JavaScript based Harper resources.
59+
60+
Refer to the Application [Custom Functionality with JavaScript](https://docs.harperdb.io/docs/developers/applications#custom-functionality-with-javascript) guide, or [Resource Class](https://docs.harperdb.io/docs/technical-details/reference/resource) reference documentation for more information on custom resources.
61+
62+
This component is a [Resource Extension](./reference.md#resource-extension) and can be configured with the [`files`, `path`, and `root`](./reference.md#resource-extension-configuration) configuration options.
63+
64+
```yaml
65+
jsResource:
66+
files: './resource.js'
67+
```
68+
69+
<!-- ## login -->
70+
71+
<!-- ## mqtt -->
72+
73+
<!-- ## operationsApi -->
74+
75+
<!-- ## replication -->
76+
77+
## rest
78+
79+
Enable automatic REST endpoint generation for exported resources with this component.
80+
81+
Complete documentation for this feature is available here: [REST](https://docs.harperdb.io/docs/developers/rest)
82+
83+
```yaml
84+
rest: true
85+
```
86+
87+
This component contains additional options:
88+
89+
To enable `Last-Modified` header support:
90+
91+
```yaml
92+
rest:
93+
lastModified: true
94+
```
95+
96+
To disable automatic WebSocket support:
97+
98+
```yaml
99+
rest:
100+
webSocket: false
101+
```
102+
103+
## roles
104+
105+
Specify roles for Harper tables and resources.
106+
107+
This component is a [Resource Extension](./reference.md#resource-extension) and can be configured with the [`files`, `path`, and `root`](./reference.md#resource-extension-configuration) configuration options.
108+
109+
Complete documentation for this feature is available here: [Defining Roles](https://docs.harperdb.io/docs/developers/applications/defining-roles)
110+
111+
```yaml
112+
roles:
113+
files: './roles.yaml'
114+
```
115+
116+
## static
117+
118+
Specify which files to server statically from the Harper HTTP endpoint. Built using the [send](https://www.npmjs.com/package/send) and [serve-static](https://www.npmjs.com/package/serve-static) modules.
119+
120+
This component is a [Resource Extension](./reference.md#resource-extension) and can be configured with the [`files`, `path`, and `root`](./reference.md#resource-extension-configuration) configuration options.
121+
122+
```yaml
123+
static:
124+
files: './web/*'
125+
```

docs/developers/components/drivers.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/developers/components/installing.md

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)