Skip to content

Commit 3fc0230

Browse files
authored
Update template03 (#53)
* update template * update readme
1 parent 882a5a1 commit 3fc0230

File tree

2 files changed

+25
-67
lines changed

2 files changed

+25
-67
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@ Tech Stack:
2222

2323
Deploy the Tinybird and Next.js to the cloud to get started quickly.
2424

25-
<p align="left">
26-
<a href="https://app.tinybird.co?starter_kit=https://github.com/tinybirdco/logs-explorer-template/tinybird">
27-
<img width="200" src="https://img.shields.io/badge/Deploy%20to-Tinybird-25283d?style=flat&labelColor=25283d&color=27f795&logo=data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNTAwIDUwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNTAwIDQyLjhsLTE1Ni4xLTQyLjgtNTQuOSAxMjIuN3pNMzUwLjcgMzQ1LjRsLTE0Mi45LTUxLjEtODMuOSAyMDUuN3oiIGZpbGw9IiNmZmYiIG9wYWNpdHk9Ii42Ii8+PHBhdGggZD0iTTAgMjE5LjlsMzUwLjcgMTI1LjUgNTcuNS0yNjguMnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=" />
28-
</a>
29-
</p>
25+
```bash
26+
# select or create a new workspace
27+
tb login
28+
29+
# deploy the template
30+
tb --cloud deploy https://github.com/tinybirdco/logs-explorer-template/tree/main/tinybird
31+
32+
# copy the dashboard token
33+
tb --cloud token copy read_pipes
34+
```
3035

3136
[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Ftinybirdco%2Flogs-explorer-template&project-name=tinybird-logs-explorer-template&repository-name=tinybird-logs-explorer-template&demo-description=Custom%20logs%20explorer%20for%20your%20application%20logs%20using%20Tinybird&demo-url=http%3A%2F%2Flogs.tinybird.app&demo-image=//github.com/tinybirdco/logs-explorer-template/blob/main/dashboard/log-analyzer/public/banner.png?raw=true&root-directory=dashboard/log-analyzer)
3237

TEMPLATE.md

Lines changed: 15 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,31 @@ This is a template for a Logs Explorer web application. It is built with Next.js
22

33
Use this template to bootstrap a multi-tenant, user-facing logs explorer for any software project. Fork it and make it your own!
44

5-
## Quick Start
5+
## Set up the project
66

7-
Deploy the project to [Tinybird](https://app.tinybird.co?starter_kit=https://github.com/tinybirdco/logs-explorer-template/tinybird) and [Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Ftinybirdco%2Flogs-explorer-template&project-name=tinybird-logs-explorer-template&repository-name=tinybird-logs-explorer-template&demo-description=Custom%20logs%20explorer%20for%20your%20application%20logs%20using%20Tinybird&demo-url=http%3A%2F%2Flogs.tinybird.app&demo-image=//github.com/tinybirdco/logs-explorer-template/blob/main/dashboard/log-analyzer/public/banner.png?raw=true&root-directory=dashboard/log-analyzer) to get started quickly.
7+
Fork the GitHub repository and deploy the data project to Tinybird.
88

9-
Configure your Tinybird environment variables in Vercel:
10-
11-
```sh
12-
NEXT_PUBLIC_TINYBIRD_API_KEY=<YOUR_TINYBIRD_ADMIN_TOKEN>
13-
NEXT_PUBLIC_TINYBIRD_API_URL=<YOUR_TINYBIRD_HOST_REGION>
14-
```
15-
16-
Append the `tinybird/fixtures/logs.ndjson` file to the `logs` Data Source or stream some mock data.
17-
18-
## Local Development
19-
20-
Get started by forking the [GitHub repository](https://github.com/tinybirdco/logs-explorer-template) and then customizing it to your needs.
21-
22-
Start Tinybird locally:
23-
24-
```sh
25-
curl -LsSf https://tbrd.co/fwd | sh
26-
cd tinybird
27-
tb local start
9+
```bash
10+
# select or create a new workspace
2811
tb login
29-
tb dev
30-
token ls # copy an admin token
31-
```
32-
33-
Configure the Next.js application:
34-
35-
```sh
36-
cd dashboard/log-analyzer
37-
cp .env.example .env
38-
```
3912

40-
Edit the `.env` file with your Tinybird API key and other configuration.
13+
# deploy the template
14+
tb --cloud deploy https://github.com/tinybirdco/logs-explorer-template/tree/main/tinybird
4115

42-
```sh
43-
NEXT_PUBLIC_TINYBIRD_API_KEY=<YOUR_TINYBIRD_ADMIN_TOKEN>
44-
NEXT_PUBLIC_TINYBIRD_API_URL=http://localhost:7181
16+
# copy the dashboard token
17+
tb --cloud token copy read_pipes
4518
```
4619

47-
Start the Next.js application:
48-
49-
```sh
50-
cd dashboard/log-analyzer
51-
npm install
52-
npm run dev
53-
```
20+
Deploy the [dashboard to Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Ftinybirdco%2Flogs-explorer-template&project-name=tinybird-logs-explorer-template&repository-name=tinybird-logs-explorer-template&demo-description=Custom%20logs%20explorer%20for%20your%20application%20logs%20using%20Tinybird&demo-url=http%3A%2F%2Flogs.tinybird.app&demo-image=//github.com/tinybirdco/logs-explorer-template/blob/main/dashboard/log-analyzer/public/banner.png?raw=true&root-directory=dashboard/log-analyzer)
5421

55-
Open the application in your browser:
22+
Configure your Tinybird environment variables in Vercel:
5623

5724
```sh
58-
http://localhost:3000
25+
NEXT_PUBLIC_TINYBIRD_API_KEY=<YOUR_TINYBIRD_READ_PIPES_TOKEN>
26+
NEXT_PUBLIC_TINYBIRD_API_URL=<YOUR_TINYBIRD_HOST_REGION>
5927
```
6028

61-
Read the [dashboard/log-analyzer/README.md](https://github.com/tinybirdco/logs-explorer-template/blob/main/dashboard/log-analyzer/README.md) file for more information on how to use the application and [tinybird/README.md](https://github.com/tinybirdco/logs-explorer-template/blob/main/tinybird/README.md) for more information on how to customize the template.
62-
63-
## Instrumenting your application
29+
## Instrument your application
6430

6531
To instrument your application, just send JSON objects to the Tinybird [Events API](https://www.tinybird.co/docs/get-data-in/ingest-apis/events-api).
6632

@@ -101,19 +67,6 @@ You can use Vector to collect logs from different sources and send them to a Tin
10167

10268
Check the [examples/vector](https://github.com/tinybirdco/logs-explorer-template/tree/main/examples/vector) folder for an example of how to do this with Vector.
10369

104-
## Deployment
105-
106-
Deploy the Tinybird project to the cloud:
107-
108-
```sh
109-
cd tinybird
110-
tb --cloud deploy
111-
```
112-
113-
Once deployed copy your Tinybird cloud host and `read_pipes` token, [deploy the Next.js application to Vercel](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Ftinybirdco%2Flogs-explorer-template&project-name=tinybird-logs-explorer-template&repository-name=tinybird-logs-explorer-template&demo-description=Custom%20logs%20explorer%20for%20your%20application%20logs%20using%20Tinybird&demo-url=http%3A%2F%2Flogs.tinybird.app&demo-image=//github.com/tinybirdco/logs-explorer-template/blob/main/dashboard/log-analyzer/public/banner.png?raw=true&root-directory=dashboard/log-analyzer) and configure the environment variables.
114-
115-
## Customizing the template
116-
117-
You can use the template as a starting point to build your own logs explorer application or embed components in your own application.
70+
## Local Development, multi-tenancy and more
11871

119-
See how it's done in the [Vercel Log Drains template](https://github.com/alrocar/vercel-logs-explorer-template) and the [Auth0 Log Streams template](https://github.com/tinybirdco/auth0-logs-explorer-template).
72+
See the GitHub repository [README.md](https://github.com/tinybirdco/logs-explorer-template)

0 commit comments

Comments
 (0)