A modern, fully-featured timesheet management application built with Next.js 14, TypeScript, and Tailwind CSS. This application allows users to create, manage, and track their weekly timesheets with a clean and intuitive interface.
- π Authentication - Secure login with NextAuth.js
- π Dynamic Timesheet Management - Create timesheets for any week
- βοΈ Task Management - Add, edit, and delete tasks with custom projects
- πΎ Persistent Storage - LocalStorage integration for data persistence
- π Progress Tracking - Visual progress bars and status indicators
- π¨ Fully Responsive - Works seamlessly on mobile, tablet, and desktop
- π No Static Data - All data is user-generated and dynamic
Make sure you have the following installed on your machine:
- Node.js (v18 or higher)
- npm or yarn or pnpm or bun
-
Clone the repository
git clone <repository-url> cd tentwenty-timesheet
-
Install dependencies
npm install # or yarn install # or pnpm install # or bun install
-
Set up environment variables
Create a
.envfile in the root directory:NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your-secret-key-here
-
Run the development server
npm run dev # or yarn dev # or pnpm dev # or bun dev
-
Open your browser
Navigate to http://localhost:3000
For testing purposes, use these credentials:
- Email:
admin@tentwenty.com - Password:
admin123
tentwenty-timesheet/
βββ app/ # Next.js App Router
β βββ api/ # API Routes
β β βββ auth/ # NextAuth.js authentication
β β βββ [...nextauth]/
β β βββ route.ts # Auth configuration & handlers
β βββ dashboard/ # Dashboard pages
β β βββ page.tsx # Main timesheet list page
β β βββ [id]/ # Dynamic timesheet detail pages
β β βββ page.tsx # Individual timesheet view
β βββ login/ # Authentication pages
β β βββ page.tsx # Login page
β βββ layout.tsx # Root layout with providers
β βββ page.tsx # Home page (redirects to dashboard)
β βββ globals.css # Global styles & Tailwind
β
βββ components/ # Reusable React components
β βββ common/ # Common/shared components
β β βββ Footer.tsx # Footer component
β β βββ LoginForm.tsx # Login form with validation
β β βββ Navbar.tsx # Navigation bar
β β βββ TimesheetModal.tsx # Modal for adding/editing tasks
β β βββ TimesheetTable.tsx # Table displaying all timesheets
β βββ providers/ # Context providers
β β βββ Providers.tsx # Wraps app with all providers
β βββ ui/ # UI components (design system)
β βββ button.tsx # Reusable button component
β βββ Dropdown.tsx # Dropdown select component
β βββ input.tsx # Reusable input (text, checkbox)
β βββ pagination.tsx # Pagination controls
β βββ TaskMenu.tsx # Task menu (edit/delete options)
β
βββ context/ # React Context for state management
β βββ AuthContext.tsx # Authentication state & logic
β βββ TimesheetContext.tsx # Timesheet data & CRUD operations
β
βββ hooks/ # Custom React hooks
β βββ useTimesheet.tsx # Hooks for timesheet operations
β
βββ types/ # TypeScript type definitions
β βββ timesheet.ts # Timesheet & Task interfaces
β
βββ utils/ # Utility functions
β βββ dateHelpers.ts # Date manipulation & formatting
β
βββ public/ # Static assets
β βββ *.svg # Icons and images
β
βββ middleware.ts # Next.js middleware (auth protection)
βββ next.config.ts # Next.js configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json # Dependencies & scripts
- Configures NextAuth.js for authentication
- Handles login/logout functionality
- Credentials provider for demo login
- Main dashboard displaying all timesheets in a table
- Features: Create new timesheet, filter by status, pagination
- Shows week number, date range, status badges
- Detailed view of a single timesheet
- Displays tasks grouped by weekday (Mon-Fri)
- Add/edit/delete tasks for each day
- Shows progress bar (hours logged / 40 hours target)
- Login page with email/password form
- Split layout: form on left, branding on right
- Responsive design for mobile
- Root layout wrapping entire app
- Includes all providers (Auth, Timesheet)
- Sets up fonts and metadata
- Handles user authentication
- Uses common Input component for fields
- Integrates with AuthContext for login logic
- Top navigation bar
- User profile dropdown
- Logout functionality
- Modal for adding/editing tasks
- Dynamic input fields (no static dropdowns)
- Pre-fills data when editing existing tasks
- Validates required fields
- Table component displaying all timesheets
- Filter by status (COMPLETED, INCOMPLETE, MISSING)
- Pagination controls
- "Create New Timesheet" button
- Simple footer with copyright
- Reusable button component
- Props:
fullWidth,variant,disabled - Consistent styling across app
- Versatile input component
- Supports: text, email, password, checkbox
checkboxLabelprop for inline labels- Focus states and validation
- Select dropdown component
- Used for filters (date range, status)
- Pagination controls for table
- Change items per page
- Navigate between pages
- Three-dot menu for task actions
- Options: Edit, Delete
- Hover/click to show menu
- Manages authentication state
- Login/logout functions
- User session management
- Error handling
- Centralized timesheet data management
- CRUD operations: Create, Read, Update, Delete
- LocalStorage integration for persistence
- Auto-calculates timesheet status based on hours:
- MISSING: 0 hours logged
- INCOMPLETE: 1-39 hours logged
- COMPLETED: 40+ hours logged
Contains two hooks:
- For detail page - manages individual timesheet
- Returns: tasks grouped by date, progress percentage
- Functions:
addTask,updateTask,deleteTask
- For list page - manages all timesheets
- Handles filtering and pagination
- Functions:
createTimesheet,deleteTimesheet
Defines interfaces for type safety:
interface Task {
id: string;
date: string;
project: string; // User-entered project name
workType: string; // User-entered work type
description: string;
hours: number;
status?: "completed" | "incomplete" | "pending";
}
interface TimesheetRecord {
id: string;
week: number;
dateRange: string;
status: "COMPLETED" | "INCOMPLETE" | "MISSING";
tasks: Task[];
startDate: string;
endDate: string;
}Date manipulation utilities:
- Returns Monday of any given week
- Calculates week dates based on current date + offset
- Returns formatted date strings and week number
- Generates 5 working days (Mon-Fri) from a start date
- Returns array of dates with labels
User enters credentials β AuthContext validates β NextAuth creates session β Redirect to dashboard
Click "Create New Timesheet" β System calculates current week + offset β Creates new timesheet β Saves to localStorage
Click "Add new task" β Modal opens β User enters project, work type, description, hours β Task saved β Status auto-updates
Any CRUD operation β TimesheetContext updates state β useEffect triggers β Data saved to localStorage β Survives page refresh
Task added/updated/deleted β Calculate total hours β Update status:
- 0 hours = MISSING
- 1-39 hours = INCOMPLETE
- 40+ hours = COMPLETED
- Framework: Tailwind CSS
- Custom Theme: Extended in
tailwind.config.ts - Responsive: Mobile-first approach
- Colors:
- Primary:
#FF8A4C(Orange) - Status badges: Green, Yellow, Pink
- Primary:
# Development
npm run dev # Start dev server at localhost:3000
# Production
npm run build # Build for production
npm run start # Start production server
# Code Quality
npm run lint # Run ESLint- No hardcoded projects or work types
- Users enter any text they want
- True flexibility for different workflows
- All data saved automatically
- Survives browser refresh and closure
- No backend required for demo
- Mobile: Stacked layouts, full-width buttons
- Tablet: Hybrid layouts
- Desktop: Side-by-side layouts, optimal spacing
- Full TypeScript coverage
- Interfaces for all data structures
- Type-safe API calls
- Next.js 14 - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS - Utility-first styling
- NextAuth.js - Authentication
- React Hooks - State management
- Lucide React - Icon library
Tentwenty Team
For questions or support, please contact: muhammadahmedite@gmail.com
Made for β€οΈ Tentwenty