Finish Phase 0: lint, codegen, contributor docs and the two remaining spikes

Repository basics:
- CONTRIBUTING.md and CODE_OF_CONDUCT.md (Contributor Covenant 2.1)
- SPDX AGPL-3.0-or-later headers on all hand-written sources, checked in CI
- golangci-lint (shared .golangci.yml), ESLint and Prettier, all run in CI

API codegen from api/openapi.yaml (npm run generate, drift fails CI):
- Go types via oapi-codegen in Server/internal/api
- a contract test that the router and the spec list the same routes
- Dart models via Phone-App/tool/generate_api.dart; the app uses them

Spike: shared Tiptap editor in a Flutter WebView (ADR-4)
- @docwell/editor-bridge builds the editor into one HTML page with a
  versioned JSON protocol; Phone-App hosts it with webview_flutter and a
  native toolbar. Integration test passes on an Android API 35 emulator.
- flutter_inappwebview dropped: its Android plugin fails on AGP 9.

Spike: Wails v3 desktop (ADR-11)
- system tray, docwell:// deep links (page and space only) with
  single-instance hand-off, and the built-in updater with a required
  ed25519 signing key. Verified on Windows.
- regenerated build assets register the scheme and drop template
  placeholders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-10-31 16:11:07 +01:00
1 parent e717c1d69f
commit ba394b8fac
193 files changed
+6425 -399

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
<script setup lang="ts">
import { DwBadge, DwButton, DwLogo, useTheme } from "@docwell/ui";
import { useRouter } from "vue-router";
+26 -4
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { createApp } from "vue";
import { createRouter, createWebHistory } from "vue-router";
import App from "./App.vue";
@@ -11,10 +13,30 @@ const router = createRouter({
{ path: "/", name: "overview", component: () => import("./views/OverviewView.vue") },
{ path: "/users", name: "users", component: () => import("./views/UsersView.vue") },
{ path: "/organizations", name: "organizations", component: () => import("./views/OrganizationsView.vue") },
{ path: "/authentication", name: "authentication", component: () => import("./views/PlaceholderView.vue"), meta: { title: "Authentication", superadmin: true } },
{ path: "/storage", name: "storage", component: () => import("./views/PlaceholderView.vue"), meta: { title: "Storage", superadmin: true } },
{ path: "/email", name: "email", component: () => import("./views/PlaceholderView.vue"), meta: { title: "Email", superadmin: true } },
{ path: "/maintenance", name: "maintenance", component: () => import("./views/PlaceholderView.vue"), meta: { title: "Maintenance", superadmin: true } },
{
path: "/authentication",
name: "authentication",
component: () => import("./views/PlaceholderView.vue"),
meta: { title: "Authentication", superadmin: true },
},
{
path: "/storage",
name: "storage",
component: () => import("./views/PlaceholderView.vue"),
meta: { title: "Storage", superadmin: true },
},
{
path: "/email",
name: "email",
component: () => import("./views/PlaceholderView.vue"),
meta: { title: "Email", superadmin: true },
},
{
path: "/maintenance",
name: "maintenance",
component: () => import("./views/PlaceholderView.vue"),
meta: { title: "Maintenance", superadmin: true },
},
],
});
+2
View File
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import { ApiError, createClient, createTokenStore, isManager, type User } from "@docwell/api-client";
import { computed, ref } from "vue";
+2
View File
@@ -1,2 +1,4 @@
/* SPDX-License-Identifier: AGPL-3.0-or-later */
@import "tailwindcss";
@import "@docwell/ui/theme.css";
+5 -2
View File
@@ -1,3 +1,4 @@
<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
<script setup lang="ts">
import { ApiError } from "@docwell/api-client";
import { DwBadge, DwButton, DwCallout, DwLogo, DwTextField } from "@docwell/ui";
@@ -16,7 +17,8 @@ const messages: Record<string, string> = {
invalid_credentials: "Wrong email or password.",
forbidden: "Only organization admins and superadmins can use the admin panel.",
account_disabled: "This account is disabled.",
mfa_required: "This account uses two-step sign-in. Sign in to the web app first; MFA for the admin panel is not supported yet.",
mfa_required:
"This account uses two-step sign-in. Sign in to the web app first; MFA for the admin panel is not supported yet.",
};
async function submit() {
@@ -24,7 +26,8 @@ async function submit() {
error.value = "";
try {
await signIn(email.value, password.value);
const redirect = typeof route.query.redirect === "string" && route.query.redirect.startsWith("/") ? route.query.redirect : "/";
const redirect =
typeof route.query.redirect === "string" && route.query.redirect.startsWith("/") ? route.query.redirect : "/";
router.replace(redirect);
} catch (e) {
error.value = e instanceof ApiError ? (messages[e.code] ?? "Sign-in failed.") : "Can't reach the server.";
+5 -7
View File
@@ -1,3 +1,4 @@
<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
<script setup lang="ts">
import type { Organization } from "@docwell/api-client";
import { DwButton, DwCallout } from "@docwell/ui";
@@ -96,14 +97,11 @@ async function remove(o: Organization) {
<form v-if="editing" class="mt-4 flex flex-wrap items-end gap-2 dw-card !p-4" @submit.prevent="save">
<label class="flex flex-1 flex-col gap-1.5">
<span class="text-ui-sm font-semibold">Name</span>
<input
v-model="draft"
required
maxlength="120"
class="dw-input w-full"
/>
<input v-model="draft" required maxlength="120" class="dw-input w-full" />
</label>
<DwButton type="submit" variant="primary" :disabled="busy || !draft.trim()">{{ editing === "new" ? "Create" : "Save" }}</DwButton>
<DwButton type="submit" variant="primary" :disabled="busy || !draft.trim()">{{
editing === "new" ? "Create" : "Save"
}}</DwButton>
<DwButton variant="ghost" :disabled="busy" @click="editing = null">Cancel</DwButton>
</form>
+5 -1
View File
@@ -1,3 +1,4 @@
<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
<script setup lang="ts">
import { ApiError, type Status, type Version } from "@docwell/api-client";
import { DwCallout } from "@docwell/ui";
@@ -44,7 +45,10 @@ onMounted(async () => {
{{ readiness ? (readiness.status === "ok" ? "Connected" : "Unavailable") : "…" }}
</div>
</div>
<RouterLink to="/users" class="rounded-md border border-line bg-surface-raised p-4 transition-colors duration-[120ms] hover:border-line-strong">
<RouterLink
to="/users"
class="rounded-md border border-line bg-surface-raised p-4 transition-colors duration-[120ms] hover:border-line-strong"
>
<div class="text-ui-sm text-ink-muted">Users</div>
<div class="mt-1 text-ui-lg" data-testid="user-count">{{ userCount ?? "…" }}</div>
</RouterLink>
@@ -1,3 +1,4 @@
<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
<template>
<h1 class="text-2xl font-semibold tracking-tight">{{ $route.meta.title }}</h1>
<p class="mt-2 text-ui-md text-ink-muted">Not built yet. See docs/PLAN.md, section 8.</p>
+40 -7
View File
@@ -1,3 +1,4 @@
<!-- SPDX-License-Identifier: AGPL-3.0-or-later -->
<script setup lang="ts">
import type { Organization, Role, User, UserList } from "@docwell/api-client";
import { DwBadge, DwButton, DwCallout } from "@docwell/ui";
@@ -60,7 +61,14 @@ function startNew() {
function startEdit(u: User) {
editing.value = u;
Object.assign(form, { name: u.name, email: u.email, password: "", role: u.role, organization: u.organization, status: u.status });
Object.assign(form, {
name: u.name,
email: u.email,
password: "",
role: u.role,
organization: u.organization,
status: u.status,
});
}
const isSelf = computed(() => editing.value !== "new" && editing.value?.id === currentUser.value?.id);
@@ -112,7 +120,6 @@ async function remove(u: User) {
busy.value = false;
}
}
</script>
<template>
@@ -127,7 +134,13 @@ async function remove(u: User) {
</div>
<div class="mt-4 flex flex-wrap gap-2">
<input v-model="search" type="search" placeholder="Search name or email" aria-label="Search users" class="dw-input sm:w-64" />
<input
v-model="search"
type="search"
placeholder="Search name or email"
aria-label="Search users"
class="dw-input sm:w-64"
/>
<select v-if="isSuperadmin" v-model="orgFilter" aria-label="Filter by organization" class="dw-input sm:w-56">
<option value="">All organizations</option>
<option value="none">No organization</option>
@@ -149,7 +162,14 @@ async function remove(u: User) {
</label>
<label class="flex flex-col gap-1.5">
<span class="text-ui-sm font-semibold">{{ editing === "new" ? "Password" : "New password (optional)" }}</span>
<input v-model="form.password" type="password" autocomplete="new-password" :required="editing === 'new'" minlength="8" class="dw-input" />
<input
v-model="form.password"
type="password"
autocomplete="new-password"
:required="editing === 'new'"
minlength="8"
class="dw-input"
/>
</label>
<label class="flex flex-col gap-1.5">
<span class="text-ui-sm font-semibold">Role</span>
@@ -173,7 +193,9 @@ async function remove(u: User) {
</select>
</label>
<div class="flex gap-2 sm:col-span-2">
<DwButton type="submit" variant="primary" :disabled="busy">{{ editing === "new" ? "Create user" : "Save" }}</DwButton>
<DwButton type="submit" variant="primary" :disabled="busy">{{
editing === "new" ? "Create user" : "Save"
}}</DwButton>
<DwButton variant="ghost" :disabled="busy" @click="editing = null">Cancel</DwButton>
</div>
</form>
@@ -197,12 +219,23 @@ async function remove(u: User) {
<td class="px-4 py-2">{{ roleLabel[u.role] }}</td>
<td v-if="isSuperadmin" class="px-4 py-2">{{ u.organizationName || "—" }}</td>
<td class="px-4 py-2">
<DwBadge :tone="u.status === 'active' ? 'success' : u.status === 'disabled' ? 'danger' : 'neutral'" class="capitalize">{{ u.status }}</DwBadge>
<DwBadge
:tone="u.status === 'active' ? 'success' : u.status === 'disabled' ? 'danger' : 'neutral'"
class="capitalize"
>{{ u.status }}</DwBadge
>
</td>
<td class="px-4 py-2 text-right whitespace-nowrap">
<template v-if="canEdit(u)">
<DwButton variant="ghost" size="sm" @click="startEdit(u)">Edit</DwButton>
<DwButton v-if="u.id !== currentUser?.id" variant="ghost" size="sm" class="!text-danger" :disabled="busy" @click="remove(u)">
<DwButton
v-if="u.id !== currentUser?.id"
variant="ghost"
size="sm"
class="!text-danger"
:disabled="busy"
@click="remove(u)"
>
Delete
</DwButton>
</template>