refactor(lib): consolidate services, types, utils, and actions into lib folder and update import paths
All checks were successful
Deploy Flowstate to VPS / deploy (push) Successful in 1m27s

This commit is contained in:
Chneemann 2026-08-23 16:44:18 +02:00
parent 9ae5ddaf90
commit a60851ac07
No known key found for this signature in database
78 changed files with 163 additions and 138 deletions

View file

@ -1,38 +1,57 @@
# 1. Install dependencies # Syntax directive specifying the Dockerfile format version.
# ==============================================================================
# @file Dockerfile
# @description Multi-stage Docker build for Next.js production deployments utilizing standalone output and secure user privileges.
# ==============================================================================
# ------------------------------------------------------------------------------
# Stage 1: Install Dependencies
# ------------------------------------------------------------------------------
FROM node:20-alpine AS deps FROM node:20-alpine AS deps
WORKDIR /app WORKDIR /app
# Copy package descriptors and install all project dependencies
COPY package*.json ./ COPY package*.json ./
RUN npm install RUN npm install
# 2. Build the application # ------------------------------------------------------------------------------
# Stage 2: Build Application
# ------------------------------------------------------------------------------
FROM node:20-alpine AS builder FROM node:20-alpine AS builder
WORKDIR /app WORKDIR /app
# Copy node_modules from the dependencies stage and source code
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
# Build the Next.js application for production
RUN npm run build RUN npm run build
# 3. Run production image (Node.js server) # ------------------------------------------------------------------------------
# Stage 3: Production Execution Server
# ------------------------------------------------------------------------------
FROM node:20-alpine AS runner FROM node:20-alpine AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
ENV PORT=3002 ENV PORT=3002
# Create a system user for enhanced security # Create a dedicated system user and group for security isolation
RUN addgroup --system --gid 1001 nodejs RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs RUN adduser --system --uid 1001 nextjs
# Copy public assets and standalone build output # Copy static assets and optimized standalone bundle from the build stage
COPY --from=builder /app/public ./public COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Create analytics data directory and assign proper permissions # Prepare local persistent storage directory with correct user permissions
RUN mkdir -p /app/data && chown -R nextjs:nodejs /app/data RUN mkdir -p /app/data && chown -R nextjs:nodejs /app/data
# Switch to non-root user
USER nextjs USER nextjs
EXPOSE 3002 EXPOSE 3002
# Start the standalone Node.js server
CMD ["node", "server.js"] CMD ["node", "server.js"]

View file

@ -25,15 +25,18 @@ A modern, high-performance Kanban & Workflow web application designed to help yo
The project uses Next.js Route Groups to separate public and protected application areas cleanly: The project uses Next.js Route Groups to separate public and protected application areas cleanly:
- `.forgejo/workflows/` — Automated SSH deployment pipeline (`deploy.yml`)
- `app/(auth)/` — Public authentication routes (Login, Register) - `app/(auth)/` — Public authentication routes (Login, Register)
- `app/(app)/` — Protected workspace & dashboard routes (Sidebar, Header, Kanban Board) - `app/(app)/` — Protected workspace & dashboard routes (Sidebar, Header, Kanban Board)
- `app/api/` — Backend API endpoints & Auth handlers (`/api/auth/register`, `[...nextauth]`) - `app/api/` — Backend API endpoints & Auth handlers (`/api/auth/register`, `[...nextauth]`)
- `db/` — Database schema definitions, migrations, and Drizzle configuration (`drizzle.config.ts`) - `db/` — Database schema definitions, migrations, and Drizzle configuration (`drizzle.config.ts`)
- `services/` — Business logic layers and external API integration services - `lib/` — Centralized core logic folder containing:
- `utils/` — Shared helper functions, formatters, and global utility logic - `actions/` — Server Actions (e.g., authentication actions)
- `types/` — Global TypeScript interfaces and type definitions - `schemas/` — Zod validation schemas
- `services/` — Business logic layers and external API integration services
- `types/` — Global TypeScript interfaces and type definitions
- `utils/` — Shared helper functions and formatters
- `public/` — Static assets (images, icons, fonts) - `public/` — Static assets (images, icons, fonts)
- `.forgejo/workflows/` — Automated SSH deployment pipeline (`deploy.yml`)
## 🚀 CI/CD & Deployment ## 🚀 CI/CD & Deployment

View file

@ -1,5 +1,5 @@
/** /**
* @file dashboard/Board.tsx * @file app/(app)/dashboard/Board.tsx
* @description Client component wrapping the columns grid, tracking individual task update/deletion states, and handling asynchronous mutations via API with cache revalidation. * @description Client component wrapping the columns grid, tracking individual task update/deletion states, and handling asynchronous mutations via API with cache revalidation.
*/ */
@ -8,7 +8,7 @@
import { useState, useTransition } from "react"; import { useState, useTransition } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import Column from "./column/Column"; import Column from "./column/Column";
import { COLUMNS, Task, TaskStatus } from "@/types/task"; import { COLUMNS, Task, TaskStatus } from "@/lib/types/task";
import Header from "./header/Header"; import Header from "./header/Header";
import { mutate } from "swr"; import { mutate } from "swr";

View file

