feat: Sprint 0 — GoFiber + HTMX + TailwindCSS v4 scaffolding

- Go module: git.tukangketik.id/swanadiva/hostkeeper/v2
- GoFiber v2 server with static, template engine, middleware
- HTMX + Alpine.js (downloaded from CDN)
- TailwindCSS v4 with custom theme (Lumina System colors)
- Custom CSS: dot-grid, glassmorphism, animations, toggle, modal
- Layout template (sidebar nav + header + main)
- Dashboard page with host list, search, filter, view toggle
- Health endpoint: GET /api/health
This commit is contained in:
swanadiva
2026-07-07 12:18:39 +07:00
parent a0c8483c0e
commit 43a19b723a
16 changed files with 1369 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
{{template "layout" .}}
{{define "content"}}
<div id="dashboard-page" class="max-w-7xl mx-auto">
<div class="grid grid-cols-3 gap-4 mb-6">
<div class="rounded-xl bg-white border border-outline-variant/30 p-4">
<div class="flex items-center gap-2 text-primary mb-1">
<span class="w-5 h-5 bg-primary/20 rounded flex items-center justify-center text-xs font-bold"></span>
<span class="text-xs font-medium text-on-surface-variant uppercase tracking-wide">Active Connections</span>
</div>
<span class="text-2xl font-bold text-on-surface">0</span>
</div>
<div class="rounded-xl bg-white border border-outline-variant/30 p-4">
<div class="flex items-center gap-2 text-secondary mb-1">
<span class="w-5 h-5 bg-secondary/20 rounded flex items-center justify-center text-xs font-bold"></span>
<span class="text-xs font-medium text-on-surface-variant uppercase tracking-wide">Transfers Today</span>
</div>
<span class="text-2xl font-bold text-on-surface">0</span>
</div>
<div class="rounded-xl bg-white border border-outline-variant/30 p-4">
<div class="flex items-center gap-2 text-tertiary mb-1">
<span class="w-5 h-5 bg-tertiary/20 rounded flex items-center justify-center text-xs font-bold">#</span>
<span class="text-xs font-medium text-on-surface-variant uppercase tracking-wide">Saved Hosts</span>
</div>
<span class="text-2xl font-bold text-on-surface">0</span>
</div>
</div>
<div class="flex items-center gap-3 mb-6" x-data="{ view: 'grid' }">
<div class="relative flex-1 max-w-md">
<input type="search" name="q" placeholder="Search hosts..."
hx-get="/hosts?q=..." hx-trigger="keyup delay:200ms"
hx-target="#host-list"
class="w-full pl-9 pr-3 py-2 rounded-lg border border-outline-variant/50
bg-white text-sm text-on-surface placeholder-on-surface-variant
focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary/50">
</div>
<select name="filter"
hx-get="/hosts?filter={value}" hx-target="#host-list"
class="px-3 py-2 rounded-lg border border-outline-variant/50 bg-white text-sm text-on-surface
focus:outline-none focus:ring-2 focus:ring-primary/30">
<option value="all">All</option>
<option value="active">Active</option>
<option value="offline">Offline</option>
</select>
<div class="flex items-center bg-white rounded-lg border border-outline-variant/50 p-0.5">
<button @click="view = 'grid'"
:class="view === 'grid' ? 'bg-primary/10 text-primary' : 'text-on-surface-variant hover:text-on-surface'"
class="p-1.5 rounded transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1V5zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"/></svg>
</button>
<button @click="view = 'list'"
:class="view === 'list' ? 'bg-primary/10 text-primary' : 'text-on-surface-variant hover:text-on-surface'"
class="p-1.5 rounded transition-colors">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16"/></svg>
</button>
</div>
</div>
<div id="host-list" class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4">
<div class="rounded-xl border-2 border-dashed border-outline-variant/30 p-8 flex flex-col items-center justify-center text-on-surface-variant/50 hover:border-primary/30 hover:text-primary/50 transition-colors cursor-pointer"
@click="console.log('add host')">
<svg class="w-8 h-8 mb-2" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/></svg>
<span class="text-sm font-medium">Add New Host</span>
</div>
</div>
</div>
{{end}}