Detect duplicate GitHub issues, areas of concern and more across related repositories.
Detect duplicate GitHub issues, areas of concern and more across related repositories
You can try the app out locally (for tweaking the UI) using the deployed API.
corepack enable
pnpm i
pnpm dev --ui-only
This will fire up a dev server but use the remote API to populate it.
Setting up a full development environment takes a little extra effort because unsight.dev is implemented as a GitHub App. Hereâs how to set things up.
corepack enable
pnpm i
npx ngrok http 3000
Note the URL under Forwarding. It should look something like https://<GUID>.ngrok-free.app/. Weâll use this in the next step.
Navigate to the GitHub Apps Settings panel and click âNew GitHub Appâ.
Fill out the form, not changing any defaults:
[dev] at the end of any apps Iâm using in development only.https://unsight.dev would be fine.http://localhost:3000. Tick the âRedirect on updateâ checkbox underneath./github/webhook: https://<GUID>.ngrok-free.app/github/webhook. For the âSecretâ field underneath the URL, create a random GUID or password and make a note of it.Note down the App ID: in your GitHub App settings.
Note the âslugâ of your GitHub App. You should be at a URL that looks something like this https://github.com/settings/apps/unsight-dev. This last piece (unsight-dev) is your app slug.
Scroll down to the bottom of the GitHub App setings and click âGenerate a private keyâ. It should download. Unfortunately this private key is in PKCS#1 format, but we need PKCS#8 in a Cloudflare environment. Run the following command:
openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in <path to the downloaded file>.pem -out <path to your repo>-unsight-pkcs8.key
(This outputs a private key file youâll use in the next step.)
Create a packages/web/.env file with the following content (the private key was generated in the last step and can be multi-line, just add a quote before and after it):
NUXT_WEBHOOK_GITHUB_SECRET_KEY=<random GUID or password you put in the Webhook Secret field when creating your GitHub App>
NUXT_PUBLIC_GITHUB_APP_SLUG=<your app slug you saw in the URL of your GitHub App settings>
NUXT_GITHUB_APP_ID=<GitHub App ID you saw in your GitHub App settings>
NUXT_GITHUB_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
MIIEvcIBADAEBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoABADDbja1oaWVufjdT
...
+qWpvAnlgrGQqvbsuY+XuRnt
-----END PRIVATE KEY-----"
We use Workers AI and to do that locally weâll need to hook up to Cloudflare. This project uses NuxtHub to do that. You can get going by creating a free NuxtHub account at https://admin.hub.nuxt.com.
Then run this command in your app directory:
cd packages/web/
npx nuxthub link
You can select âCreate a new projectâ. Any storage region should be fine. Your Nuxt dev server should restart, and youâll see a new NUXT_HUB_PROJECT_KEY variable in your packages/web/.env file.
You can now visit http://localhost:3000 and click âInstall as a GitHub appâ.
You can now directly visit http://localhost:3000/<your-user-name>/<your-repo> to view your clusters.
By default, in local development, weâll also index nuxt/nuxt and nitrojs/nitro so you donât have to register the GitHub app on any repository in order to see and play around with the cluster algorithm.
If you want to customise this, you can configure the DEV_REPOS_TO_INDEX environment variable.
# disable the feature entirely
DEV_REPOS_TO_INDEX=false
# specify a comma-separated list of repositories
DEV_REPOS_TO_INDEX=unjs/h3,vuejs/core
These repositories will automatically be indexed when you start your dev server.
[!IMPORTANT]
This only has an effect in development mode.
â¤ď¸ Thanks to Alvaro Saburido for the lovely logo!
Made with â¤ď¸
Published under MIT License.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.