A modern, full-stack task management application built with Next.js 16, Prisma ORM, and Tailwind CSS. Organize your tasks efficiently with an intuitive interface and persistent SQLite database.
- β Create Tasks - Add new tasks with title, description, and priority levels
- β Edit Tasks - Update existing task details inline
- β Delete Tasks - Remove completed or unwanted tasks
- β Toggle Completion - Mark tasks as complete or incomplete
- β Priority Levels - Set Low, Medium, or High priority for each task
- β Task Organization - View pending and completed tasks in separate sections
- β Persistent Storage - SQLite database for reliable data persistence
- β Dark Theme - Modern dark interface with black background and white text
- β Server Actions - Secure server-side operations for all database mutations
- Frontend Framework: Next.js 16 with App Router
- Language: TypeScript
- Database ORM: Prisma
- Database: SQLite with Better SQLite3 adapter
- Styling: Tailwind CSS 4
- UI Framework: React 19
- Bundler: Turbopack
.
βββ app/
β βββ action.ts # Server actions for CRUD operations
β βββ layout.tsx # Root layout with dark theme setup
β βββ page.tsx # Home page component
β βββ globals.css # Global styles
βββ components/
β βββ AddTaskButton.tsx # Add task modal toggle button
β βββ TaskForm.tsx # Create/edit task form
β βββ TaskItem.tsx # Individual task card
β βββ TaskList.tsx # Task list container
βββ lib/
β βββ prisma.ts # Prisma client singleton
βββ prisma/
β βββ schema.prisma # Database schema definition
βββ public/ # Static assets
βββ package.json # Dependencies and scripts
βββ tailwind.config.ts # Tailwind configuration
βββ tsconfig.json # TypeScript configuration
βββ next.config.ts # Next.js configuration
- Node.js 18+ or higher
- npm, yarn, or pnpm package manager
- Clone or extract the project:
cd prisma-nextjs-task-management-app- Install dependencies:
npm install
# or
yarn install
# or
pnpm install- Setup environment variables:
Create a .env.local file in the root directory (optional - defaults to file:./dev.db):
DATABASE_URL="file:./dev.db"- Initialize the database:
npx prisma db push- Start the development server:
npm run dev
# or
yarn dev
# or
pnpm dev- Open in browser: Navigate to http://localhost:3000 to see the application.
The application uses a single Task model with the following fields:
model Task {
id Int @id @default(autoincrement())
title String // Task title (required)
description String? // Task description (optional)
completed Boolean @default(false) // Completion status
priority String @default("medium") // Priority: low | medium | high
createdAt DateTime @default(now()) // Creation timestamp
updatedAt DateTime @updatedAt // Last update timestamp
}All database operations are handled through server actions in app/action.ts:
Creates a new task in the database.
- Parameters: FormData with
title,description, andpriority - Returns:
{ error?: string }
Fetches all tasks from the database.
- Parameters: None
- Returns:
Task[](sorted by creation date, newest first)
Toggles the completion status of a task.
- Parameters: Task ID
- Returns: Task update result
Updates an existing task's details.
- Parameters: Task ID and FormData with new values
- Returns:
{ error?: string }
Deletes a task from the database.
- Parameters: Task ID
- Returns: Task deletion result
Modal toggle button for opening the task creation form.
- State:
isOpen- controls modal visibility - Props: None
Reusable form component for creating and editing tasks.
- Props:
task?- Optional task object for edit modeonSuccess?- Callback when submission succeeds
- Features: Validation, error handling, loading states
Individual task card with actions.
- Props:
task- Task object to display - Actions: Edit, Delete, Toggle Completion
- Features: Inline editing, priority badges, completion indicators
Server component that fetches and displays all tasks.
- Props: None
- Features: Separates tasks into pending and completed sections
The application uses a permanent dark theme with:
- Black background (
bg-black) - White text (
text-white) - Dark gray cards (
bg-gray-900) - Colored priority badges:
- Low: Green background
- Medium: Yellow background
- High: Red background
Theme is configured in app/layout.tsx with the dark class on the HTML element.
# Development server
npm run dev
# Build for production
npm run build
# Start production server
npm run start
# Run linter
npm run lint
# Run TypeScript type checking
npm run tscAll tasks are stored in a local SQLite database at ./dev.db. The database is created automatically on first run via Prisma migrations.
To reset the database:
rm dev.db
npx prisma db push# Kill process on port 3000
npx kill-port 3000
# Or use a different port
npm run dev -- -p 3001# Reset Prisma client
rm -rf node_modules/.prisma
# Reinitialize database
npx prisma db push --force-resetThe app uses suppressHydrationWarning on the root HTML element to prevent mismatches between server and client rendering during theme initialization.
The application can be deployed to:
- Vercel - Recommended for Next.js apps (native support)
- Netlify - Via Next.js adapters
For Vercel deployment:
npm install -g vercel
vercelThis project is open source and available under the MIT License.
Built with β€οΈ using Next.js, Prisma, and Tailwind CSS