Rewrite backend in Go with JSON API and JS frontend
Reimplements the Flask app as a Go HTTP API (chi + modernc sqlite) with a minimal vanilla-JS frontend in web/. Endpoints mirror the original Flask routes but return JSON instead of HTML. - auth: login/logout/register/sessioninfo/headerbar with crypto/rand tokens - entry: paginated feed (single JOIN), create with image scaling - user: profile, userinfo; delete still a stub - requireAuth middleware passes uid via context - notes/api.md documents the API and schema Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
:root {
|
||||
--bg: #15171a;
|
||||
--card: #1e2126;
|
||||
--fg: #e8e8e8;
|
||||
--muted: #9aa0a6;
|
||||
--accent: #4a9eff;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: system-ui, sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 1rem 1.5rem;
|
||||
border-bottom: 1px solid #2a2e35;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
header h1 { margin: 0; font-size: 1.4rem; }
|
||||
|
||||
main {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
section { margin-bottom: 1.5rem; }
|
||||
|
||||
input, textarea, button {
|
||||
font: inherit;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #2a2e35;
|
||||
background: var(--card);
|
||||
color: var(--fg);
|
||||
padding: 0.6rem 0.8rem;
|
||||
}
|
||||
|
||||
input, textarea { width: 100%; margin-bottom: 0.6rem; }
|
||||
textarea { min-height: 80px; resize: vertical; }
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
color: #fff;
|
||||
width: auto;
|
||||
}
|
||||
button:hover { opacity: 0.9; }
|
||||
|
||||
.entry {
|
||||
background: var(--card);
|
||||
border: 1px solid #2a2e35;
|
||||
border-radius: 8px;
|
||||
padding: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.entry .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
|
||||
.entry .content { white-space: pre-wrap; word-wrap: break-word; }
|
||||
.entry img { max-width: 100%; border-radius: 6px; margin-top: 0.6rem; }
|
||||
|
||||
.entry a { color: var(--accent); }
|
||||
|
||||
.msg { color: #ff6b6b; font-size: 0.9rem; min-height: 1.2em; }
|
||||
.end { text-align: center; color: var(--muted); padding: 2rem 0; }
|
||||
Reference in New Issue
Block a user