aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-03-07 15:09:42 +0530
committerBobby <[email protected]>2026-03-07 15:09:42 +0530
commit8f8d41413ff775b6d721059783a0e2de4f90f50c (patch)
tree40923d049ee7df8b0bc90d74373c94cdd4d8b230 /templates
parent41926c10ea2e8496ce4b528262f5047ccbe6f155 (diff)
downloaddove-8f8d41413ff775b6d721059783a0e2de4f90f50c.tar.xz
dove-8f8d41413ff775b6d721059783a0e2de4f90f50c.zip
feat: add configuration management and server setup
- Implemented configuration file creation and loading in config.go. - Added default configuration content embedded in embed.go. - Introduced logging middleware for HTTP requests. - Created Makefile for build and setup automation. - Integrated Tailwind CSS and HTMX for frontend styling and interactivity. - Developed basic authentication flow with login and dashboard pages. - Enhanced error handling and user feedback in templates. - Updated dependencies in go.mod and go.sum.
Diffstat (limited to 'templates')
-rw-r--r--templates/auth/login.django45
-rw-r--r--templates/dashboard.django30
-rw-r--r--templates/error.django11
-rw-r--r--templates/layouts/base.django15
4 files changed, 101 insertions, 0 deletions
diff --git a/templates/auth/login.django b/templates/auth/login.django
new file mode 100644
index 0000000..3981abd
--- /dev/null
+++ b/templates/auth/login.django
@@ -0,0 +1,45 @@
+{% extends "layouts/base.django" %}
+
+{% block content %}
+<div class="min-h-screen flex items-center justify-center bg-gray-950">
+ <div class="w-full max-w-sm space-y-8">
+ <div class="text-center">
+ <h1 class="text-4xl font-bold text-white tracking-tight">Dove</h1>
+ <p class="mt-2 text-sm text-gray-400">Local SMTP server for peaceful email testing</p>
+ </div>
+
+ {% if ErrorMessage %}
+ <div class="rounded-lg bg-red-500/10 border border-red-500/20 px-4 py-3 text-sm text-red-400">
+ {{ ErrorMessage }}
+ </div>
+ {% endif %}
+
+ <form method="POST" action="/auth/login" class="space-y-5">
+ <div>
+ <input
+ type="text"
+ name="username"
+ placeholder="Username"
+ required
+ class="w-full rounded-lg border border-gray-700 bg-gray-900 px-4 py-3 text-sm text-white placeholder-gray-500 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 transition"
+ >
+ </div>
+ <div>
+ <input
+ type="password"
+ name="password"
+ placeholder="Password"
+ required
+ class="w-full rounded-lg border border-gray-700 bg-gray-900 px-4 py-3 text-sm text-white placeholder-gray-500 focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 transition"
+ >
+ </div>
+ <button
+ type="submit"
+ class="w-full rounded-lg bg-blue-600 px-4 py-3 text-sm font-medium text-white hover:bg-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 focus:ring-offset-gray-950 transition"
+ >
+ Sign in
+ </button>
+ </form>
+ </div>
+</div>
+{% endblock %}
diff --git a/templates/dashboard.django b/templates/dashboard.django
new file mode 100644
index 0000000..35c1246
--- /dev/null
+++ b/templates/dashboard.django
@@ -0,0 +1,30 @@
+{% extends "layouts/base.django" %}
+
+{% block content %}
+<div class="min-h-screen bg-gray-950">
+ <nav class="border-b border-gray-800 bg-gray-900/50 backdrop-blur-sm">
+ <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
+ <div class="flex h-14 items-center justify-between">
+ <div class="flex items-center space-x-3">
+ <span class="text-lg font-semibold text-white">Dove</span>
+ </div>
+ {% if AuthEnabled %}
+ <div class="flex items-center space-x-4">
+ <a href="/auth/logout" class="text-sm text-gray-400 hover:text-white transition">Logout</a>
+ </div>
+ {% endif %}
+ </div>
+ </div>
+ </nav>
+
+ <main class="mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8">
+ <div class="flex items-center justify-between">
+ <h1 class="text-2xl font-bold text-white">Mailboxes</h1>
+ </div>
+
+ <div class="mt-6 rounded-lg border border-gray-800 bg-gray-900/50 p-12 text-center">
+ <p class="text-gray-400">No mailboxes yet. Emails will appear here when received.</p>
+ </div>
+ </main>
+</div>
+{% endblock %}
diff --git a/templates/error.django b/templates/error.django
new file mode 100644
index 0000000..8c1521d
--- /dev/null
+++ b/templates/error.django
@@ -0,0 +1,11 @@
+{% extends "layouts/base.django" %}
+
+{% block content %}
+<div class="min-h-screen flex items-center justify-center bg-gray-950">
+ <div class="text-center space-y-4">
+ <h1 class="text-6xl font-bold text-gray-600">Error</h1>
+ <p class="text-gray-400">{{ ErrorMessage }}</p>
+ <a href="/" class="inline-block mt-4 text-sm text-blue-400 hover:text-blue-300 transition">Go back home</a>
+ </div>
+</div>
+{% endblock %}
diff --git a/templates/layouts/base.django b/templates/layouts/base.django
new file mode 100644
index 0000000..567b81d
--- /dev/null
+++ b/templates/layouts/base.django
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>{% if PageTitle %}{{ PageTitle }} - {% endif %}Dove</title>
+ <link rel="stylesheet" href="/static/css/style.css">
+ {% block head %}{% endblock %}
+</head>
+<body class="antialiased">
+ {% block content %}{% endblock %}
+ <script src="/static/js/htmx.min.js"></script>
+ {% block scripts %}{% endblock %}
+</body>
+</html>