Openstatus www.openstatus.dev

🔥 improve dx (#1170)

authored by

Thibault Le Ouay and committed by
GitHub
0e97a434 2cea5960

+57 -55
+22 -23
README.md
··· 88 88 89 89 - [Node.js](https://nodejs.org/en/) >= 20.0.0 90 90 - [pnpm](https://pnpm.io/) >= 8.6.2 91 + - [Bun](https://bun.sh/) 92 + - [Turso CLI](https://docs.turso.tech/quickstart) 91 93 92 94 ### Setup 93 95 94 96 1. Clone the repository 95 97 96 - ```sh 97 - git clone https://github.com/openstatushq/openstatus.git 98 - ``` 98 + ```sh 99 + git clone https://github.com/openstatushq/openstatus.git 100 + ``` 99 101 100 102 2. Install dependencies 101 103 102 - ```sh 103 - pnpm install 104 - ``` 104 + ```sh 105 + pnpm install 106 + ``` 105 107 106 - 3. Set up your .env file 108 + 3. Initialize the development environment 107 109 108 - From `apps/web` and `packages/db`, you will find .env.example. Create your 109 - own copy. 110 + Launch the database in one terminal: 110 111 111 - 4. Follow the steps to run your sqlite database locally inside of 112 - [README.md](https://github.com/openstatusHQ/openstatus/blob/main/packages/db/README.md) 112 + ```sh 113 + turso dev --db-file openstatus-dev.db 114 + ``` 113 115 114 - 5. Start the development with the below command 116 + In another terminal, run the following command: 115 117 116 - ```sh 117 - pnpm dev 118 - ``` 118 + ```sh 119 + pnpm dx 120 + ``` 119 121 120 - It will: 122 + 4. Launch the web app 121 123 122 - - run the web app on port `3000` 123 - - run the api server on port `3001` 124 - - run the docs on port `3002` 124 + ```sh 125 + pnpm dev:web 126 + ``` 125 127 126 - 6. See the results: 128 + 5. See the results: 127 129 128 130 - open [http://localhost:3000](http://localhost:3000) for the web app 129 - - open [http://localhost:3001/ping](http://localhost:3001/ping) for the api 130 - server health check 131 - - open [http://localhost:3002](http://localhost:3002) for the docs 132 131 133 132 ### Videos 134 133
+25 -27
apps/docs/src/content/docs/contributing/getting-started.mdx
··· 2 2 title: Getting Started 3 3 --- 4 4 5 - import { Aside } from "@astrojs/starlight/components"; 6 - 7 - <Aside>WIP</Aside> 8 5 9 6 ## Setup 10 7 11 - 1. Clone the repository and open the created directory 8 + 1. Clone the repository 12 9 13 - ```sh 14 - git clone https://github.com/openstatushq/openstatus.git 15 - cd openstatus 16 - ``` 10 + ```sh 11 + git clone https://github.com/openstatushq/openstatus.git 12 + ``` 17 13 18 14 2. Install dependencies 19 15 20 - ```sh 21 - pnpm install 22 - ``` 16 + ```sh 17 + pnpm install 18 + ``` 23 19 24 - 3. Database setup 25 - 26 - We are using Turso for the database to make it work locally you need to install 27 - it and run it. 28 - 29 - If you are on a mac install it with [Homebrew](https://brew.sh/) 30 - 20 + 3. Initialize the development environment 31 21 32 - Here is the official Turso 33 - [installation guide](https://docs.turso.tech/reference/turso-cli) 22 + Launch the database in one terminal: 34 23 35 - 4. Install Bun 36 - All the up to date information are on the official [Bun website](https://bun.sh/) 24 + ```sh 25 + turso dev --db-file openstatus-dev.db 26 + ``` 37 27 38 - 4. Set up the dev environment 28 + In another terminal, run the following command: 39 29 40 30 ```sh 41 - pnpm dx 31 + pnpm dx 42 32 ``` 43 - 5. Start the development server 33 + 34 + 4. Launch the web app 44 35 45 36 ```sh 46 - pnpm dev:web 37 + pnpm dev:web 47 38 ``` 48 39 49 - 6. Open your browser and navigate to [http://localhost:3000](http://localhost:3000) 40 + It will: 41 + 42 + - run the web app on port `3000` 43 + 44 + 5. See the results: 45 + 46 + - open [http://localhost:3000](http://localhost:3000) for the web app 47 +
+5
apps/docs/src/content/docs/contributing/requirements.mdx
··· 73 73 74 74 If you want to run Turso locally you can follow the instructions in the 75 75 [Turso CLI](https://docs.turso.tech/reference/turso-cli) 76 + 77 + 78 + ### Installing Bun 79 + 80 + To install Bun, visit the official website [https://bun.sh/](https://bun.sh/)
+5 -5
packages/tinybird/src/client.ts
··· 9 9 private readonly tb: Client; 10 10 11 11 constructor(token: string) { 12 - // if (process.env.NODE_ENV === "development") { 13 - // this.tb = new NoopTinybird(); 14 - // } else { 15 - this.tb = new Client({ token }); 16 - // } 12 + if (process.env.NODE_ENV === "development") { 13 + this.tb = new NoopTinybird(); 14 + } else { 15 + this.tb = new Client({ token }); 16 + } 17 17 } 18 18 19 19 public get homeStats() {