@ -1,12 +1,12 @@
/** /**
* @file dashboard/card/Card.tsx * @file app/(app)/dashboard/card/Card.tsx
* @description Client component rendering a single card container with individual loading states and modular sub-components. * @description Client component rendering a single card container with individual loading states and modular sub-components.
*/ */
"use client"; "use client";
import { Loader2 } from "lucide-react"; import { Loader2 } from "lucide-react";
import { Task, TaskStatus } from "@/types/task"; import { Task, TaskStatus } from "@/lib/types/task";
import CardActions from "./CardActions"; import CardActions from "./CardActions";
import CardAvatars from "./CardAvatars"; import CardAvatars from "./CardAvatars";
import CardDueDate from "./CardDueDate"; import CardDueDate from "./CardDueDate";

View file

@ -1,5 +1,5 @@
/** /**
* @file dashboard/card/CardActions.tsx * @file app/(app)/dashboard/card/CardActions.tsx
* @description Client component rendering the mobile status transition, edit option, and deletion dropdown for a card. * @description Client component rendering the mobile status transition, edit option, and deletion dropdown for a card.
*/ */
@ -8,7 +8,7 @@
import { useState, useEffect, useRef } from "react"; import { useState, useEffect, useRef } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { MoreHorizontal, CornerDownRight, Trash2, Pencil } from "lucide-react"; import { MoreHorizontal, CornerDownRight, Trash2, Pencil } from "lucide-react";
import { COLUMNS, TaskStatus } from "@/types/task"; import { COLUMNS, TaskStatus } from "@/lib/types/task";
/** /**
* Properties for the CardActions component. * Properties for the CardActions component.

View file

@ -1,13 +1,13 @@
/** /**
* @file dashboard/card/CardAvatars.tsx * @file app/(app)/dashboard/card/CardAvatars.tsx
* @description Client component rendering team avatars and creator badge for a card. * @description Client component rendering team avatars and creator badge for a card.
*/ */
"use client"; "use client";
import { Crown } from "lucide-react"; import { Crown } from "lucide-react";
import { Task } from "@/types/task"; import { Task } from "@/lib/types/task";
import { getInitials } from "@/utils/user"; import { getInitials } from "@/lib/utils/user";
/** /**
* Properties for the UserAvatar component. * Properties for the UserAvatar component.

View file

@ -1,10 +1,10 @@
/** /**
* @file dashboard/card/CardDueDate.tsx * @file app/(app)/dashboard/card/CardDueDate.tsx
* @description Client component rendering the due date badge with overdue status indicators and hover time display. * @description Client component rendering the due date badge with overdue status indicators and hover time display.
*/ */
import { AlertCircle, CalendarDays } from "lucide-react"; import { AlertCircle, CalendarDays } from "lucide-react";
import { Task } from "@/types/task"; import { Task } from "@/lib/types/task";
/** /**
* Renders a due date badge for a card, showing an overdue alert animation * Renders a due date badge for a card, showing an overdue alert animation

View file

@ -1,9 +1,9 @@
/** /**
* @file dashboard/card/CardPriority.tsx * @file app/(app)/dashboard/card/CardPriority.tsx
* @description Client component rendering the dynamic priority badge for a card based on configuration. * @description Client component rendering the dynamic priority badge for a card based on configuration.
*/ */
import { TaskPriority, PRIORITY_CONFIG } from "@/types/task"; import { TaskPriority, PRIORITY_CONFIG } from "@/lib/types/task";
/** /**
* Renders a styled priority badge for a card. * Renders a styled priority badge for a card.

View file

@ -1,5 +1,5 @@
/** /**
* @file dashboard/column/Column.tsx * @file app/(app)/dashboard/column/Column.tsx
* @description Client component rendering a single column container supporting drag-and-drop drop targets, task lists, and dynamic updating/deleting states. * @description Client component rendering a single column container supporting drag-and-drop drop targets, task lists, and dynamic updating/deleting states.
*/ */
@ -9,7 +9,7 @@ import { useState } from "react";
import Card from "../card/Card"; import Card from "../card/Card";
import ColumnHeader from "./ColumnHeader"; import ColumnHeader from "./ColumnHeader";
import ColumnEmptyState from "./ColumnEmptyState"; import ColumnEmptyState from "./ColumnEmptyState";
import { ColumnConfig, Task, TaskStatus } from "@/types/task"; import { ColumnConfig, Task, TaskStatus } from "@/lib/types/task";
/** /**
* Properties for the Column component. * Properties for the Column component.

View file

@ -1,5 +1,5 @@
/** /**
* @file dashboard/column/ColumnEmptyState.tsx * @file app/(app)/dashboard/column/ColumnEmptyState.tsx
* @description Client component rendering a placeholder card when a specific column contains no tasks. * @description Client component rendering a placeholder card when a specific column contains no tasks.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file dashboard/column/ColumnHeader.tsx * @file app/(app)/dashboard/column/ColumnHeader.tsx
* @description Component rendering the column header with title, color indicator, item count, and add button with pre-filled status. * @description Component rendering the column header with title, color indicator, item count, and add button with pre-filled status.
*/ */
@ -7,7 +7,7 @@
import { Plus } from "lucide-react"; import { Plus } from "lucide-react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { TaskStatus } from "@/types/task"; import { TaskStatus } from "@/lib/types/task";
/** /**
* Properties for the ColumnHeader component. * Properties for the ColumnHeader component.

View file

@ -1,5 +1,5 @@
/** /**
* @file dashboard/header/ActionDropZones.tsx * @file app/(app)/dashboard/header/ActionDropZones.tsx
* @description Client component rendering interactive drop zones for editing and deleting tasks during drag-and-drop operations. * @description Client component rendering interactive drop zones for editing and deleting tasks during drag-and-drop operations.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file dashboard/header/Header.tsx * @file app/(app)/dashboard/header/Header.tsx
* @description Client component rendering the dashboard top header section, including workspace info, deletion drop zones, task creation buttons, and trash links. * @description Client component rendering the dashboard top header section, including workspace info, deletion drop zones, task creation buttons, and trash links.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file dashboard/header/NewTaskButton.tsx * @file app/(app)/dashboard/header/NewTaskButton.tsx
* @description Client component rendering an interactive trigger button for creating new tasks. * @description Client component rendering an interactive trigger button for creating new tasks.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file dashboard/header/TrashLink.tsx * @file app/(app)/dashboard/header/TrashLink.tsx
* @description Client component rendering a navigation link button to the trash view with a dynamic item counter badge fetched via SWR. * @description Client component rendering a navigation link button to the trash view with a dynamic item counter badge fetched via SWR.
*/ */

