File size: 1,701 Bytes
336b102
 
 
 
 
 
 
 
 
 
 
 
 
 
5060d71
336b102
5060d71
c85bc2e
5060d71
c85bc2e
 
5060d71
c85bc2e
5060d71
c85bc2e
 
 
 
 
 
5060d71
c85bc2e
5060d71
c85bc2e
 
5060d71
c85bc2e
5060d71
c85bc2e
5060d71
c85bc2e
 
 
c6afb12
c85bc2e
c6afb12
c85bc2e
 
 
c6afb12
c85bc2e
c6afb12
c85bc2e
c6afb12
c85bc2e
 
bed709e
c85bc2e
 
5060d71
c85bc2e
 
5060d71
c85bc2e
5060d71
c85bc2e
 
 
5060d71
c85bc2e
5060d71
c85bc2e
 
5060d71
c85bc2e
5060d71
c85bc2e
 
 
5060d71
c85bc2e
5060d71
c85bc2e
 
 
5060d71
bed709e
 
 
 
 
 
c85bc2e
5060d71
c85bc2e
 
 
5060d71
c85bc2e
5060d71
c85bc2e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
---
title: HiveTrace Leaderboard
emoji: 🛡️
colorFrom: green
colorTo: indigo
sdk: docker
app_port: 5173
pinned: true
short_description: HiveTrace leaderboard frontend
tags:
  - leaderboard
  - sveltekit
  - docker
---

# HiveTrace Leaderboard frontend

## Overview

HiveTrace Leaderboard is a SvelteKit frontend for browsing guardrail benchmark results from
a private Hugging Face bucket.

The app uses:

- [SvelteKit](https://svelte.dev/)
- [pnpm](https://pnpm.io/) `11.9.0`
- [shadcn-svelte](https://www.shadcn-svelte.com/) and
  [shadcn-svelte-extras](https://www.shadcn-svelte-extras.com/)
- [Tailwind CSS](https://tailwindcss.com/)
- [Paraglide JS](https://inlang.com/m/gerre34r/library-inlang-paraglideJs) for localization

## Requirements

- Node.js `20.19.5` or newer
- pnpm `11.9.0`

## Setup

From the project root:

```bash
pnpm install
```

Create a local `.env` file from the example:

```bash
cp .env.example .env
```

Then configure a read token with access to the private Hugging Face bucket.

Required server-only environment variables:

```env
HF_TOKEN=hf_...
HF_BUCKET_ID=...
HF_BUCKET_PREFIX=latest
```

Do not rename `HF_TOKEN` to `PUBLIC_HF_TOKEN`. The token is used only on the SvelteKit server.
In production, pass it as a runtime secret, not as a Docker build argument.

## Development

```bash
pnpm dev
```

## Validation

Before pushing, format the code, run linting, run Svelte/TypeScript checks, and verify the
production build.

Format:

```bash
pnpm format
```

Lint:

```bash
pnpm lint
```

Check Tailwind utility classes:

```bash
pnpm tailwind:check
```

Check SvelteKit, TypeScript, and Svelte components:

```bash
pnpm check
```

Build:

```bash
pnpm build
```