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
All checks were successful
Deploy Flowstate to VPS / deploy (push) Successful in 1m27s
This commit is contained in:
parent
9ae5ddaf90
commit
a60851ac07
78 changed files with 163 additions and 138 deletions
31
Dockerfile
31
Dockerfile
|
|
@ -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
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package descriptors and install all project dependencies
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
# 2. Build the application
|
||||
# ------------------------------------------------------------------------------
|
||||
# Stage 2: Build Application
|
||||
# ------------------------------------------------------------------------------
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# Copy node_modules from the dependencies stage and source code
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
# Build the Next.js application for production
|
||||
RUN npm run build
|
||||
|
||||
# 3. Run production image (Node.js server)
|
||||
# ------------------------------------------------------------------------------
|
||||
# Stage 3: Production Execution Server
|
||||
# ------------------------------------------------------------------------------
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
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 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 --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
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
|
||||
|
||||
# Switch to non-root user
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3002
|
||||
|
||||
# Start the standalone Node.js server
|
||||
CMD ["node", "server.js"]
|
||||
11
README.md
11
README.md
|
|
@ -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:
|
||||
|
||||
- `.forgejo/workflows/` — Automated SSH deployment pipeline (`deploy.yml`)
|
||||
- `app/(auth)/` — Public authentication routes (Login, Register)
|
||||
- `app/(app)/` — Protected workspace & dashboard routes (Sidebar, Header, Kanban Board)
|
||||
- `app/api/` — Backend API endpoints & Auth handlers (`/api/auth/register`, `[...nextauth]`)
|
||||
- `db/` — Database schema definitions, migrations, and Drizzle configuration (`drizzle.config.ts`)
|
||||
- `services/` — Business logic layers and external API integration services
|
||||
- `utils/` — Shared helper functions, formatters, and global utility logic
|
||||
- `types/` — Global TypeScript interfaces and type definitions
|
||||
- `lib/` — Centralized core logic folder containing:
|
||||
- `actions/` — Server Actions (e.g., authentication actions)
|
||||
- `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)
|
||||
- `.forgejo/workflows/` — Automated SSH deployment pipeline (`deploy.yml`)
|
||||
|
||||
## 🚀 CI/CD & Deployment
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
import { useState, useTransition } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
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 { mutate } from "swr";
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
import { Loader2 } from "lucide-react";
|
||||
import { Task, TaskStatus } from "@/types/task";
|
||||
import { Task, TaskStatus } from "@/lib/types/task";
|
||||
import CardActions from "./CardActions";
|
||||
import CardAvatars from "./CardAvatars";
|
||||
import CardDueDate from "./CardDueDate";
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
import { useState, useEffect, useRef } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
import { Crown } from "lucide-react";
|
||||
import { Task } from "@/types/task";
|
||||
import { getInitials } from "@/utils/user";
|
||||
import { Task } from "@/lib/types/task";
|
||||
import { getInitials } from "@/lib/utils/user";
|
||||
|
||||
/**
|
||||
* Properties for the UserAvatar component.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { TaskPriority, PRIORITY_CONFIG } from "@/types/task";
|
||||
import { TaskPriority, PRIORITY_CONFIG } from "@/lib/types/task";
|
||||
|
||||
/**
|
||||
* Renders a styled priority badge for a card.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -9,7 +9,7 @@ import { useState } from "react";
|
|||
import Card from "../card/Card";
|
||||
import ColumnHeader from "./ColumnHeader";
|
||||
import ColumnEmptyState from "./ColumnEmptyState";
|
||||
import { ColumnConfig, Task, TaskStatus } from "@/types/task";
|
||||
import { ColumnConfig, Task, TaskStatus } from "@/lib/types/task";
|
||||
|
||||
/**
|
||||
* Properties for the Column component.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { Plus } from "lucide-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { TaskStatus } from "@/types/task";
|
||||
import { TaskStatus } from "@/lib/types/task";
|
||||
|
||||
/**
|
||||
* Properties for the ColumnHeader component.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { auth } from "@/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
import Board from "./Board";
|
||||
import { Task } from "@/types/task";
|
||||
import { DbUser } from "@/types/user";
|
||||
import { TaskService } from "@/services/task.service";
|
||||
import { Task } from "@/lib/types/task";
|
||||
import { DbUser } from "@/lib/types/user";
|
||||
import { TaskService } from "@/lib/services/task.service";
|
||||
|
||||
/**
|
||||
* Renders the primary dashboard view after performing authentication checks,
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -10,9 +10,9 @@ import {
|
|||
getInitials,
|
||||
formatTimeAgo,
|
||||
capitalize,
|
||||
} from "@/utils/user";
|
||||
} from "@/lib/utils/user";
|
||||
import { Mail, Clock, ShieldCheck } from "lucide-react";
|
||||
import { UserListItem } from "@/types/user";
|
||||
import { UserListItem } from "@/lib/types/user";
|
||||
|
||||
/**
|
||||
* Properties for the MemberProfileCard component.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { UserService } from "@/services/user.service";
|
||||
import { UserService } from "@/lib/services/user.service";
|
||||
import { redirect } from "next/navigation";
|
||||
import MemberHeader from "../MemberHeader";
|
||||
import MemberProfileCard from "./MemberProfileCard";
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -11,9 +11,9 @@ import {
|
|||
getStatusColor,
|
||||
formatTimeAgo,
|
||||
capitalize,
|
||||
} from "@/utils/user";
|
||||
} from "@/lib/utils/user";
|
||||
import { Mail } from "lucide-react";
|
||||
import { UserListItem } from "@/types/user";
|
||||
import { UserListItem } from "@/lib/types/user";
|
||||
import Link from "next/link";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
import MemberHeader from "../MemberHeader";
|
||||
import { UserListItem } from "@/types/user";
|
||||
import { UserListItem } from "@/lib/types/user";
|
||||
import MemberItem from "./MemberItem";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { auth } from "@/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
import { TaskService } from "@/services/task.service";
|
||||
import { COLUMNS } from "@/types/task";
|
||||
import { TaskService } from "@/lib/services/task.service";
|
||||
import { COLUMNS } from "@/lib/types/task";
|
||||
import SummaryHeader from "./sections/SummaryHeader";
|
||||
import SummaryKpiGrid from "./sections/SummaryKpiGrid";
|
||||
import SummaryStatusCard from "./sections/SummaryStatusCard";
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
import { Flame } from "lucide-react";
|
||||
import { PRIORITY_CONFIG } from "@/types/task";
|
||||
import { PRIORITY_CONFIG } from "@/lib/types/task";
|
||||
|
||||
/**
|
||||
* Properties for the SummaryPriorityCard component.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
import { LayoutDashboard } from "lucide-react";
|
||||
import { COLUMNS } from "@/types/task";
|
||||
import { COLUMNS } from "@/lib/types/task";
|
||||
|
||||
/**
|
||||
* Properties for the SummaryStatusCard component.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { AlertCircle } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { DbTask, TaskStatus } from "@/types/task";
|
||||
import { DbTask, TaskStatus } from "@/lib/types/task";
|
||||
import { useTaskForm } from "./useTaskForm";
|
||||
import TaskHeader from "./task/TaskHeader";
|
||||
import TaskBasicInfo from "./task/TaskBasicInfo";
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -9,8 +9,8 @@ import { usersTable } from "@/db/schema";
|
|||
import { redirect } from "next/navigation";
|
||||
import TaskForm from "./TaskForm";
|
||||
import { not, eq } from "drizzle-orm";
|
||||
import { TaskService } from "@/services/task.service";
|
||||
import { TaskStatus } from "@/types/task";
|
||||
import { TaskService } from "@/lib/services/task.service";
|
||||
import { TaskStatus } from "@/lib/types/task";
|
||||
|
||||
/**
|
||||
* Properties for the TaskPage component.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file tasks/task/TaskAssignees.tsx
|
||||
* @file app/(app)/tasks/task/TaskAssignees.tsx
|
||||
* @description Component for selecting task assignees.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file tasks/task/TaskBasicInfo.tsx
|
||||
* @file app/(app)/tasks/task/TaskBasicInfo.tsx
|
||||
* @description Component for title and description input fields.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file tasks/task/TaskDateTime.tsx
|
||||
* @file app/(app)/tasks/task/TaskDateTime.tsx
|
||||
* @description Component for selecting due date and time.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { TaskPriority, TaskStatus, COLUMNS } from "@/types/task";
|
||||
import { TaskPriority, TaskStatus, COLUMNS } from "@/lib/types/task";
|
||||
|
||||
/**
|
||||
* Properties for the TaskOptions component.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { useState, useTransition } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { TaskPriority, TaskStatus, DbTask } from "@/types/task";
|
||||
import { taskSchema } from "@/lib/schemas/task";
|
||||
import { TaskPriority, TaskStatus, DbTask } from "@/lib/types/task";
|
||||
import { taskSchema } from "@/lib/schemas/task.schema";
|
||||
|
||||
/**
|
||||
* Custom React hook that encapsulates form state management, field updates, assignee toggling,
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
import { Task, PRIORITY_CONFIG } from "@/types/task";
|
||||
import { Task, PRIORITY_CONFIG } from "@/lib/types/task";
|
||||
import { Calendar } from "lucide-react";
|
||||
import TaskActionButton from "./components/TaskActionButton";
|
||||
import HighlightText from "@/app/components/ui/HighlightText";
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -7,8 +7,8 @@ import { auth } from "@/auth";
|
|||
import { redirect } from "next/navigation";
|
||||
import TrashList from "../trash/TrashList";
|
||||
import TrashHeader from "../trash/components/TrashHeader";
|
||||
import { TaskService } from "@/services/task.service";
|
||||
import { Task } from "@/types/task";
|
||||
import { TaskService } from "@/lib/services/task.service";
|
||||
import { Task } from "@/lib/types/task";
|
||||
|
||||
/**
|
||||
* Renders the trash page view, fetching soft-deleted tasks for the authenticated user
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
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,
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
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.
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
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.
|
||||
|
|
@ -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).
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -9,8 +9,8 @@ import { usersTable } from "@/db/schema";
|
|||
import { eq } from "drizzle-orm";
|
||||
import bcrypt from "bcryptjs";
|
||||
import { signIn } from "@/auth";
|
||||
import { AVAILABLE_COLORS } from "@/types/user";
|
||||
import { registerSchema } from "@/lib/schemas/auth";
|
||||
import { AVAILABLE_COLORS } from "@/lib/types/user";
|
||||
import { registerSchema } from "@/lib/schemas/auth.schema";
|
||||
|
||||
/**
|
||||
* Handles POST requests to register a new user.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import { auth } from "@/auth";
|
||||
import { taskStatusEnum } from "@/db/schema";
|
||||
import { TaskService } from "@/services/task.service";
|
||||
import { RouteContext, TaskStatus } from "@/types/task";
|
||||
import { TaskService } from "@/lib/services/task.service";
|
||||
import { RouteContext, TaskStatus } from "@/lib/types/task";
|
||||
|
||||
/**
|
||||
* Handles PATCH requests to either update a task's status or restore a soft-deleted task,
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { NextResponse } from "next/server";
|
||||
import { auth } from "@/auth";
|
||||
import { TaskService } from "@/services/task.service";
|
||||
import { taskSchema } from "@/lib/schemas/task";
|
||||
import { TaskService } from "@/lib/services/task.service";
|
||||
import { taskSchema } from "@/lib/schemas/task.schema";
|
||||
|
||||
/**
|
||||
* Validates the incoming task request by checking user authentication, parsing the JSON payload,
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
|
||||
/**
|
||||
* Renders the brand logo image along with the application name and edition subtitle.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
"use client";
|
||||
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -8,8 +8,8 @@
|
|||
import { useState, useRef, useEffect } from "react";
|
||||
import Link from "next/link";
|
||||
import { MoreHorizontal, X } from "lucide-react";
|
||||
import { LEGAL_LINKS, COPYRIGHT_TEXT, ICON_MAP } from "@/utils/legal";
|
||||
import SignOutButton from "../ui/buttons/SignOutButton";
|
||||
import { LEGAL_LINKS, COPYRIGHT_TEXT, ICON_MAP } from "@/lib/utils/legal";
|
||||
import SignOutButton from "@/app/components/ui/buttons/SignOutButton";
|
||||
|
||||
/**
|
||||
* Renders a mobile menu button and a slide-up modal overlay containing
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import BrandLogo from "./BrandLogo";
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { auth } from "@/auth";
|
||||
import { UserService } from "@/services/user.service";
|
||||
import { getInitials } from "@/utils/user";
|
||||
import { UserService } from "@/lib/services/user.service";
|
||||
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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { handleSignOut } from "@/actions/auth.actions";
|
||||
import { handleSignOut } from "@/lib/actions/auth.actions";
|
||||
import { LogOut } from "lucide-react";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { loginSchema, registerSchema } from "@/lib/schemas/auth";
|
||||
import { loginSchema, registerSchema } from "@/lib/schemas/auth.schema";
|
||||
import { signIn } from "next-auth/react";
|
||||
|
||||
/**
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { db } from "@/db";
|
||||
import { tasksTable, taskAssigneesTable, usersTable } from "@/db/schema";
|
||||
import { DbTask, TaskPayload, TaskStatus } from "@/types/task";
|
||||
import { DbTask, TaskPayload, TaskStatus } from "@/lib/types/task";
|
||||
import {
|
||||
and,
|
||||
eq,
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file types/task.ts
|
||||
* @file app/lib/types/task.ts
|
||||
* @description Central type definitions and global configurations for task management.
|
||||
*/
|
||||
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
import { type User as DbUser } from "@/db/schema";
|
||||
import { UserService } from "@/services/user.service";
|
||||
import { UserService } from "@/lib/services/user.service";
|
||||
|
||||
// ==========================================
|
||||
// Types
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
@ -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";
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
|
|
|
|||
Loading…
Reference in a new issue