feat: initialize warpbox.dev project structure and backend
Initialize the repository with the core Go backend architecture and a frontend mockup for warpbox.dev, a self-hosted file-sharing application. - Set up Go backend modules for configuration, HTTP server, middleware, handlers, and templates. - Add local development scripts, environment templates, and basic project configuration. - Include a React-based frontend mockup under the docs directory.
This commit is contained in:
43
backend/templates/layouts/base.gohtml
Normal file
43
backend/templates/layouts/base.gohtml
Normal file
@@ -0,0 +1,43 @@
|
||||
{{define "base"}}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{if .Title}}{{.Title}} - {{end}}{{.AppName}}</title>
|
||||
<meta name="description" content="{{.Description}}">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<meta property="og:site_name" content="{{.AppName}}">
|
||||
<meta property="og:title" content="{{if .Title}}{{.Title}}{{else}}{{.AppName}}{{end}}">
|
||||
<meta property="og:description" content="{{.Description}}">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="{{.BaseURL}}">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<link rel="stylesheet" href="/static/css/app.css">
|
||||
<script defer src="/static/js/app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#main">Skip to content</a>
|
||||
<header class="site-header">
|
||||
<nav class="nav" aria-label="Main navigation">
|
||||
<a class="brand" href="/" aria-label="{{.AppName}} home">
|
||||
<span class="brand-mark" aria-hidden="true">W</span>
|
||||
<span>{{.AppName}}</span>
|
||||
</a>
|
||||
<div class="nav-links">
|
||||
<a class="button button-ghost" href="/api/v1/health">API</a>
|
||||
<a class="button button-outline" href="/healthz">Health</a>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main id="main">
|
||||
{{template "content" .}}
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<span>© {{.CurrentYear}} {{.AppName}}</span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
46
backend/templates/pages/home.gohtml
Normal file
46
backend/templates/pages/home.gohtml
Normal file
@@ -0,0 +1,46 @@
|
||||
{{define "home.gohtml"}}{{template "base" .}}{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<section class="upload-view" aria-labelledby="upload-title">
|
||||
<form class="upload-panel" action="/api/v1/upload" method="post" enctype="multipart/form-data">
|
||||
<div class="panel-header">
|
||||
<h1 id="upload-title">Upload your files</h1>
|
||||
<p>Drag files here or choose them from your device.</p>
|
||||
</div>
|
||||
|
||||
<label class="drop-zone" for="file-input">
|
||||
<span class="drop-icon" aria-hidden="true">+</span>
|
||||
<span class="drop-title">Drop files to upload</span>
|
||||
<span class="drop-copy">Click to browse</span>
|
||||
<input id="file-input" name="file" type="file" multiple>
|
||||
</label>
|
||||
|
||||
<details class="advanced-options">
|
||||
<summary>Advanced options</summary>
|
||||
<div class="option-grid">
|
||||
<label>
|
||||
<span>Expires after</span>
|
||||
<select name="max_days">
|
||||
<option value="7">7 days</option>
|
||||
<option value="1">1 day</option>
|
||||
<option value="30">30 days</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Max downloads</span>
|
||||
<input type="number" name="max_downloads" min="1" placeholder="Unlimited">
|
||||
</label>
|
||||
<label>
|
||||
<span>Password</span>
|
||||
<input type="password" name="password" autocomplete="new-password" placeholder="Optional">
|
||||
</label>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<div class="form-footer">
|
||||
<p>Current max file size: {{.Data.MaxUploadSize}}</p>
|
||||
<button class="button button-primary" type="submit">Upload files</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user