TimeTracker is a powerful, full-stack time tracking application built with Next.js that helps professionals, freelancers, and teams visualize their work hours, analyze productivity, and generate comprehensive reports. Track time across projects, monitor daily activity, and export data in multiple formats.
- β±οΈ Real-time Timer - Start/stop timers with live duration updates (upcoming feature)
- π Interactive Dashboard - Overview of today's activity, active timers, and quick actions
- π Calendar View - Visual representation of time entries with daily breakdowns
- π Advanced Analytics - Charts and graphs to visualize work patterns
- π Multiple Export Formats - Export reports as PDF, Excel, or JSON
- π’ Project Management - Organize time entries by projects (Personal, Office, Client)
- π Workspace Tracking - Distinguish between Office and Home work
- β‘ Time Adjustments - Add or subtract time with reason tracking
- π¨ Modern UI - Clean, professional interface with shadcn/ui components
- π Dark Mode - Seamless light/dark theme switching (upcoming feature)
- π± Responsive Design - Works perfectly on desktop, tablet, and mobile
- π Advanced Filtering - Filter reports by date, project, workspace
- π Visual Analytics - Bar, line, and pie charts for data visualization
- π NextAuth.js Integration - Secure authentication with multiple providers
- π€ User Isolation - Each user sees only their own data
- π Protected Routes - Authentication required for all tracking features
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Forms: React Hook Form + Zod
- Charts: Recharts
- Date Handling: date-fns
- Data Fetching: SWR
- API: Next.js API Routes
- Database: PostgreSQL
- ORM: Prisma
- Authentication: NextAuth.js
- Validation: Zod
- Package Manager: npm
- Code Quality: ESLint, Prettier
- Git Hooks: Husky
- Deployment: Vercel
- Node.js 18+
- PostgreSQL database
- npm
-
Clone the repository
git clone https://github.com/RashedAbdullah/time-entry.git cd time-entry -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Fill in your environment variables (see Environment Variables section)
-
Set up the database
# Run Prisma migrations npx prisma migrate dev --name init # Generate Prisma client npx prisma generate
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
Create a .env file with the following variables:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/timetracker"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here"timetracker/
βββ src/
β βββ app/ # Next.js App Router
β β βββ (auth)/ # Authentication routes
β β β βββ signin/
β β β βββ signup/
β β βββ (dashboard)/ # Protected dashboard routes
β β βββ api/ # API routes
β β βββ auth/
β β βββ projects/
β β βββ reports/
β β βββ time-entries/
β βββ components/ # React components
β β βββ auth/
β β βββ calendar/
β β βββ dashboard/
β β βββ layout/
β β βββ modals/
β β βββ projects/
β β βββ reports/
β β βββ time-entry/
β β βββ ui/ # shadcn/ui components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utilities, configurations
β β βββ api/
β β βββ utils/
β β βββ validations/
β βββ types/ # TypeScript type definitions
βββ prisma/
β βββ schema.prisma # Database schema
βββ public/ # Static assets
βββ ...config files
// prisma/schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
}
model User {
id String @id @default(uuid())
name String
email String @unique
password String
projects Project[]
timeEntries TimeEntry[]
adjustments TimeAdjustment[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([email])
}
model Project {
id String @id @default(uuid())
name String
description String?
type ProjectType @default(OFFICE)
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
userId String
timeEntries TimeEntry[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([userId])
}
model TimeEntry {
id String @id @default(uuid())
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
userId String
project Project? @relation(fields: [projectId], references: [id], onDelete: SetNull)
projectId String?
date DateTime // Entry date (normalized to 00:00:00)
startDateTime DateTime
endTime DateTime?
workspace WorkspaceType @default(OFFICE)
description String?
adjustments TimeAdjustment[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([userId, date])
@@index([projectId])
}
model TimeAdjustment {
id String @id @default(uuid())
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
userId String
timeEntry TimeEntry @relation(fields: [timeEntryId], references: [id], onDelete: Cascade)
timeEntryId String
minutes Int // Negative or positive
reason String?
createdAt DateTime @default(now())
@@index([userId])
@@index([timeEntryId])
}
enum WorkspaceType {
OFFICE
HOME
}
enum ProjectType {
PERSONAL
OFFICE
CLIENT
}POST /api/auth/signup- Register new userGET/POST /api/auth/[...nextauth]- NextAuth authentication
GET /api/projects- Get all projects for userPOST /api/projects- Create new projectGET /api/projects/[id]- Get project detailsPATCH /api/projects/[id]- Update projectDELETE /api/projects/[id]- Delete project
GET /api/time-entries- Get time entries (with filters)POST /api/time-entries- Create time entryGET /api/time-entries/:date- Get today's entriesGET /api/time-entries/active- Get active timerPOST /api/time-entries/start- Start timerPOST /api/time-entries/stop- Stop timerPATCH /api/time-entries/[id]- Update entryDELETE /api/time-entries/[id]- Delete entryPOST /api/time-entries/[id]/adjust- Add time adjustment
GET /api/reports- Generate report with filtersGET /api/reports/export/pdf- Export as PDFGET /api/reports/export/excel- Export as ExcelGET /api/reports/export/json- Export as JSONGET /api/reports/monthly- Get monthly summary
We welcome contributions from the community! Whether it's bug fixes, new features, or documentation improvements, your help is appreciated.
git clone https://github.com/RashedAbdullah/time-entry
cd time-entrygit checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix- Follow the Getting Started guide
- Ensure all tests pass locally
- Maintain code quality with ESLint and Prettier
- Write clean, readable code
- Add comments where necessary
- Update documentation if needed
- Add tests for new features
We follow Conventional Commits:
feat: add new feature
fix: resolve bug
docs: update documentation
style: formatting changes
refactor: code restructuring
test: add tests
chore: maintenance tasks
# Lint code
npm run lint
# Format code
npm run format
# Run tests
npm run test
# Type check
npm run type-check- Push to your fork
- Open a PR to the
mainbranch - Describe your changes in detail
- Link any related issues
- Pick an Issue - Look for good first issues
- Discuss - Comment on the issue to let others know you're working on it
- Code - Follow the guidelines above
- Review - Wait for maintainers to review your PR
- Merge - Once approved, your PR will be merged
- Use TypeScript for all new code
- Follow existing patterns in the codebase
- Use functional components with hooks
- Write meaningful component and variable names
- Add JSDoc comments for complex functions
- Keep components focused and modular
Found a bug? Please include:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Screenshots (if applicable)
- Environment details (browser, OS)
Have an idea? Open an issue with:
- Clear description of the feature
- Use case and benefits
- Mockups or examples (if applicable)
This project is licensed under the MIT License - see the LICENSE file for details.
- shadcn/ui for beautiful components
- Next.js for the amazing framework
- Vercel for hosting
- All our contributors
- Email: contact@rashedabdullah.com
Made with β€οΈ by Rashed Abdullah
rashedabdullah.com
