-
Notifications
You must be signed in to change notification settings - Fork 9
Create "Harper Applications in Depth" Learn Guide #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-docs.stage.harperfabric.com/pr-426 This preview will update automatically when you push new commits. |
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-docs.stage.harperfabric.com/pr-426 This preview will update automatically when you push new commits. |
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-docs.stage.harperfabric.com/pr-426 This preview will update automatically when you push new commits. |
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-docs.stage.harperfabric.com/pr-426 This preview will update automatically when you push new commits. |
| } | ||
| ``` | ||
|
|
||
| The `DogWithHumanAge` class extends from `tables.Dog`. The `tables` reference is a global added by Harper that is a map of all tables, such as the ones defined by `graphqlSchema`. A table class represents the collection of all the records in the table. Its an interface for querying and accessing records from the table and even creating/updating records too. The purpose of the `static loadAsInstance = false;` line is to ensure that this resource does not load as a singular record instance. This enables `DogWithHumanAge` to extend the functionality of `tables.Dog`. The `export` keyword instructs Harper to automatically generate a REST API endpoint for the custom resource using the same name (`DogWithHumanAge/`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kriszyp is this description okay for explaining the concepts of table classes, resources, static, instances, etc. ?
I tried to blend a bit of your latest info from Slack and the existing docs page on Resources.
|
|
||
| ### Component Classification: Built-in vs Custom | ||
|
|
||
| Harper further classifies components (plugins and applications) as either built-in or custom. **Built-in** components are internal to Harper, require no additional installation steps, and are immediately accessible for use. The `graphqlSchema` and `rest` plugins are great examples of built-in plugins. **Custom** components are external to Harper, generally available as an npm package or git repository, and do require additional installation steps in order to be used. Custom components can be authored by anyone, including Harper. Any of Harper's official custom components are published using the `@harperdb` and `@harper` package scopes, such as the [`@harperdb/nextjs`](https://github.com/HarperDB/nextjs) plugin for developing Next.js applications or the [`@harperdb/status-check`](https://github.com/HarperDB/status-check) application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it @harper or @harperfast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we cross-publishing yet?
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-docs.stage.harperfabric.com/pr-426 This preview will update automatically when you push new commits. |
Co-authored-by: Chris Barber <chris@harperdb.io>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-docs.stage.harperfabric.com/pr-426 This preview will update automatically when you push new commits. |
This PR adds a new Learn guide titled "Harper Applications in Depth". Its meant to come after the getting started guide as it builds directly off of the application created in those. This guide covers Harper in more depth, explains and demonstrates the Operations API and CLI, introduces Resource API, demonstrates how to enable the debugger. and introduces our logger api.
All in all, this post is like a more-advanced crash course into Harper applications than the applications. The goal here is that devs should feel more confident building harper apps on their own and they have the tools to start experimenting and being creative. More technical info to come in later guides!