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