A modern task management application built with Next.js 16, TypeScript, Prisma, and NextAuth.
- π Secure authentication with NextAuth (GitHub OAuth)
- β Task management - Create, complete, and delete tasks
- π¨ Modern UI with Tailwind CSS and Radix UI components
- β‘ Smooth animations with Framer Motion
- π± Responsive design - Works on all devices
- ποΈ Database with Prisma and SQLite
- π Turbopack for ultra-fast development
- Next.js 16 - React framework with App Router
- TypeScript - Static typing
- React 19 - UI library
- Prisma - ORM for database management
- SQLite - Local database
- NextAuth - OAuth authentication
- Tailwind CSS v4 - Utility-first CSS framework
- Radix UI - Accessible unstyled components
- Framer Motion - Animations and transitions
- Lucide React - Icons
- React Hook Form - Form management
- Zod - Schema validation
- Node.js 20 or higher
- npm or yarn
- Clone the repository
git clone <your-repository>
cd mini-crm- Install dependencies
npm install- Configure environment variables
Create a .env file in the project root:
# Database
DATABASE_URL="file:./dev.db"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here"
# GitHub OAuth
GITHUB_ID="your-github-client-id"
GITHUB_SECRET="your-github-client-secret"- Configure the database
# Generate Prisma client
npx prisma generate
# Run migrations
npx prisma migrate dev- Start the development server
npm run devOpen http://localhost:3000 in your browser.
- Go to GitHub Developer Settings
- Create a new OAuth App
- Configure:
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Homepage URL:
- Copy the Client ID and Client Secret to your
.envfile
mini-crm/
βββ app/ # Next.js App Router
β βββ api/ # API Routes
β β βββ auth/ # Authentication endpoints
β β βββ tasks/ # Task endpoints
β βββ auth/ # Authentication pages
β β βββ signin/ # Login page
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Main page (Task Manager)
βββ components/ # React components
β βββ ui/ # UI components (shadcn/ui)
β β βββ button.tsx
β β βββ card.tsx
β β βββ checkbox.tsx
β β βββ dialog.tsx
β β βββ input.tsx
β β βββ ...
β βββ providers.tsx # Providers (SessionProvider)
βββ lib/ # Utilities and configuration
β βββ api.ts # API client
β βββ db.ts # Database configuration
β βββ prisma.ts # Prisma client
β βββ utils.ts # Utility functions
βββ prisma/ # Prisma schema and migrations
β βββ schema.prisma # Data model definition
β βββ migrations/ # Migration history
βββ public/ # Static files
βββ .env # Environment variables (not in git)
βββ package.json # Project dependencies
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
model Task {
id String @id @default(cuid())
title String
description String?
completed Boolean @default(false)
userId String
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
accounts Account[]
sessions Session[]
tasks Task[]
}# Development
npm run dev # Start development server
# Production
npm run build # Build application for production
npm start # Start production server
# Prisma
npx prisma studio # Open Prisma Studio (DB UI)
npx prisma generate # Generate Prisma client
npx prisma migrate dev # Create and apply migrations
# Linting
npm run lint # Run ESLintGET /api/auth/signin- Login pageGET /api/auth/signout- LogoutGET /api/auth/session- Get current session
GET /api/tasks- Get all user tasksPOST /api/tasks- Create a new taskPUT /api/tasks/[id]- Update a taskDELETE /api/tasks/[id]- Delete a task
Cards use Framer Motion for smooth animations:
<motion.div
initial={{ opacity: 0, scale: 0.95 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.95 }}
transition={{ duration: 0.25 }}
>
{/* Content */}
</motion.div>Tasks animate in and out:
<AnimatePresence mode="popLayout">
{tasks.map((task, index) => (
<motion.div
key={task.id}
initial={{ opacity: 0, x: 20 }}
animate={{ opacity: 1, x: 0 }}
exit={{ opacity: 0, x: -20 }}
transition={{ duration: 0.2, delay: index * 0.05 }}
>
{/* Task card */}
</motion.div>
))}
</AnimatePresence>- β OAuth authentication with GitHub
- β Secure sessions with NextAuth
- β Data validation with Zod
- β CSRF protection
- β Environment variables for secrets
Contributions are welcome. Please:
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Your name - @your-username
β If you found this project helpful, consider giving it a star on GitHub!