View file

@ -1,14 +1,14 @@
/** /**
* @file dashboard/page.tsx * @file app/(app)/dashboard/page.tsx
* @description Server component rendering the main dashboard page using the TaskService with DB search filtering. * @description Server component rendering the main dashboard page using the TaskService with DB search filtering.
*/ */
import { auth } from "@/auth"; import { auth } from "@/auth";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import Board from "./Board"; import Board from "./Board";
import { Task } from "@/types/task"; import { Task } from "@/lib/types/task";
import { DbUser } from "@/types/user"; import { DbUser } from "@/lib/types/user";
import { TaskService } from "@/services/task.service"; import { TaskService } from "@/lib/services/task.service";
/** /**
* Renders the primary dashboard view after performing authentication checks, * Renders the primary dashboard view after performing authentication checks,

View file

@ -1,5 +1,5 @@
/** /**
* @file (app)/layout.tsx * @file app/(app)/layout.tsx
* @description Server component layout protecting authenticated routes by verifying user sessions and arranging the main dashboard application structure with responsive sidebars, headers, navigation bars, error toasts, and footers. * @description Server component layout protecting authenticated routes by verifying user sessions and arranging the main dashboard application structure with responsive sidebars, headers, navigation bars, error toasts, and footers.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file member/MemberHeader.tsx * @file app/(app)/member/MemberHeader.tsx
* @description Client component rendering the header section for the team members page. * @description Client component rendering the header section for the team members page.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file MemberProfileCard.tsx * @file app/(app)/member/[id]/MemberProfileCard.tsx
* @description Client component rendering detailed profile information and activity metrics for a specific team member. * @description Client component rendering detailed profile information and activity metrics for a specific team member.
*/ */
@ -10,9 +10,9 @@ import {
getInitials, getInitials,
formatTimeAgo, formatTimeAgo,
capitalize, capitalize,
} from "@/utils/user"; } from "@/lib/utils/user";
import { Mail, Clock, ShieldCheck } from "lucide-react"; import { Mail, Clock, ShieldCheck } from "lucide-react";
import { UserListItem } from "@/types/user"; import { UserListItem } from "@/lib/types/user";
/** /**
* Properties for the MemberProfileCard component. * Properties for the MemberProfileCard component.

View file

@ -1,9 +1,9 @@
/** /**
* @file member/[id]/page.tsx * @file app/(app)/member/[id]/page.tsx
* @description Server component rendering the detailed profile page for a specific member by validating the ID format and fetching user profile data. * @description Server component rendering the detailed profile page for a specific member by validating the ID format and fetching user profile data.
*/ */
import { UserService } from "@/services/user.service"; import { UserService } from "@/lib/services/user.service";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import MemberHeader from "../MemberHeader"; import MemberHeader from "../MemberHeader";
import MemberProfileCard from "./MemberProfileCard"; import MemberProfileCard from "./MemberProfileCard";

View file

