Single-binary self-hosted website analytics on Rust axum: collector API, dashboards, world map, and PDF reports.
analyticsaxumdockerrustself-hostedsqliteviteweb-analytics
1<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>{% block title %}{{ page.title }}{% endblock %} · Analytics</title>
7 <meta name="description" content="{% block description %}{{ page.description }}{% endblock %}">
8 {% if base_url %}<base href="{{ base_url }}">{% endif %}
9 <link rel="icon" type="image/svg+xml" href="/favicon.ico">
10
11 {% block extra_head %}{% endblock %}
12
13 <link href="{{ vite_asset('static_src/base/index.js', 'css') }}" rel="stylesheet">
14 {% block extra_css %}{% endblock %}
15
16 {% include 'includes/collector.html' %}
17</head>
18
19<body>
20 {% include 'includes/messages.html' %}
21
22 {% block nav %}
23 <nav class="navbar navbar-dark navbar-expand-md d-print-none">
24 <div class="container">
25 <a class="navbar-brand" href="/">
26 <span class="logo" aria-hidden="true">
27 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
28 <rect x="6" y="38" width="10" height="22" rx="1.5" fill="#6b9e78"/>
29 <rect x="20" y="28" width="10" height="32" rx="1.5" fill="#6b9e78"/>
30 <rect x="34" y="18" width="10" height="42" rx="1.5" fill="#6b9e78"/>
31 <rect x="48" y="8" width="10" height="52" rx="1.5" fill="#6b9e78"/>
32 <rect x="48" y="8" width="10" height="6" rx="1.5" fill="#c9a84c"/>
33 </svg>
34 </span>
35 <span class="brand-text">Analytics</span>
36 <span class="brand-dot" aria-hidden="true"></span>
37 </a>
38 <button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navMain" aria-controls="navMain" aria-expanded="false" aria-label="Toggle navigation">
39 <span class="navbar-toggler-icon"></span>
40 </button>
41 <div class="collapse navbar-collapse" id="navMain">
42 <ul class="navbar-nav ms-3">
43 {% if user.is_authenticated %}
44 <li class="nav-item"><a class="nav-link {% if request.path == '/properties' %}active{% endif %}" href="/properties">Properties</a></li>
45 <li class="nav-item"><a class="nav-link {% if request.path == '/documentation' %}active{% endif %}" href="/documentation">Docs</a></li>
46 {% else %}
47 <li class="nav-item"><a class="nav-link {% if request.path == '/' %}active{% endif %}" href="/">Home</a></li>
48 <li class="nav-item"><a class="nav-link {% if request.path == '/documentation' %}active{% endif %}" href="/documentation">Docs</a></li>
49 <li class="nav-item"><a class="nav-link {% if request.path == '/changelog' %}active{% endif %}" href="/changelog">Changelog</a></li>
50 {% endif %}
51 </ul>
52 <ul class="navbar-nav ms-auto">
53 {% if user.is_authenticated %}
54 <li class="nav-item d-flex align-items-center">
55 <form method="post" action="/logout" class="d-inline">
56 <button type="submit" class="btn btn-sm btn-outline-light">Logout</button>
57 </form>
58 </li>
59 {% else %}
60 <li class="nav-item d-flex align-items-center">
61 <a href="/login" class="btn btn-sm btn-outline-light">Login</a>
62 </li>
63 {% endif %}
64 </ul>
65 </div>
66 </div>
67 </nav>
68 {% endblock %}
69
70 {% block breadcrumb_wrapper %}
71 <div class="breadcrumb-bar py-2 overflow-auto d-print-none">
72 <div class="container">
73 {% block breadcrumbs %}{% endblock %}
74 </div>
75 </div>
76 {% endblock %}
77
78 <main>
79 {% block main %}{% endblock %}
80 </main>
81
82 {% block footer %}
83 <footer class="d-print-none">
84 <div class="container">
85 <div class="row links">
86 <div class="col-12 col-lg-6 mb-4 mb-lg-0">
87 <div class="h5 mb-3">// Analytics</div>
88 <p>Self-hosted web analytics by <a href="https://isaacbythewood.com/">Isaac Bythewood</a>.
89 Page views, clicks, scrolls, sessions, custom events. GeoIP maps,
90 UTM attribution, PDF reports. No cookies you don't control, no data
91 pipeline you can't audit.</p>
92 </div>
93 <div class="col-6 col-lg-2 offset-lg-2">
94 <div class="h5 mb-3">// Pages</div>
95 <ul class="list-unstyled">
96 <li class="mb-2"><a href="/" class="link-footer">Home</a></li>
97 <li class="mb-2"><a href="/documentation" class="link-footer">Documentation</a></li>
98 <li class="mb-2"><a href="/changelog" class="link-footer">Changelog</a></li>
99 <li class="mb-2"><a href="https://github.com/overshard/analytics-rust" class="link-footer" target="_blank">Source</a></li>
100 </ul>
101 </div>
102 <div class="col-6 col-lg-2">
103 <div class="h5 mb-3">// Operator</div>
104 <ul class="list-unstyled">
105 {% if user.is_authenticated %}
106 <li class="mb-2"><a href="/properties" class="link-footer">Properties</a></li>
107 <li class="mb-2">
108 <form method="post" action="/logout" class="d-inline">
109 <button type="submit" class="btn btn-link link-footer p-0 align-baseline text-start">Logout</button>
110 </form>
111 </li>
112 {% else %}
113 <li class="mb-2"><a href="/login" class="link-footer">Login</a></li>
114 {% endif %}
115 </ul>
116 </div>
117 </div>
118 </div>
119 </footer>
120
121 <div class="footer-bar d-print-none">
122 <div class="container">
123 <div class="row align-items-center">
124 <div class="col-sm-6 d-flex align-items-center justify-content-center justify-content-sm-start order-1 order-sm-0">
125 <small>© {{ now.year }} Isaac Bythewood · Some rights reserved · <a href="https://db-ip.com" class="link-footer" target="_blank" rel="noopener">IP Geolocation by DB-IP</a></small>
126 </div>
127 <div class="col-sm-6 d-flex justify-content-center justify-content-sm-end py-3 py-sm-0">
128 <a href="https://github.com/overshard/analytics-rust" target="_blank" class="footer-bar-link" aria-label="GitHub">
129 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
130 <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
131 </svg>
132 </a>
133 </div>
134 </div>
135 </div>
136 </div>
137 {% endblock %}
138
139 <script type="module" src="{{ vite_asset('static_src/base/index.js') }}"></script>
140 {% block extra_js %}{% endblock %}
141</body>
142</html>