https://github.com/swastikiiit/task-tracker
A modern task management and time tracking application built with Next.js, featuring AI-powered text suggestions, real-time timers, and comprehensive task organization. Create, edit, and track tasks with intelligent duration monitoring and daily productivity summaries.
https://github.com/swastikiiit/task-tracker
authentication backend cookie hooks jwt nextjs react restapi tailwindcss zustand
Last synced: 8 months ago
JSON representation
A modern task management and time tracking application built with Next.js, featuring AI-powered text suggestions, real-time timers, and comprehensive task organization. Create, edit, and track tasks with intelligent duration monitoring and daily productivity summaries.
- Host: GitHub
- URL: https://github.com/swastikiiit/task-tracker
- Owner: SwastikIIIT
- Created: 2025-09-05T12:16:28.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-09-05T14:28:27.000Z (10 months ago)
- Last Synced: 2025-10-07T04:00:54.065Z (9 months ago)
- Topics: authentication, backend, cookie, hooks, jwt, nextjs, react, restapi, tailwindcss, zustand
- Language: JavaScript
- Homepage: https://task-tracker-three-self.vercel.app
- Size: 121 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Task Tracker Pro ๐โฑ๏ธ
A modern, full-stack task management and time tracking application built with Next.js, featuring real-time timer functionality, AI-powered task suggestions, user authentication, and comprehensive task management.
## โ
Live Demo
๐ **[Live Application](https://task-tracker-three-self.vercel.app)**
*Create your own account to get started - no demo credentials needed!*
## ๐ Features
- **User Authentication** - JWT-based secure login/signup
- **Task Management** - Create, edit, delete, and organize tasks
- **Time Tracking** - Start/stop timers for tasks with duration tracking
- **AI Task Suggestions** - Get intelligent task recommendations powered by Google Gemini
- **Status Management** - Track task progress (Pending, In Progress, Completed)
- **Daily Summary** - View time tracked and task completion statistics
- **Responsive Design** - Works seamlessly on desktop and mobile
- **Real-time Updates** - Instant UI updates with Zustand state management
## ๐ ๏ธ Tech Stack
### Frontend
- **Next.js 15** - React framework with App Router
- **React 19** - UI library
- **Zustand** - Lightweight state management
- **Tailwind CSS** - Utility-first CSS framework
- **JavaScript** - Main programming language
### Backend
- **Next.js API Routes** - Serverless backend functions
- **MongoDB** - NoSQL database with Mongoose ODM
- **JWT** - JSON Web Tokens for authentication
- **bcryptjs** - Password hashing
- **Google Gemini AI** - AI-powered task suggestions
### Deployment
- **Vercel** - Frontend and API deployment
- **MongoDB Atlas** - Cloud database
## ๐ฆ Installation & Setup
### Prerequisites
- Node.js 18+
- npm or yarn
- Git
- MongoDB Atlas account (or local MongoDB)
- Google AI Studio API key
### Local Development Setup
1. **Clone the repository**
```bash
git clone https://github.com/SwastikIIIT/Task-Tracker.git
cd Task-Tracker
```
2. **Install dependencies**
```bash
npm install
```
3. **Environment Setup**
Create a `.env.local` file in the root directory:
```env
# MongoDB Connection
MONGO_URI="mongodb+srv://username:password@cluster.mongodb.net/tasktracker"
# JWT Secret (generate a strong random string)
JWT_SECRET="your-super-secret-jwt-key-here-make-it-long-and-complex"
# Google Gemini AI API Key
GEMINI_API_KEY="your-google-ai-studio-api-key"
```
4. **Database Setup**
- Create a MongoDB Atlas cluster or set up local MongoDB
- Update the `MONGO_URI` with your connection string
- The application will automatically create collections on first run
5. **Start Development Server**
```bash
npm run dev
```
6. **Open Application**
Navigate to `http://localhost:3000`
## ๐ Project Structure
```
Task-Tracker/
โโโ app/ # Next.js App Router
โ โโโ api/ # API routes
โ โ โโโ auth/ # Authentication endpoints
โ โ โ โโโ login/route.js
โ โ โ โโโ signup/route.js
โ โ โโโ tasks/ # Task CRUD operations
โ โ โ โโโ route.js
โ โ โ โโโ [id]/route.js
โ โ โโโ time-logs/ # Time tracking endpoints
โ โ โ โโโ route.js
โ โ โ โโโ [id]/route.js
โ โ โโโ summary/route.js # Dashboard data
โ โ โโโ ai-suggest/route.js # AI task suggestions
โ โโโ components/ # React components (JSX)
โ โ โโโ AuthForm.jsx # Login/signup forms
โ โ โโโ Navbar.jsx # Navigation header
โ โ โโโ TaskForm.jsx # Task creation form
โ โ โโโ TaskList.jsx # Task listing
โ โ โโโ TaskItem.jsx # Individual task component
โ โ โโโ ActiveTimer.jsx # Active timer display
โ โ โโโ DailySummary.jsx # Dashboard summary
โ โโโ stores/ # Zustand state stores
โ โ โโโ authStore.js # Authentication state
โ โ โโโ taskStore.js # Task management state
โ โโโ lib/ # Utility functions
โ โ โโโ actions.js # API calling functions
โ โ โโโ utils.js # Helper utilities
โ โ โโโ middleware.js # JWT middleware
โ โ โโโ auth.js # Authentication helpers
โ โ โโโ connect.js # MongoDB connection
โ โโโ models/ # MongoDB/Mongoose models
โ โ โโโ User.js # User schema
โ โ โโโ Task.js # Task schema
โ โ โโโ Time-Log.js # Time log schema
โ โโโ page.jsx # Main application page
โโโ public/ # Static assets
โโโ package.json # Dependencies and scripts
โโโ README.md # Project documentation
```
## ๐ Authentication
The application uses JWT-based authentication with the following features:
- โ
**Secure Registration** - Email validation and password hashing with bcryptjs
- โ
**Login/Logout** - Persistent sessions with token storage
- โ
**Protected Routes** - API endpoints secured with JWT middleware
- โ
**Auto-login** - Remember user sessions across browser refreshes
## ๐ค AI Features
- **Smart Task Suggestions** - Get AI-powered task recommendations using Google Gemini
- **Context-aware Suggestions** - AI considers your existing tasks and work patterns
- **Productivity Enhancement** - Intelligent suggestions to improve task organization
## ๐ฑ API Endpoints
### Authentication
- `POST /api/auth/signup` - User registration
- `POST /api/auth/login` - User login
### Tasks
- `GET /api/tasks` - Get user tasks
- `POST /api/tasks` - Create new task
- `PUT /api/tasks/[id]` - Update task
- `DELETE /api/tasks/[id]` - Delete task
### Time Tracking
- `GET /api/time-logs` - Get time logs
- `POST /api/time-logs` - Start timer
- `PUT /api/time-logs/[id]/stop` - Stop timer
### Dashboard & AI
- `GET /api/summary` - Get daily summary statistics
- `POST /api/ai-suggest` - Get AI task suggestions
## ๐จ Screenshots
### LoginForm

### DashBoard

## ๐ Deployment
### Deploy to Vercel
1. **Connect Repository**
- Push code to GitHub
- Connect repository to Vercel
2. **Environment Variables**
Add these in Vercel dashboard:
```
MONGO_URI=your_mongodb_atlas_connection_string
JWT_SECRET=your_production_jwt_secret
GEMINI_API_KEY=your_google_ai_studio_api_key
```
3. **Deploy**
```bash
npm run build
vercel --prod
```
### Database Setup (Production)
- Set up MongoDB Atlas cluster
- Whitelist Vercel's IP addresses in Atlas
- Update `MONGO_URI` with production connection string
## ๐งช Testing
```bash
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
```
## ๐ Performance Features
- **Server-side Rendering** - Fast initial page loads
- **API Route Optimization** - Efficient MongoDB queries with Mongoose
- **Client-side State Management** - Efficient state updates with Zustand
- **Code Splitting** - Smaller bundle sizes with Next.js
- **Database Indexing** - Optimized MongoDB queries
## ๐จโ๐ป Author
**Swastik Sharma**
- GitHub: [@SwastikIIIT](https://github.com/SwastikIIIT)
- Email: swastikiiit.05@gmail.com
---
โญ **Star this repository if you found it helpful!**