@ -1,5 +1,5 @@
/** /**
* @file member/list/MemberItem.tsx * @file app/(app)/member/list/MemberItem.tsx
* @description Client component rendering an individual member item card displaying avatar initials, full name, role badge, email address, online status indicator, and last active timestamp. * @description Client component rendering an individual member item card displaying avatar initials, full name, role badge, email address, online status indicator, and last active timestamp.
*/ */
@ -11,9 +11,9 @@ import {
getStatusColor, getStatusColor,
formatTimeAgo, formatTimeAgo,
capitalize, capitalize,
} from "@/utils/user"; } from "@/lib/utils/user";
import { Mail } from "lucide-react"; import { Mail } from "lucide-react";
import { UserListItem } from "@/types/user"; import { UserListItem } from "@/lib/types/user";
import Link from "next/link"; import Link from "next/link";
/** /**

View file

@ -1,12 +1,12 @@
/** /**
* @file member/list/MemberList.tsx * @file app/(app)/member/list/MemberList.tsx
* @description Client component rendering the list of team members along with the section header and an empty state fallback. * @description Client component rendering the list of team members along with the section header and an empty state fallback.
*/ */
"use client"; "use client";
import MemberHeader from "../MemberHeader"; import MemberHeader from "../MemberHeader";
import { UserListItem } from "@/types/user"; import { UserListItem } from "@/lib/types/user";
import MemberItem from "./MemberItem"; import MemberItem from "./MemberItem";
/** /**

View file

@ -1,10 +1,10 @@
/** /**
* @file member/page.tsx * @file app/(app)/member/page.tsx
* @description Server component rendering the members directory page by fetching all registered users and passing them to the MemberList component. * @description Server component rendering the members directory page by fetching all registered users and passing them to the MemberList component.
*/ */
import MemberList from "./list/MemberList"; import MemberList from "./list/MemberList";
import { UserService } from "@/services/user.service"; import { UserService } from "@/lib/services/user.service";
/** /**
* Renders the member management page displaying all registered users in a list container. * Renders the member management page displaying all registered users in a list container.

View file

@ -1,12 +1,12 @@
/** /**
* @file app/summary/page.tsx * @file app/(app)/summary/page.tsx
* @description Server component rendering an advanced analytical summary page with comprehensive task metrics. * @description Server component rendering an advanced analytical summary page with comprehensive task metrics.
*/ */
import { auth } from "@/auth"; import { auth } from "@/auth";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import { TaskService } from "@/services/task.service"; import { TaskService } from "@/lib/services/task.service";
import { COLUMNS } from "@/types/task"; import { COLUMNS } from "@/lib/types/task";
import SummaryHeader from "./sections/SummaryHeader"; import SummaryHeader from "./sections/SummaryHeader";
import SummaryKpiGrid from "./sections/SummaryKpiGrid"; import SummaryKpiGrid from "./sections/SummaryKpiGrid";
import SummaryStatusCard from "./sections/SummaryStatusCard"; import SummaryStatusCard from "./sections/SummaryStatusCard";

View file

@ -1,5 +1,5 @@
/** /**
* @file app/summary/sections/SummaryHeader.tsx * @file app/(app)/summary/sections/SummaryHeader.tsx
* @description Client component rendering the analytical page header. * @description Client component rendering the analytical page header.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file app/summary/sections/SummaryKpiGrid.tsx * @file app/(app)/summary/sections/SummaryKpiGrid.tsx
* @description Client component rendering the primary KPI metrics grid. * @description Client component rendering the primary KPI metrics grid.
*/ */

View file

@ -1,12 +1,12 @@
/** /**
* @file app/summary/sections/SummaryPriorityCard.tsx * @file app/(app)/summary/sections/SummaryPriorityCard.tsx
* @description Client component rendering the priority severity analysis breakdown. * @description Client component rendering the priority severity analysis breakdown.
*/ */
"use client"; "use client";
import { Flame } from "lucide-react"; import { Flame } from "lucide-react";
import { PRIORITY_CONFIG } from "@/types/task"; import { PRIORITY_CONFIG } from "@/lib/types/task";
/** /**
* Properties for the SummaryPriorityCard component. * Properties for the SummaryPriorityCard component.

View file

@ -1,12 +1,12 @@
/** /**
* @file app/summary/sections/SummaryStatusCard.tsx * @file app/(app)/summary/sections/SummaryStatusCard.tsx
* @description Client component rendering the workflow status distribution progress breakdown. * @description Client component rendering the workflow status distribution progress breakdown.
*/ */
"use client"; "use client";
import { LayoutDashboard } from "lucide-react"; import { LayoutDashboard } from "lucide-react";
import { COLUMNS } from "@/types/task"; import { COLUMNS } from "@/lib/types/task";
/** /**
* Properties for the SummaryStatusCard component. * Properties for the SummaryStatusCard component.

View file

@ -1,5 +1,5 @@
/** /**
* @file tasks/TaskForm.tsx * @file app/(app)/tasks/TaskForm.tsx
* @description Client component orchestrating modular sub-components for task creation and editing. * @description Client component orchestrating modular sub-components for task creation and editing.
*/ */
@ -7,7 +7,7 @@
import { AlertCircle } from "lucide-react"; import { AlertCircle } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { DbTask, TaskStatus } from "@/types/task"; import { DbTask, TaskStatus } from "@/lib/types/task";
import { useTaskForm } from "./useTaskForm"; import { useTaskForm } from "./useTaskForm";
import TaskHeader from "./task/TaskHeader"; import TaskHeader from "./task/TaskHeader";
import TaskBasicInfo from "./task/TaskBasicInfo"; import TaskBasicInfo from "./task/TaskBasicInfo";

View file

@ -1,5 +1,5 @@
/** /**
* @file tasks/page.tsx * @file app/(app)/tasks/page.tsx
* @description Server component rendering the task creation or edit page with relations. * @description Server component rendering the task creation or edit page with relations.
*/ */
@ -9,8 +9,8 @@ import { usersTable } from "@/db/schema";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import TaskForm from "./TaskForm"; import TaskForm from "./TaskForm";
import { not, eq } from "drizzle-orm"; import { not, eq } from "drizzle-orm";
import { TaskService } from "@/services/task.service"; import { TaskService } from "@/lib/services/task.service";
import { TaskStatus } from "@/types/task"; import { TaskStatus } from "@/lib/types/task";
/** /**
* Properties for the TaskPage component. * Properties for the TaskPage component.

View file

@ -1,5 +1,5 @@
/** /**
* @file tasks/task/TaskAssignees.tsx * @file app/(app)/tasks/task/TaskAssignees.tsx
* @description Component for selecting task assignees. * @description Component for selecting task assignees.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file tasks/task/TaskBasicInfo.tsx * @file app/(app)/tasks/task/TaskBasicInfo.tsx
* @description Component for title and description input fields. * @description Component for title and description input fields.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file tasks/task/TaskDateTime.tsx * @file app/(app)/tasks/task/TaskDateTime.tsx
* @description Component for selecting due date and time. * @description Component for selecting due date and time.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file tasks/task/TaskHeader.tsx * @file app/(app)/tasks/task/TaskHeader.tsx
* @description Component rendering the top title header and action buttons for the task view. * @description Component rendering the top title header and action buttons for the task view.
*/ */

