Skip to content

TaskView is a self-hosted project and task management platform focused on clarity, ownership, and control. TaskView is built for teams that want a transparent, self-hosted alternative to SaaS task managers.

chore: bootstrap

Nikolai Gimanadce016a05ab
diff --git a/web/src/assets/css/main.css b/web/src/assets/css/main.css
index b8a1492..3034ab1 100644
--- a/web/src/assets/css/main.css
+++ b/web/src/assets/css/main.css
@@ -2,6 +2,10 @@
@import "@nuxt/ui";
+@source "../../";
+
+@source "../../../vite.ui.options.ts";
+
@theme static {
--font-sans: 'Public Sans', sans-serif;
}
diff --git a/web/src/bootstrap.ts b/web/src/bootstrap.ts
new file mode 100644
index 0000000..fc4e2d9
--- /dev/null
+++ b/web/src/bootstrap.ts
@@ -0,0 +1,168 @@
+import './assets/css/main.css'
+import { addCollection } from '@iconify/vue'
+import lucide from '@iconify-json/lucide/icons.json'
+import mdi from '@iconify-json/mdi/icons.json'
+import carbon from '@iconify-json/carbon/icons.json'
+import { createPinia } from 'pinia'
+import type { Plugin } from 'vue'
+import { createApp } from 'vue'
+import type { RouteRecordRaw } from 'vue-router'
+import { createRouter, createWebHistory } from 'vue-router'
+import ui from '@nuxt/ui/vue-plugin'
+import { i18n, restoreSavedLocale } from './plugins/i18n'
+import { storeResetPlugin } from './plugins/pinia'
+import App from './App.vue'
+import authenticated from './middleware/authenticated'
+import syncSelectedProject from './middleware/syncSelectedProject'
+import api from './plugins/axios'
+import LoginPage from './pages/login.vue'
+import { registerExtensionOutlets } from './extensions/registry'
+import type { CreateTaskviewAppOptions, TvWebExtension } from './extensions/types'
+import type { Locale } from './locales'
+
+function buildRoutes(extensions: TvWebExtension[]): RouteRecordRaw[] {
+ const extensionRoutes = extensions.flatMap((extension) => extension.routes ?? [])
+ const extensionOrgRoutes = extensions.flatMap((extension) => extension.orgRoutes ?? [])
+
+ return [
+ {
+ path: '/',
+ name: 'login',
+ alias: '/login',
+ component: LoginPage,
+ },
+ {
+ path: '/reset-password',
+ name: 'reset-password',
+ component: () => import('./pages/reset-password.vue'),
+ },
+ ...extensionRoutes,
+ {
+ path: '/:orgSlug',
+ component: () => import('./layouts/UserLayout.vue'),
+ beforeEnter: [authenticated],
+ children: [
+ {
+ path: ':projectId/kanban',
+ name: 'kanban',
+ component: () => import('./pages/user/kanban.vue'),
+ },
+ {
+ path: ':projectId/graph',
+ name: 'graph',
+ component: () => import('./pages/user/graph.vue'),
+ },
+ {
+ path: ':projectId/sprints',
+ name: 'sprints',
+ component: () => import('./pages/user/sprints.vue'),
+ },
+ {
+ path: ':projectId/collaboration',
+ name: 'collaboration',
+ component: () => import('./pages/user/collaboration.vue'),
+ },
+ {
+ path: ':projectId/integrations',
+ name: 'integrations',
+ component: () => import('./pages/user/integrations.vue'),
+ },
+ {
+ path: ':projectId/webhooks',
+ name: 'webhooks',
+ component: () => import('./pages/user/webhooks.vue'),
+ },
+ {
+ path: ':projectId/messaging',
+ name: 'messaging',
+ component: () => import('./pages/user/messaging.vue'),
+ },
+ {
+ path: 'settings',
+ name: 'settings',
+ component: () => import('./pages/user/settings.vue'),
+ },
+ {
+ path: 'account',
+ name: 'account',
+ component: () => import('./pages/user/account.vue'),
+ },
+ {
+ path: 'organizations',
+ name: 'organizations',
+ component: () => import('./pages/user/organizations.vue'),
+ },
+ {
+ path: 'analytics',
+ name: 'analytics',
+ component: () => import('./pages/user/analytics.vue'),
+ },
+ {
+ path: 'ui-customization',
+ name: 'ui-customization',
+ component: () => import('./pages/user/ui-customization.vue'),
+ },
+ {
+ path: 'time-reports',
+ name: 'time-reports',
+ component: () => import('./pages/user/time-reports.vue'),
+ },
+ {
+ path: ':projectId/time-reports',
+ name: 'project-time-reports',
+ component: () => import('./pages/user/project-time-reports.vue'),
+ },
+ ...extensionOrgRoutes,
+ {
+ path: ':projectId?/:listId?/:taskId?',
+ name: 'user',
+ component: () => import('./pages/user/index.vue'),
+ },
+ ],
+ },
+ ]
+}
+
+function applyExtensionMessages(extensions: TvWebExtension[]) {
+ for (const extension of extensions) {
+ for (const [locale, messages] of Object.entries(extension.i18nMessages ?? {})) {
+ i18n.global.mergeLocaleMessage(locale as Locale, messages ?? {})
+ }
+ }
+}
+
+export function createTaskviewApp(options: CreateTaskviewAppOptions = {}) {
+ const extensions = options.extensions ?? []
+
+ addCollection(lucide)
+ addCollection(mdi)
+ addCollection(carbon)
+
+ const app = createApp(App)
+
+ const pinia = createPinia()
+ pinia.use(storeResetPlugin)
+ app.use(pinia)
+ app.use(api)
+ app.use(i18n as unknown as Plugin)
+
+ applyExtensionMessages(extensions)
+ for (const extension of extensions) {
+ registerExtensionOutlets(extension)
+ }
+
+ const router = createRouter({
+ routes: buildRoutes(extensions),
+ history: createWebHistory(),
+ })
+
+ router.beforeEach(syncSelectedProject)
+
+ app.use(router)
+ app.use(ui as unknown as Plugin)
+
+ app.mount('#app')
+ restoreSavedLocale()
+
+ return { app, router }
+}
diff --git a/web/src/components/ExtensionOutlet.vue b/web/src/components/ExtensionOutlet.vue
new file mode 100644
index 0000000..3a2dea4
--- /dev/null
+++ b/web/src/components/ExtensionOutlet.vue
@@ -0,0 +1,16 @@
+<template>
+ <component
+ :is="component"
+ v-for="(component, index) in components"
+ :key="`${name}-${index}`"
+ />
+</template>
+
+<script setup lang="ts">
+import { computed } from 'vue'
+import { getOutletComponents } from '@/extensions/registry'
+
+const props = defineProps<{ name: string }>()
+
+const components = computed(() => getOutletComponents(props.name))
+</script>
\ No newline at end of file
diff --git a/web/src/extensions/registry.ts b/web/src/extensions/registry.ts
new file mode 100644
index 0000000..bd64962
--- /dev/null
+++ b/web/src/extensions/registry.ts
@@ -0,0 +1,16 @@
+import type { Component } from 'vue'
+import type { TvWebExtension } from './types'
+
+const outletComponents = new Map<string, Component[]>()
+
+export function registerExtensionOutlets(extension: TvWebExtension) {
+ if (!extension.outlets) return
+ for (const [name, components] of Object.entries(extension.outlets)) {
+ const existing = outletComponents.get(name) ?? []
+ outletComponents.set(name, [...existing, ...components])
+ }
+}
+
+export function getOutletComponents(name: string): Component[] {
+ return outletComponents.get(name) ?? []
+}
diff --git a/web/src/extensions/types.ts b/web/src/extensions/types.ts
new file mode 100644
index 0000000..4ac210a
--- /dev/null
+++ b/web/src/extensions/types.ts
@@ -0,0 +1,17 @@
+import type { Component } from 'vue'
+import type { RouteRecordRaw } from 'vue-router'
+import type { Locale } from '@/locales'
+
+export type TvWebExtensionMessages = Partial<Record<Locale, Record<string, unknown>>>
+
+export type TvWebExtension = {
+ name: string
+ routes?: RouteRecordRaw[]
+ orgRoutes?: RouteRecordRaw[]
+ i18nMessages?: TvWebExtensionMessages
+ outlets?: Record<string, Component[]>
+}
+
+export type CreateTaskviewAppOptions = {
+ extensions?: TvWebExtension[]
+}
diff --git a/web/src/main.ts b/web/src/main.ts
index cd35f4e..43fac73 100644
--- a/web/src/main.ts
+++ b/web/src/main.ts
@@ -1,138 +1,3 @@
-import './assets/css/main.css'
-import { addCollection } from '@iconify/vue'
-import lucide from '@iconify-json/lucide/icons.json'
-import mdi from '@iconify-json/mdi/icons.json'
-import carbon from '@iconify-json/carbon/icons.json'
-import { createPinia } from 'pinia'
-import type { Plugin } from 'vue'
-import { createApp } from 'vue'
-import { createRouter, createWebHistory } from 'vue-router'
-import ui from '@nuxt/ui/vue-plugin'
-import { i18n, restoreSavedLocale } from './plugins/i18n'
-import { storeResetPlugin } from './plugins/pinia'
+import { createTaskviewApp } from './bootstrap'
-addCollection(lucide)
-addCollection(mdi)
-addCollection(carbon)
-
-import App from './App.vue'
-import authenticated from './middleware/authenticated'
-import syncSelectedProject from './middleware/syncSelectedProject'
-import api from './plugins/axios'
-import LoginPage from './pages/login.vue'
-
-const app = createApp(App)
-
-const pinia = createPinia()
-pinia.use(storeResetPlugin)
-app.use(pinia)
-app.use(api)
-app.use(i18n as unknown as Plugin)
-
-const router = createRouter({
- routes: [
- {
- path: '/',
- name: 'login',
- alias: '/login',
- component: LoginPage,
- },
- {
- path: '/reset-password',
- name: 'reset-password',
- component: () => import('./pages/reset-password.vue'),
- },
- {
- path: '/:orgSlug',
- component: () => import('./layouts/UserLayout.vue'),
- beforeEnter: [authenticated],
- children: [
- {
- path: ':projectId/kanban',
- name: 'kanban',
- component: () => import('./pages/user/kanban.vue'),
- },
- {
- path: ':projectId/graph',
- name: 'graph',
- component: () => import('./pages/user/graph.vue'),
- },
- {
- path: ':projectId/sprints',
- name: 'sprints',
- component: () => import('./pages/user/sprints.vue'),
- },
- {
- path: ':projectId/collaboration',
- name: 'collaboration',
- component: () => import('./pages/user/collaboration.vue'),
- },
- {
- path: ':projectId/integrations',
- name: 'integrations',
- component: () => import('./pages/user/integrations.vue'),
- },
- {
- path: ':projectId/webhooks',
- name: 'webhooks',
- component: () => import('./pages/user/webhooks.vue'),
- },
- {
- path: ':projectId/messaging',
- name: 'messaging',
- component: () => import('./pages/user/messaging.vue'),
- },
- {
- path: 'settings',
- name: 'settings',
- component: () => import('./pages/user/settings.vue'),
- },
- {
- path: 'account',
- name: 'account',
- component: () => import('./pages/user/account.vue'),
- },
- {
- path: 'organizations',
- name: 'organizations',
- component: () => import('./pages/user/organizations.vue'),
- },
- {
- path: 'analytics',
- name: 'analytics',
- component: () => import('./pages/user/analytics.vue'),
- },
- {
- path: 'ui-customization',
- name: 'ui-customization',
- component: () => import('./pages/user/ui-customization.vue'),
- },
- {
- path: 'time-reports',
- name: 'time-reports',
- component: () => import('./pages/user/time-reports.vue'),
- },
- {
- path: ':projectId/time-reports',
- name: 'project-time-reports',
- component: () => import('./pages/user/project-time-reports.vue'),
- },
- {
- path: ':projectId?/:listId?/:taskId?',
- name: 'user',
- component: () => import('./pages/user/index.vue'),
- },
- ],
- },
- ],
- history: createWebHistory(),
-})
-
-
-router.beforeEach(syncSelectedProject)
-
-app.use(router)
-app.use(ui as unknown as Plugin)
-
-app.mount('#app')
-restoreSavedLocale()
+createTaskviewApp()
diff --git a/web/tsconfig.node.json b/web/tsconfig.node.json
index 215f229..50042ca 100644
--- a/web/tsconfig.node.json
+++ b/web/tsconfig.node.json
@@ -33,6 +33,7 @@
},
"include": [
"vite.config.ts",
+ "vite.ui.options.ts",
"eslint.config.ts"
]
}
\ No newline at end of file
diff --git a/web/vite.config.ts b/web/vite.config.ts
index d63e899..6630544 100644
--- a/web/vite.config.ts
+++ b/web/vite.config.ts
@@ -2,24 +2,7 @@ import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
-// import { transformWithEsbuild } from 'vite'
-// import type { Plugin } from 'vite'
-
-// function transpileArktype(): Plugin {
-// return {
-// name: 'transpile-arktype',
-// apply: 'build',
-// async transform(code, id) {
-// if (id.includes('@ark/') || id.includes('arktype')) {
-// const result = await transformWithEsbuild(code, id, {
-// target: 'es2020',
-// format: 'esm',
-// })
-// return { code: result.code, map: result.map }
-// }
-// },
-// }
-// }
+import { uiPluginOptions } from './vite.ui.options'
// https://vitejs.dev/config/
export default defineConfig({
@@ -28,227 +11,14 @@ export default defineConfig({
},
plugins: [
vue(),
- ui({
- ui: {
- // Nuxt UI reads `ui.tv` at runtime (createTV) but omits it from the AppConfigUI type.
- // Teach tailwind-merge our custom radius scale so `rounded-10`/`rounded-14` are
- // recognized and properly dedupe the component default radius inside `:ui` overrides
- // (no `!` needed). See main.css @theme --radius-10 / --radius-14.
- ...({
- tv: { twMergeConfig: { extend: { theme: { radius: ['10', '14'] } } } },
- } as object),
- inputTime: {
- slots: { base: 'text-base! rounded-10' },
- defaultVariants: {
- variant: 'soft'
- }
- },
- drawer: {
- slots: {
- container: 'pb-[calc(var(--tv-safe-area-inset-bottom)+16px)]'
- }
- },
- slideover: {
- slots: {
- content: 'py-safe',
- },
- },
- dashboardGroup: {
- base: 'py-safe',
- },
- dashboardPanel: {
- slots: {
- // iPad
- body: 'p-2! pb-[calc(var(--tv-safe-area-inset-bottom)+var(--tv-safe-area-inset-top)+64px)]! lg:pb-[calc(var(--tv-safe-area-inset-bottom)+8px)]!'
- },
- },
- dashboardSidebar: {
- slots: {
- // iPad
- footer: 'lg:pb-[calc(var(--tv-safe-area-inset-bottom)+8px)]',
- },
- },
- modal: {
- slots: {
- header: 'relative'
- },
- variants: {
- fullscreen: {
- true: {
- content: 'py-safe',
- },
- false: {
- content: 'rounded-3xl ring-0',
- }
- }
- },
- },
- popover: {
- slots: {
- content: 'rounded-2xl'
- }
- },
- dashboardSearchButton: {
- slots: {
- base: 'rounded-xl',
- },
- },
- dashboardSearch: {
- variants: {
- fullscreen: {
- true: {
- // was too much close to the top with safe area
- input: 'mt-4'
- }
- }
- }
- },
- dashboardNavbar: {
- slots: {
- title: 'text-lg!',
- },
- },
- button: {
- slots: {
- base: 'cursor-pointer rounded-14',
- },
- defaultVariants: {
- size: 'xl',
- },
- variants: {
- size: {
- xl: {
- leadingIcon: 'size-4.5',
- },
- lg: {
- leadingIcon: 'size-4',
- },
- md: {
- leadingIcon: 'size-3.5',
- }
- }
- }
- },
- inputNumber: {
- slots: {
- base: 'text-base',
- },
- defaultVariants: {
- variant: 'soft'
- }
- },
- input: {
- slots: {
- base: 'rounded-xl',
- },
- defaultVariants: {
- size: 'xl',
- variant: 'soft',
- },
- variants: {
- size: {
- xl: {
- base: 'px-3.5',
- leadingIcon: 'size-4.5',
- leading: 'ps-3.5'
- },
- }
- }
- },
- textarea: {
- defaultVariants: {
- size: 'xl',
- },
- },
- colors: {
- primary: 'green',
- neutral: 'zinc',
- },
- collapsible: {
- slots: {
- content: 'p-2',
- },
- },
- card: {
- slots: {
- root: 'rounded-3xl'
- }
- },
- pageCard: {
- slots: {
- container: 'sm:p-4'
- },
- variants: {
- variant: {
- taskview: {
- root: 'cursor-pointer shadow-sm bg-tv-ui-bg-elevated',
- container: 'p-2 px-4 sm:p-2 sm:px-4',
- },
- },
-
- },
- },
- select: {
- defaultVariants: {
- size: 'xl'
- },
- slots: {
- content: 'rounded-2xl',
- item: 'before:rounded-xl',
- base: 'rounded-xl'
- }
- },
- selectMenu: {
- slots: {
- content: 'rounded-2xl',
- item: 'rounded-xl hover:bg-accented/40 before:rounded-xl',
- base: 'rounded-xl',
- input: 'text-base'
- },
- defaultVariants: {
- variant: 'soft',
- },
- },
- checkbox: {
- slots: {
- base: 'ring-2',
- root: 'cursor-pointer'
- },
- variants: {
- size: {
- xl: {
- base: 'size-5',
- container: 'h-5',
- },
- lg: {
- base: 'size-4',
- }
- },
- },
- defaultVariants: {
- size: 'xl',
- color: 'primary',
- },
- },
- },
- }),
- // transpileArktype(),
+ ui(uiPluginOptions),
],
- // build: {
- // target: ['es2020', 'safari15'],
- // },
- // optimizeDeps: {
- // include: ['arktype', '@ark/schema', '@ark/util'],
- // esbuildOptions: {
- // target: 'es2020',
- // },
- // },
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
- port: 5174
- }
+ port: 5174,
+ },
})
diff --git a/web/vite.ui.options.ts b/web/vite.ui.options.ts
new file mode 100644
index 0000000..a190452
--- /dev/null
+++ b/web/vite.ui.options.ts
@@ -0,0 +1,206 @@
+import type { NuxtUIOptions } from '@nuxt/ui/vite'
+
+export const uiPluginOptions: NuxtUIOptions = {
+ ui: {
+ // Nuxt UI reads `ui.tv` at runtime (createTV) but omits it from the AppConfigUI type.
+ // Teach tailwind-merge our custom radius scale so `rounded-10`/`rounded-14` are
+ // recognized and properly dedupe the component default radius inside `:ui` overrides
+ // (no `!` needed). See main.css @theme --radius-10 / --radius-14.
+ ...({
+ tv: { twMergeConfig: { extend: { theme: { radius: ['10', '14'] } } } },
+ } as object),
+ inputTime: {
+ slots: { base: 'text-base! rounded-10' },
+ defaultVariants: {
+ variant: 'soft',
+ },
+ },
+ drawer: {
+ slots: {
+ container: 'pb-[calc(var(--tv-safe-area-inset-bottom)+16px)]',
+ },
+ },
+ slideover: {
+ slots: {
+ content: 'py-safe',
+ },
+ },
+ dashboardGroup: {
+ base: 'py-safe',
+ },
+ dashboardPanel: {
+ slots: {
+ // iPad
+ body: 'p-2! pb-[calc(var(--tv-safe-area-inset-bottom)+var(--tv-safe-area-inset-top)+64px)]! lg:pb-[calc(var(--tv-safe-area-inset-bottom)+8px)]!',
+ },
+ },
+ dashboardSidebar: {
+ slots: {
+ // iPad
+ footer: 'lg:pb-[calc(var(--tv-safe-area-inset-bottom)+8px)]',
+ },
+ },
+ modal: {
+ slots: {
+ header: 'relative',
+ },
+ variants: {
+ fullscreen: {
+ true: {
+ content: 'py-safe',
+ },
+ false: {
+ content: 'rounded-3xl ring-0',
+ },
+ },
+ },
+ },
+ popover: {
+ slots: {
+ content: 'rounded-2xl',
+ },
+ },
+ dashboardSearchButton: {
+ slots: {
+ base: 'rounded-xl',
+ },
+ },
+ dashboardSearch: {
+ variants: {
+ fullscreen: {
+ true: {
+ // was too much close to the top with safe area
+ input: 'mt-4',
+ },
+ },
+ },
+ },
+ dashboardNavbar: {
+ slots: {
+ title: 'text-lg!',
+ },
+ },
+ button: {
+ slots: {
+ base: 'cursor-pointer rounded-14',
+ },
+ defaultVariants: {
+ size: 'xl',
+ },
+ variants: {
+ size: {
+ xl: {
+ leadingIcon: 'size-4.5',
+ },
+ lg: {
+ leadingIcon: 'size-4',
+ },
+ md: {
+ leadingIcon: 'size-3.5',
+ },
+ },
+ },
+ },
+ inputNumber: {
+ slots: {
+ base: 'text-base',
+ },
+ defaultVariants: {
+ variant: 'soft',
+ },
+ },
+ input: {
+ slots: {
+ base: 'rounded-xl',
+ },
+ defaultVariants: {
+ size: 'xl',
+ variant: 'soft',
+ },
+ variants: {
+ size: {
+ xl: {
+ base: 'px-3.5',
+ leadingIcon: 'size-4.5',
+ leading: 'ps-3.5',
+ },
+ },
+ },
+ },
+ textarea: {
+ defaultVariants: {
+ size: 'xl',
+ },
+ },
+ colors: {
+ primary: 'green',
+ neutral: 'zinc',
+ },
+ collapsible: {
+ slots: {
+ content: 'p-2',
+ },
+ },
+ card: {
+ slots: {
+ root: 'rounded-3xl',
+ },
+ },
+ pageCard: {
+ slots: {
+ container: 'sm:p-4',
+ },
+ variants: {
+ variant: {
+ taskview: {
+ root: 'cursor-pointer shadow-sm bg-tv-ui-bg-elevated',
+ container: 'p-2 px-4 sm:p-2 sm:px-4',
+ },
+ },
+
+ },
+ },
+ select: {
+ defaultVariants: {
+ size: 'xl',
+ },
+ slots: {
+ content: 'rounded-2xl',
+ item: 'before:rounded-xl',
+ base: 'rounded-xl',
+ },
+ },
+ selectMenu: {
+ slots: {
+ content: 'rounded-2xl',
+ item: 'rounded-xl hover:bg-accented/40 before:rounded-xl',
+ base: 'rounded-xl',
+ input: 'text-base',
+ },
+ defaultVariants: {
+ variant: 'soft',
+ },
+ },
+ checkbox: {
+ slots: {
+ base: 'ring-2',
+ root: 'cursor-pointer',
+ },
+ variants: {
+ size: {
+ xl: {
+ base: 'size-5',
+ container: 'h-5',
+ },
+ lg: {
+ base: 'size-4',
+ },
+ },
+ },
+ defaultVariants: {
+ size: 'xl',
+ color: 'primary',
+ },
+ },
+ },
+}