Skip to content

Commit ef17abb

Browse files
committed
feat: add devbox for dependency management and environment setup
1 parent 2bad49a commit ef17abb

13 files changed

+1225
-12
lines changed

Taskfile.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://taskfile.dev
2+
3+
version: '3'
4+
5+
vars:
6+
GREETING: Hello, World!
7+
8+
tasks:
9+
templ-gen:
10+
cmds:
11+
- templ generate
12+
silent: true

devbox.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.7/.schema/devbox.schema.json",
3+
"packages": [
4+
"templ@latest",
5+
"pnpm@latest",
6+
"go@latest"
7+
],
8+
"shell": {
9+
"init_hook": [
10+
"echo 'Welcome to devbox!' > /dev/null"
11+
],
12+
"scripts": {
13+
"test": [
14+
"echo \"Error: no test specified\" && exit 1"
15+
]
16+
}
17+
}
18+
}

devbox.lock

Lines changed: 108 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,147 @@
11
{
22
"lockfile_version": "1",
33
"packages": {
4-
"bun@latest": {
5-
"last_modified": "2024-07-11T00:17:14Z",
6-
"resolved": "github:NixOS/nixpkgs/212defe037698e18fc9521dfe451779a8979844c#bun",
4+
"go@latest": {
5+
"last_modified": "2024-12-23T21:10:33Z",
6+
"resolved": "github:NixOS/nixpkgs/de1864217bfa9b5845f465e771e0ecb48b30e02d#go",
77
"source": "devbox-search",
8-
"version": "1.1.18",
8+
"version": "1.23.4",
99
"systems": {
1010
"aarch64-darwin": {
1111
"outputs": [
1212
{
1313
"name": "out",
14-
"path": "/nix/store/2alxy6rkmynwbaxifj2qfxz5gsldq92h-bun-1.1.18",
14+
"path": "/nix/store/bva4mymi5b2lhvvbccx8ipws89rar1d8-go-1.23.4",
1515
"default": true
1616
}
1717
],
18-
"store_path": "/nix/store/2alxy6rkmynwbaxifj2qfxz5gsldq92h-bun-1.1.18"
18+
"store_path": "/nix/store/bva4mymi5b2lhvvbccx8ipws89rar1d8-go-1.23.4"
1919
},
2020
"aarch64-linux": {
2121
"outputs": [
2222
{
2323
"name": "out",
24-
"path": "/nix/store/xia96m3f8rylfwx9ng5ksj0p8qr7pp1d-bun-1.1.18",
24+
"path": "/nix/store/9lvi0l2yf6bwamsjs5d5n9i57c6kbd2c-go-1.23.4",
2525
"default": true
2626
}
2727
],
28-
"store_path": "/nix/store/xia96m3f8rylfwx9ng5ksj0p8qr7pp1d-bun-1.1.18"
28+
"store_path": "/nix/store/9lvi0l2yf6bwamsjs5d5n9i57c6kbd2c-go-1.23.4"
2929
},
3030
"x86_64-darwin": {
3131
"outputs": [
3232
{
3333
"name": "out",
34-
"path": "/nix/store/48727mm1s315346nb5f7hnm12fskw8g3-bun-1.1.18",
34+
"path": "/nix/store/sf1y7x29wvp9lppx5ya9h5b42fcmxb32-go-1.23.4",
3535
"default": true
3636
}
3737
],
38-
"store_path": "/nix/store/48727mm1s315346nb5f7hnm12fskw8g3-bun-1.1.18"
38+
"store_path": "/nix/store/sf1y7x29wvp9lppx5ya9h5b42fcmxb32-go-1.23.4"
3939
},
4040
"x86_64-linux": {
4141
"outputs": [
4242
{
4343
"name": "out",
44-
"path": "/nix/store/mm77l2fg0lj5zx3i8lsms9lgdbgg7gm2-bun-1.1.18",
44+
"path": "/nix/store/jfv85qbj4vb1dafcg6kncg4vrbq2bbxv-go-1.23.4",
4545
"default": true
4646
}
4747
],
48-
"store_path": "/nix/store/mm77l2fg0lj5zx3i8lsms9lgdbgg7gm2-bun-1.1.18"
48+
"store_path": "/nix/store/jfv85qbj4vb1dafcg6kncg4vrbq2bbxv-go-1.23.4"
49+
}
50+
}
51+
},
52+
"pnpm@latest": {
53+
"last_modified": "2024-12-30T19:01:31Z",
54+
"resolved": "github:NixOS/nixpkgs/6d96c9a21e56eefbf7d6e9890fa2905daad5c1be#pnpm",
55+
"source": "devbox-search",
56+
"version": "9.15.2",
57+
"systems": {
58+
"aarch64-darwin": {
59+
"outputs": [
60+
{
61+
"name": "out",
62+
"path": "/nix/store/1zf44gijyhydwf3h5bb73ksma9kbra17-pnpm-9.15.2",
63+
"default": true
64+
}
65+
],
66+
"store_path": "/nix/store/1zf44gijyhydwf3h5bb73ksma9kbra17-pnpm-9.15.2"
67+
},
68+
"aarch64-linux": {
69+
"outputs": [
70+
{
71+
"name": "out",
72+
"path": "/nix/store/f67sv0mxhj68f82x3xq0sqhqvgvcgpzi-pnpm-9.15.2",
73+
"default": true
74+
}
75+
],
76+
"store_path": "/nix/store/f67sv0mxhj68f82x3xq0sqhqvgvcgpzi-pnpm-9.15.2"
77+
},
78+
"x86_64-darwin": {
79+
"outputs": [
80+
{
81+
"name": "out",
82+
"path": "/nix/store/yn15jif4fxf412ivqb1v7vs608h4ajzr-pnpm-9.15.2",
83+
"default": true
84+
}
85+
],
86+
"store_path": "/nix/store/yn15jif4fxf412ivqb1v7vs608h4ajzr-pnpm-9.15.2"
87+
},
88+
"x86_64-linux": {
89+
"outputs": [
90+
{
91+
"name": "out",
92+
"path": "/nix/store/8hd8pqjprqniahibmn6mrczfhb9b25ij-pnpm-9.15.2",
93+
"default": true
94+
}
95+
],
96+
"store_path": "/nix/store/8hd8pqjprqniahibmn6mrczfhb9b25ij-pnpm-9.15.2"
97+
}
98+
}
99+
},
100+
"templ@latest": {
101+
"last_modified": "2025-01-03T14:51:55Z",
102+
"resolved": "github:NixOS/nixpkgs/a27871180d30ebee8aa6b11bf7fef8a52f024733#templ",
103+
"source": "devbox-search",
104+
"version": "0.3.819",
105+
"systems": {
106+
"aarch64-darwin": {
107+
"outputs": [
108+
{
109+
"name": "out",
110+
"path": "/nix/store/hwkhhn6fx6spw1h7ghxd93sw83vikvnb-templ-0.3.819",
111+
"default": true
112+
}
113+
],
114+
"store_path": "/nix/store/hwkhhn6fx6spw1h7ghxd93sw83vikvnb-templ-0.3.819"
115+
},
116+
"aarch64-linux": {
117+
"outputs": [
118+
{
119+
"name": "out",
120+
"path": "/nix/store/mb0y37yzgw6l345ngf0rj20f1f1rna6b-templ-0.3.819",
121+
"default": true
122+
}
123+
],
124+
"store_path": "/nix/store/mb0y37yzgw6l345ngf0rj20f1f1rna6b-templ-0.3.819"
125+
},
126+
"x86_64-darwin": {
127+
"outputs": [
128+
{
129+
"name": "out",
130+
"path": "/nix/store/gnmnyd0mk6k19xmgb9lr38lsz3i4pgrj-templ-0.3.819",
131+
"default": true
132+
}
133+
],
134+
"store_path": "/nix/store/gnmnyd0mk6k19xmgb9lr38lsz3i4pgrj-templ-0.3.819"
135+
},
136+
"x86_64-linux": {
137+
"outputs": [
138+
{
139+
"name": "out",
140+
"path": "/nix/store/ch8xyh30919rv9l3h5w6kvdhq1hl1fr6-templ-0.3.819",
141+
"default": true
142+
}
143+
],
144+
"store_path": "/nix/store/ch8xyh30919rv9l3h5w6kvdhq1hl1fr6-templ-0.3.819"
49145
}
50146
}
51147
}

ui/card/card_account.templ

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package card
2+
3+
templ CardAccount(addr, name, handle, creationBlock string) {
4+
<div class="profile-card min-w-[320px]">
5+
<div class="text-white max-w-xs my-auto mx-auto bg-gradient-to-r from-cyan-600 to-cyan-300 p-4 py-5 px-5 rounded-xl">
6+
<div class="flex justify-between">
7+
<div>
8+
<h2>sonr-testnet-1</h2>
9+
<p class="text-2xl font-bold">{ handle }</p>
10+
</div>
11+
<div class="flex items-center opacity-60">
12+
<sl-icon style="font-size: 52px;" library="sonr" name="sonr-fill"></sl-icon>
13+
</div>
14+
</div>
15+
<div class="mt-5 flex justify-between items-center w-52">
16+
<span class="text-lg font-mono">{ shortenAddress(addr) }</span>
17+
</div>
18+
<div class="flex justify-between mt-5 w-48 ">
19+
<div>
20+
<h3 class="text-xs">Block Created </h3>
21+
<p class="font-bold"><span>#</span>{ creationBlock }</p>
22+
</div>
23+
<div>
24+
<h3 class="text-xs">Issued to</h3>
25+
<p class="font-bold">{ name }</p>
26+
</div>
27+
</div>
28+
</div>
29+
</div>
30+
}
31+
32+
// Helper function to shorten address
33+
func shortenAddress(address string) string {
34+
if len(address) <= 20 {
35+
return address
36+
}
37+
return address[:16] + "..." + address[len(address)-4:]
38+
}

ui/card/card_account_templ.go

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/input/input_handle.templ

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package input
2+
3+
type HandleState string
4+
5+
const (
6+
HandleStateInitial HandleState = "inital"
7+
HandleStateValid HandleState = "valid"
8+
HandleStateInvalid HandleState = "invalid"
9+
)
10+
11+
func (s HandleState) string() string {
12+
return string(s)
13+
}
14+
15+
templ HandleInitial() {
16+
<div hx-target="this" hx-swap="outerHTML">
17+
<sl-input name="handle" placeholder="digitalgold" type="text" label="Handle" minlength="4" maxlength="12" required hx-post="/register/profile" hx-indicator="#handle-indicator" autofocus>
18+
<div slot="prefix">
19+
<sl-icon name="at-sign" library="sonr"></sl-icon>
20+
</div>
21+
</sl-input>
22+
</div>
23+
<br/>
24+
}
25+
26+
templ HandleError(value string, helpText string) {
27+
<sl-input name="handle" placeholder="digitalgold" type="text" label="Handle" minlength="4" maxlength="12" required class="border-red-500" value={ value } help-text={ helpText }>
28+
<div slot="prefix">
29+
<sl-icon name="at-sign" library="sonr"></sl-icon>
30+
</div>
31+
<div slot="suffix" style="color: #B54549;">
32+
<sl-icon name="x"></sl-icon>
33+
</div>
34+
</sl-input>
35+
<br/>
36+
}
37+
38+
templ HandleSuccess(value string) {
39+
<sl-input name="handle" placeholder="digitalgold" type="text" label="Handle" minlength="4" maxlength="12" required class="border-green-500" value={ value } disabled>
40+
<div slot="prefix" style="color: #46A758;">
41+
<sl-icon name="at-sign" library="sonr"></sl-icon>
42+
</div>
43+
</sl-input>
44+
<br/>
45+
}

0 commit comments

Comments
 (0)