View file

@ -1,9 +1,9 @@
/** /**
* @file tasks/task/TaskOptions.tsx * @file app/(app)/tasks/task/TaskOptions.tsx
* @description Component for selecting priority and status using centralized type definitions. * @description Component for selecting priority and status using centralized type definitions.
*/ */
import { TaskPriority, TaskStatus, COLUMNS } from "@/types/task"; import { TaskPriority, TaskStatus, COLUMNS } from "@/lib/types/task";
/** /**
* Properties for the TaskOptions component. * Properties for the TaskOptions component.

View file

@ -1,12 +1,12 @@
/** /**
* @file tasks/useTaskForm.ts * @file app/(app)/tasks/useTaskForm.ts
* @description Custom hook managing state, validation, and submission logic for task creation and editing. * @description Custom hook managing state, validation, and submission logic for task creation and editing.
*/ */
import { useState, useTransition } from "react"; import { useState, useTransition } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { TaskPriority, TaskStatus, DbTask } from "@/types/task"; import { TaskPriority, TaskStatus, DbTask } from "@/lib/types/task";
import { taskSchema } from "@/lib/schemas/task"; import { taskSchema } from "@/lib/schemas/task.schema";
/** /**
* Custom React hook that encapsulates form state management, field updates, assignee toggling, * Custom React hook that encapsulates form state management, field updates, assignee toggling,

View file

@ -1,11 +1,11 @@
/** /**
* @file trash/TrashList.tsx * @file app/(app)/trash/TrashList.tsx
* @description Client component rendering the list of deleted tasks with rich metadata, priority badges, and restore/delete actions. * @description Client component rendering the list of deleted tasks with rich metadata, priority badges, and restore/delete actions.
*/ */
"use client"; "use client";
import { Task, PRIORITY_CONFIG } from "@/types/task"; import { Task, PRIORITY_CONFIG } from "@/lib/types/task";
import { Calendar } from "lucide-react"; import { Calendar } from "lucide-react";
import TaskActionButton from "./components/TaskActionButton"; import TaskActionButton from "./components/TaskActionButton";
import HighlightText from "@/app/components/ui/HighlightText"; import HighlightText from "@/app/components/ui/HighlightText";

View file

