Skip to content

Commit

Permalink
feat(docs): add quick start page
Browse files Browse the repository at this point in the history
  • Loading branch information
cesconix committed Aug 10, 2024
1 parent c220b8e commit b6cd3a5
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 18 deletions.
34 changes: 17 additions & 17 deletions packages/pinorama-docs/.vitepress/config/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ export const en = defineConfig({
},
{
text: "Quick Start",
link: "/guide/quick-start/"
link: "/guide/quick-start"
},
{
text: "Use Cases",
link: "/guide/use-cases/"
link: "/guide/use-cases"
}
]
},
Expand All @@ -69,19 +69,19 @@ export const en = defineConfig({
items: [
{
text: "Overview",
link: "/guide/pinorama-studio/"
link: "/pinorama-studio"
},
{
text: "Installation",
link: "/guide/pinorama-studio/installation/"
link: "/pinorama-studio/installation"
},
{
text: "Usage",
link: "/guide/pinorama-studio/usage/"
link: "/pinorama-studio/usage"
},
{
text: "CLI",
link: "/guide/pinorama-studio/api/"
link: "/pinorama-studio/api"
}
]
},
Expand All @@ -90,19 +90,19 @@ export const en = defineConfig({
items: [
{
text: "Overview",
link: "/guide/pinorama-client/"
link: "/pinorama-client"
},
{
text: "Installation",
link: "/guide/pinorama-client/installation/"
link: "/pinorama-client/installation"
},
{
text: "Usage",
link: "/guide/pinorama-client/usage/"
link: "/pinorama-client/usage"
},
{
text: "API Reference",
link: "/guide/pinorama-client/api/"
link: "/pinorama-client/api"
}
]
},
Expand All @@ -111,19 +111,19 @@ export const en = defineConfig({
items: [
{
text: "Overview",
link: "/guide/pinorama-server/"
link: "/pinorama-server"
},
{
text: "Installation",
link: "/guide/pinorama-server/installation/"
link: "/pinorama-server/installation"
},
{
text: "Configuration",
link: "/guide/pinorama-server/configuration/"
link: "/pinorama-server/configuration"
},
{
text: "API Reference",
link: "/guide/pinorama-server/api/"
link: "/pinorama-server/api"
}
]
},
Expand All @@ -132,15 +132,15 @@ export const en = defineConfig({
items: [
{
text: "Overview",
link: "/guide/pinorama-transport/"
link: "/pinorama-transport"
},
{
text: "Installation",
link: "/guide/pinorama-transport/installation/"
link: "/pinorama-transport/installation"
},
{
text: "Usage",
link: "/guide/pinorama-transport/usage/"
link: "/pinorama-transport/usage"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/pinorama-docs/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ outline: deep
::: tip
**Need a Quick Start?** 🚀

If you're looking to get started quickly, check out [Pinorama Studio](/studio/), a Web App and CLI that allows you to store, view, filter, and analyze logs with minimal setup.
If you're looking to get started quickly, check out [Pinorama Studio Quickstart](/guide/quick-start/), a Web App and CLI that allows you to store, view, filter, and analyze logs with minimal setup.
:::

## Understanding the suite
Expand Down
89 changes: 89 additions & 0 deletions packages/pinorama-docs/guide/quick-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
outline: deep
---

# Quick Start

Get up and running with **Pinorama Studio** in minutes! This guide will walk you through the process of installing Pinorama Studio and integrating it with a simple Node.js application.

## Prerequisites

- [Node.js](https://nodejs.org/) version 20 or higher.
- Terminal for starting the Pinorama Studio CLI.

## Installation

Install Pinorama Studio globally:

::: code-group

```sh [npm]
npm i -g pinorama-studio
```

```sh [pnpm]
pnpm i -g pinorama-studio
```

```sh [yarn]
yarn global add pinorama-studio
```

:::

## Quick Setup

Let's set up a minimal Fastify application with Pinorama Studio for log viewing:

1. Create a new directory:

```sh
mkdir pinorama-demo && cd pinorama-demo
```

2. Install Fastify:

::: code-group

```sh [npm]
npm add fastify
```

```sh [pnpm]
pnpm add fastify
```

```sh [yarn]
yarn add fastify
```

:::

3. Create an `index.js` file with the following content:

```javascript
const fastify = require("fastify")({
logger: true, // needed for piping logs to Pinorama!
});

fastify.get("/", async (request, reply) => {
request.log.info("Pinorama is awesome! 🚀");
return { hello: "world" };
});

fastify.listen({ port: 3000 });
```

4. Run your application and pipe the output to Pinorama Studio:

```sh
node index.js | pinorama --open
```

This command will start your Fastify application, pipe its logs to Pinorama Studio, and open the Pinorama web interface in your default browser.

## Next Steps

Check out the full Pinorama documentation for information on customizing your logging setup and using other Pinorama components.

Happy logging with Pinorama!

0 comments on commit b6cd3a5

Please sign in to comment.