Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: typo

mxkaske 072acbc3 9b9a417d

+57 -11
+6 -3
README.md
··· 69 69 70 70 3. Set up your .env file 71 71 72 - from `apps/web` and `packages/db` you will find .env.example create your own 72 + from `apps/web` and `packages/db` you will find .env.example create your own. 73 + 74 + 4. Follow the steps to run your sqlite database locally inside of 75 + [README.md](https://github.com/openstatusHQ/openstatus/packages/db/README.md) 73 76 74 - 4. Start the development server 77 + 5. Start the development server 75 78 76 79 ```sh 77 80 pnpm dev 78 81 ``` 79 82 80 - 5. Open [http://localhost:3000](http://localhost:3000) with your browser to see 83 + 6. Open [http://localhost:3000](http://localhost:3000) with your browser to see 81 84 the result. 82 85 83 86 For [clerk](https://clerk.com), you will need to create a webhook endpoint. To
+3 -2
apps/web/.env.example
··· 23 23 # TINY BIRD for time series data (trackers) 24 24 TINY_BIRD_API_KEY=tiny-bird-api-key 25 25 26 - # PlanetScale ( or a local mysql database) 27 - DATABASE_URL='mysql://root:password@localhost:3306/openstatus' 26 + # TURSO SQLITE 27 + DATABASE_URL=http://127.0.0.1:8080 28 + DATABASE_AUTH_TOKEN=any-token 28 29 29 30 # Solves 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY', see https://github.com/nextauthjs/next-auth/issues/3580 30 31 # NODE_TLS_REJECT_UNAUTHORIZED="0"
+2 -1
packages/db/.env.example
··· 1 - DATABASE_URL="planetscale-url" 1 + DATABASE_URL=http://127.0.0.1:8080 2 + DATABASE_AUTH_TOKEN=any-token
+46 -5
packages/db/README.md
··· 1 1 # DB 2 2 3 - Our database package 3 + We are using [turso](https://turso.tech) and sqlite as database to store 4 + user/page/monitor settings. The timeseries data is stored in a 5 + [tinybird](https://tinybird.co) datasource (built on top of ClickHouse). 6 + 7 + ## Local Development 8 + 9 + Install the [Turso CLI](https://docs.turso.tech/reference/turso-cli). 10 + 11 + For local environment, first 12 + [install sqld](https://github.com/libsql/sqld/blob/main/docs/BUILD-RUN.md). 13 + 14 + When installing with Homebrew, follow: 15 + 16 + ```bash 17 + $ brew tap libsql/sqld 18 + $ brew install sqld-beta 19 + $ sqld --help 20 + ``` 21 + 22 + If you want to keep your database locally, run: 23 + 24 + ```bash 25 + $ turso dev --db-file openstatus.db 26 + ``` 27 + 28 + It will create a local database in the directory you run the command. 29 + 30 + Add the environment variables to inside of the `.env` file in both projects, the 31 + `/apps/web` and `/packages/db`: 32 + 33 + ```env 34 + DATABASE_URL=http://127.0.0.1:8080 35 + DATABASE_AUTH_TOKEN=any-token # no need to change token 36 + ``` 37 + 38 + Start the migration script inside of `/packages/db` to have the database schema 39 + up to date: 40 + 41 + ```bash 42 + $ pnpm migrate 43 + ``` 4 44 5 - ## Getting started 45 + You should be ready to go! Check out the Drizzle Studio to see if your tables 46 + have been created: 6 47 7 - 1. Create you mysql database or use planetscale 8 - 2. Update your .env file with DATABASE_URL="" 9 - 3. Run `pnpm push` to push the tables 48 + ```$ 49 + $ pnpm studio 50 + ```