@ -1,5 +1,5 @@
/** /**
* @file trash/components/TaskActionButton.tsx * @file app/(app)/trash/components/TaskActionButton.tsx
* @description Client component handling task restoration or permanent deletion requests with loading state and router refresh. * @description Client component handling task restoration or permanent deletion requests with loading state and router refresh.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file trash/components/TrashHeader.tsx * @file app/(app)/trash/components/TrashHeader.tsx
* @description Client component rendering the header section for the trash view, including an icon, title, description, and navigation back to the dashboard. * @description Client component rendering the header section for the trash view, including an icon, title, description, and navigation back to the dashboard.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file trash/page.tsx * @file app/(app)/trash/page.tsx
* @description Server component rendering the trash management view with database search filtering. * @description Server component rendering the trash management view with database search filtering.
*/ */
@ -7,8 +7,8 @@ import { auth } from "@/auth";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import TrashList from "../trash/TrashList"; import TrashList from "../trash/TrashList";
import TrashHeader from "../trash/components/TrashHeader"; import TrashHeader from "../trash/components/TrashHeader";
import { TaskService } from "@/services/task.service"; import { TaskService } from "@/lib/services/task.service";
import { Task } from "@/types/task"; import { Task } from "@/lib/types/task";
/** /**
* Renders the trash page view, fetching soft-deleted tasks for the authenticated user * Renders the trash page view, fetching soft-deleted tasks for the authenticated user

View file

@ -1,5 +1,5 @@
/** /**
* @file (auth)/layout.tsx * @file app/(auth)/layout.tsx
* @description Layout component wrapping authentication views with a centered container structure and fixed bottom footer. * @description Layout component wrapping authentication views with a centered container structure and fixed bottom footer.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file (auth)/login/page.tsx * @file app/(auth)/login/page.tsx
* @description Client component providing a user login interface utilizing the auth service. * @description Client component providing a user login interface utilizing the auth service.
*/ */
@ -8,7 +8,7 @@
import { useState } from "react"; import { useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import Link from "next/link"; import Link from "next/link";
import { loginAsGuest, loginUser } from "@/services/auth.service"; import { loginAsGuest, loginUser } from "@/lib/services/auth.service";
/** /**
* Renders the login page containing the authentication form, error handling, * Renders the login page containing the authentication form, error handling,

View file

@ -1,5 +1,5 @@
/** /**
* @file (auth)/register/page.tsx * @file app/(auth)/register/page.tsx
* @description Client component providing a user registration interface utilizing the auth service. * @description Client component providing a user registration interface utilizing the auth service.
*/ */
@ -8,7 +8,7 @@
import Link from "next/link"; import Link from "next/link";
import { useState } from "react"; import { useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import { registerUser } from "@/services/auth.service"; import { registerUser } from "@/lib/services/auth.service";
/** /**
* Renders the registration page featuring a sign-up form, error feedback, * Renders the registration page featuring a sign-up form, error feedback,

View file

@ -1,9 +1,9 @@
/** /**
* @file app/imprint/page.tsx * @file app/(legal)/imprint/page.tsx
* @description Server component rendering the legal notice (imprint) page with a title header and back button navigation. * @description Server component rendering the legal notice (imprint) page with a title header and back button navigation.
*/ */
import { GoBackButton } from "../components/ui/buttons/GoBackButton"; import { GoBackButton } from "../../components/ui/buttons/GoBackButton";
/** /**
* Renders the imprint/legal notice page containing the main title and layout container. * Renders the imprint/legal notice page containing the main title and layout container.

View file

@ -1,9 +1,9 @@
/** /**
* @file app/privacy/page.tsx * @file app/(legal)/privacy/page.tsx
* @description Server component rendering the privacy policy page with a title header and back button navigation. * @description Server component rendering the privacy policy page with a title header and back button navigation.
*/ */
import { GoBackButton } from "../components/ui/buttons/GoBackButton"; import { GoBackButton } from "../../components/ui/buttons/GoBackButton";
/** /**
* Renders the privacy policy page containing the main title and layout container alongside a back navigation button. * Renders the privacy policy page containing the main title and layout container alongside a back navigation button.

View file

@ -1,5 +1,5 @@
/** /**
* @file route.ts * @file app/api/auth/[...nextauth]/route.ts
* @description API route handler exporting NextAuth authentication request handlers (GET and POST). * @description API route handler exporting NextAuth authentication request handlers (GET and POST).
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file api/auth/guest/route.ts * @file app/api/auth/guest/route.ts
* @description API route handler for guest authentication utilizing server-side environment variables and auto sign-in. * @description API route handler for guest authentication utilizing server-side environment variables and auto sign-in.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file api/auth/register/route.ts * @file app/api/auth/register/route.ts
* @description API route handler for user registration utilizing Zod for validation, bcrypt hashing, and auto sign-in. * @description API route handler for user registration utilizing Zod for validation, bcrypt hashing, and auto sign-in.
*/ */
@ -9,8 +9,8 @@ import { usersTable } from "@/db/schema";
import { eq } from "drizzle-orm"; import { eq } from "drizzle-orm";
import bcrypt from "bcryptjs"; import bcrypt from "bcryptjs";
import { signIn } from "@/auth"; import { signIn } from "@/auth";
import { AVAILABLE_COLORS } from "@/types/user"; import { AVAILABLE_COLORS } from "@/lib/types/user";
import { registerSchema } from "@/lib/schemas/auth"; import { registerSchema } from "@/lib/schemas/auth.schema";
/** /**
* Handles POST requests to register a new user. * Handles POST requests to register a new user.

View file

@ -1,5 +1,5 @@
/** /**
* @file api/health/route.ts * @file app/api/health/route.ts
* @description API route handler performing a database health check by executing a test query and returning the system status. * @description API route handler performing a database health check by executing a test query and returning the system status.
*/ */

View file

@ -6,8 +6,8 @@
import { NextResponse } from "next/server"; import { NextResponse } from "next/server";
import { auth } from "@/auth"; import { auth } from "@/auth";
import { taskStatusEnum } from "@/db/schema"; import { taskStatusEnum } from "@/db/schema";
import { TaskService } from "@/services/task.service"; import { TaskService } from "@/lib/services/task.service";
import { RouteContext, TaskStatus } from "@/types/task"; import { RouteContext, TaskStatus } from "@/lib/types/task";
/** /**
* Handles PATCH requests to either update a task's status or restore a soft-deleted task, * Handles PATCH requests to either update a task's status or restore a soft-deleted task,

View file

@ -1,12 +1,12 @@
/** /**
* @file api/tasks/route.ts * @file app/api/tasks/route.ts
* @description API endpoint for creating and updating task records with strict Zod validation. * @description API endpoint for creating and updating task records with strict Zod validation.
*/ */
import { NextResponse } from "next/server"; import { NextResponse } from "next/server";
import { auth } from "@/auth"; import { auth } from "@/auth";
import { TaskService } from "@/services/task.service"; import { TaskService } from "@/lib/services/task.service";
import { taskSchema } from "@/lib/schemas/task"; import { taskSchema } from "@/lib/schemas/task.schema";
/** /**
* Validates the incoming task request by checking user authentication, parsing the JSON payload, * Validates the incoming task request by checking user authentication, parsing the JSON payload,

View file

@ -1,10 +1,8 @@
/** /**
* @file components/layout/BrandLogo.tsx * @file app/components/layout/BrandLogo.tsx
* @description Client/Server component rendering the application brand logo and title header. * @description Client/Server component rendering the application brand logo and title header.
*/ */
import React from "react";
/** /**
* Renders the brand logo image along with the application name and edition subtitle. * Renders the brand logo image along with the application name and edition subtitle.
* *

View file

@ -1,12 +1,12 @@
/** /**
* @file components/layout/Footer.tsx * @file app/components/layout/Footer.tsx
* @description Client component rendering the site footer with a copyright notice and links to legal pages like Imprint and Privacy Policy. * @description Client component rendering the site footer with a copyright notice and links to legal pages like Imprint and Privacy Policy.
*/ */
"use client"; "use client";
import Link from "next/link"; import Link from "next/link";
import { LEGAL_LINKS, COPYRIGHT_TEXT, ICON_MAP } from "@/utils/legal"; import { LEGAL_LINKS, COPYRIGHT_TEXT, ICON_MAP } from "@/lib/utils/legal";
/** /**
* Renders the site footer containing the dynamic copyright notice and legal compliance links with icons. * Renders the site footer containing the dynamic copyright notice and legal compliance links with icons.

View file

@ -1,5 +1,5 @@
/** /**
* @file components/layout/Header.tsx * @file app/components/layout/Header.tsx
* @description Server component header arranging mobile logo, responsive search bar glued to the logo on mobile, and user badge. * @description Server component header arranging mobile logo, responsive search bar glued to the logo on mobile, and user badge.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file components/layout/MobileLegalMenu.tsx * @file app/components/layout/MobileLegalMenu.tsx
* @description Client component providing a mobile toggle menu for accessing legal links and copyright information in a slide-up overlay. * @description Client component providing a mobile toggle menu for accessing legal links and copyright information in a slide-up overlay.
*/ */
@ -8,8 +8,8 @@
import { useState, useRef, useEffect } from "react"; import { useState, useRef, useEffect } from "react";
import Link from "next/link"; import Link from "next/link";
import { MoreHorizontal, X } from "lucide-react"; import { MoreHorizontal, X } from "lucide-react";
import { LEGAL_LINKS, COPYRIGHT_TEXT, ICON_MAP } from "@/utils/legal"; import { LEGAL_LINKS, COPYRIGHT_TEXT, ICON_MAP } from "@/lib/utils/legal";
import SignOutButton from "../ui/buttons/SignOutButton"; import SignOutButton from "@/app/components/ui/buttons/SignOutButton";
/** /**
* Renders a mobile menu button and a slide-up modal overlay containing * Renders a mobile menu button and a slide-up modal overlay containing

View file

@ -1,5 +1,5 @@
/** /**
* @file components/layout/Navbar.tsx * @file app/components/layout/Navbar.tsx
* @description Client component providing responsive navigation for desktop and mobile views with active route indicators and trash count. * @description Client component providing responsive navigation for desktop and mobile views with active route indicators and trash count.
*/ */

View file

@ -1,11 +1,11 @@
/** /**
* @file components/layout/Sidebar.tsx * @file app/components/layout/Sidebar.tsx
* @description Server/Client component rendering the desktop application sidebar layout including the brand logo, navigation links, and sign-out option. * @description Server/Client component rendering the desktop application sidebar layout including the brand logo, navigation links, and sign-out option.
*/ */
import BrandLogo from "./BrandLogo"; import BrandLogo from "./BrandLogo";
import Navbar from "./Navbar"; import Navbar from "./Navbar";
import SignOutButton from "../ui/buttons/SignOutButton"; import SignOutButton from "@/app/components/ui/buttons/SignOutButton";
/** /**
* Renders the responsive desktop sidebar containing top navigation elements * Renders the responsive desktop sidebar containing top navigation elements

View file

@ -1,11 +1,11 @@
/** /**
* @file UserBadge.tsx * @file app/components/layout/UserBadge.tsx
* @description Server component rendering the authenticated user profile badge with initials, name, and online status. * @description Server component rendering the authenticated user profile badge with initials, name, and online status.
*/ */
import { auth } from "@/auth"; import { auth } from "@/auth";
import { UserService } from "@/services/user.service"; import { UserService } from "@/lib/services/user.service";
import { getInitials } from "@/utils/user"; import { getInitials } from "@/lib/utils/user";
/** /**
* Renders a user profile badge including an avatar initial circle with user color, full name, and online status indicator. * Renders a user profile badge including an avatar initial circle with user color, full name, and online status indicator.

View file

@ -1,5 +1,5 @@
/** /**
* @file components/ErrorToast.tsx * @file app/components/ErrorToast.tsx
* @description Client component displaying a modern floating glassmorphism error notification with a pauseable countdown progress bar driven by requestAnimationFrame. * @description Client component displaying a modern floating glassmorphism error notification with a pauseable countdown progress bar driven by requestAnimationFrame.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file components/ui/HighlightText.tsx * @file app/components/ui/HighlightText.tsx
* @description Component to highlight matching search query terms within a text string. * @description Component to highlight matching search query terms within a text string.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file components/layout/SearchBar.tsx * @file app/components/layout/SearchBar.tsx
* @description Client component managing URL search parameters with debounced input and smooth transition state. * @description Client component managing URL search parameters with debounced input and smooth transition state.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file components/ui/buttons/GoBackButton.tsx * @file app/components/ui/buttons/GoBackButton.tsx
* @description Client component rendering an interactive back button with intelligent history checking and animated hover effects. * @description Client component rendering an interactive back button with intelligent history checking and animated hover effects.
*/ */

View file

@ -1,9 +1,9 @@
/** /**
* @file components/ui/buttons/SignOutButton.tsx * @file app/components/ui/buttons/SignOutButton.tsx
* @description Server Action-powered client component rendering a sign-out button with customizable alignment. * @description Server Action-powered client component rendering a sign-out button with customizable alignment.
*/ */
import { handleSignOut } from "@/actions/auth.actions"; import { handleSignOut } from "@/lib/actions/auth.actions";
import { LogOut } from "lucide-react"; import { LogOut } from "lucide-react";
/** /**

View file

@ -1,5 +1,5 @@
/** /**
* @file layout.tsx * @file app/layout.tsx
* @description Root layout component defining global HTML structure, metadata, and Tailwind styling for the application. * @description Root layout component defining global HTML structure, metadata, and Tailwind styling for the application.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file page.tsx * @file app/page.tsx
* @description Server component acting as the welcome landing page, redirecting authenticated users to the summary view or presenting sign-in and register options. * @description Server component acting as the welcome landing page, redirecting authenticated users to the summary view or presenting sign-in and register options.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file db/index.ts * @file app/db/index.ts
* @description Initializes the PostgreSQL database connection using postgres-js and configures the Drizzle ORM instance. * @description Initializes the PostgreSQL database connection using postgres-js and configures the Drizzle ORM instance.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file db/schema.ts * @file app/db/schema.ts
* @description Defines the PostgreSQL database schema for users, tasks, and task assignees using Drizzle ORM, including custom enums and relations. * @description Defines the PostgreSQL database schema for users, tasks, and task assignees using Drizzle ORM, including custom enums and relations.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file actions/auth.actions.ts * @file app/lib/actions/auth.actions.ts
* @description Server actions for handling user logout and status updates. * @description Server actions for handling user logout and status updates.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file lib/schemas/auth.ts * @file app/lib/schemas/auth.schema.ts
* @description Zod validation schemas for authentication forms, including login and user registration data constraints. * @description Zod validation schemas for authentication forms, including login and user registration data constraints.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file lib/schemas/task.ts * @file app/lib/schemas/task.schema.ts
* @description Zod validation schema for task creation and modification operations, enforcing constraints on title, description, status, priority, dates, and assignees. * @description Zod validation schema for task creation and modification operations, enforcing constraints on title, description, status, priority, dates, and assignees.
*/ */

View file

@ -1,9 +1,9 @@
/** /**
* @file services/auth.service.ts * @file app/lib/services/auth.service.ts
* @description Authentication service providing helper functions for guest credentials, sign-in, and registration. * @description Authentication service providing helper functions for guest credentials, sign-in, and registration.
*/ */
import { loginSchema, registerSchema } from "@/lib/schemas/auth"; import { loginSchema, registerSchema } from "@/lib/schemas/auth.schema";
import { signIn } from "next-auth/react"; import { signIn } from "next-auth/react";
/** /**

View file

@ -1,11 +1,11 @@
/** /**
* @file services/task.service.ts * @file app/lib/services/task.service.ts
* @description Business logic service handling task permissions, database queries, status updates, and soft deletions. * @description Business logic service handling task permissions, database queries, status updates, and soft deletions.
*/ */
import { db } from "@/db"; import { db } from "@/db";
import { tasksTable, taskAssigneesTable, usersTable } from "@/db/schema"; import { tasksTable, taskAssigneesTable, usersTable } from "@/db/schema";
import { DbTask, TaskPayload, TaskStatus } from "@/types/task"; import { DbTask, TaskPayload, TaskStatus } from "@/lib/types/task";
import { import {
and, and,
eq, eq,

View file

@ -1,5 +1,5 @@
/** /**
* @file services/user.service.ts * @file app/lib/services/user.service.ts
* @description Business logic service handling user-related database queries. * @description Business logic service handling user-related database queries.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file types/task.ts * @file app/lib/types/task.ts
* @description Central type definitions and global configurations for task management. * @description Central type definitions and global configurations for task management.
*/ */

View file

@ -1,10 +1,10 @@
/** /**
* @file types/user.ts * @file app/lib/types/user.ts
* @description Type definitions and constants related to user entities and UI preferences. * @description Type definitions and constants related to user entities and UI preferences.
*/ */
import { type User as DbUser } from "@/db/schema"; import { type User as DbUser } from "@/db/schema";
import { UserService } from "@/services/user.service"; import { UserService } from "@/lib/services/user.service";
// ========================================== // ==========================================
// Types // Types

View file

@ -1,5 +1,5 @@
/** /**
* @file utils/legal.ts * @file app/lib/utils/legal.ts
* @description Defines legal navigation configurations, icon mappings, and dynamic copyright text generators. * @description Defines legal navigation configurations, icon mappings, and dynamic copyright text generators.
*/ */

View file

@ -1,5 +1,5 @@
/** /**
* @file utils/user.ts * @file app/lib/utils/user.ts
* @description Utility functions for user formatting, initials generation, and name capitalization. * @description Utility functions for user formatting, initials generation, and name capitalization.
*/ */

View file

@ -1,3 +1,8 @@
/**
* @file next.config.ts
* @description Next.js framework configuration file defining standalone output builds, image optimizations, and Turbopack root settings.
*/
import path from "path"; import path from "path";
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */