Add auth, rest api, svelte frontend, build structure

This commit is contained in:
2025-06-02 08:44:10 +02:00
parent 97be451306
commit 17ab7c4929
222 changed files with 3057 additions and 136 deletions

3
web/templates/admin.html Normal file
View File

@@ -0,0 +1,3 @@
{{define "vite"}} {{ .Vite.Tags }} {{end}} {{define "content"}}
<div id="root"></div>
{{end}}

View File

@@ -3,6 +3,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
{{block "vite" .}} {{end}}
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
@@ -17,7 +18,7 @@
<link href="/static/css/app.css" rel="stylesheet" />
{{block "stylesheets" .}} {{end}}
</head>
<body>
<body class="site">
<nav
id="navbar-main"
class="navbar navbar-expand-lg fixed-top navbar-light bg-white"
@@ -47,7 +48,7 @@
{{block "header" .}} {{end}}
<main>
<div class="container">{{block "content" .}} {{end}}</div>
<div class="container site-content">{{block "content" .}} {{end}}</div>
</main>
{{block "footer" .}}

51
web/templates/login.html Normal file
View File

@@ -0,0 +1,51 @@
{{define "navigation"}} {{end}} {{define "content"}}
<section class="content-section">
<div class="container">
<div class="row">
<div class="col-4 mx-auto">
{{if .MsgType}}
<div class="alert {{.MsgType}}" role="alert">{{.Message}}</div>
{{end}}
<div class="card">
<div class="card-header">
<h3>Login</h3>
</div>
<div class="card-body">
<form action="/login" method="post">
<div class="mb-3">
<label class="form-label" for="username">Username</label>
<input
class="form-control"
type="text"
id="username"
name="username"
required
autofocus
/>
</div>
<div class="mb-3">
<label class="form-label" for="password">Password</label>
<input
class="form-control"
type="password"
id="password"
name="password"
required
/>
</div>
<button type="submit" class="btn btn-success">Submit</button>
<input
type="hidden"
id="redirect"
name="redirect"
value="{{ .Redirect }}"
/>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
{{end}}