YouTube-SaaS-Template

This is the template created in Ed's 20 part YouTube course on Vibe Coding Enterprise Applications...

(0 reviews)
3 sales
190 views
by
Edward Honour
YouTube-SaaS-Template

This is the template created in Ed's 20 part YouTube course on Vibe Coding Enterprise Applications
Technologies Used
Alpine.js Bootstrap5 HTML5 htmx JavaScript Linux PHP

  • Easy to Deploy on Linux Servers with Apache

No specific requirements listed.

Compatibility

Last Updated: November 10, 2025

Version: 1.0.0

This is the template created in Ed's 20 part YouTube course on Vibe Coding Enterprise Applications
Technologies Used
Alpine.js Bootstrap5 HTML5 htmx JavaScript Linux PHP
  • Easy to Deploy on Linux Servers with Apache

No specific requirements listed.

Compatibility

Last Updated: November 10, 2025

Version: 1.0.0

Free Templates Available

In order to get access to free templates, please join the free AI Masters Community on Skool.com at https://www.skool.com/ai-masters-community

Once your email is on file you will have access to free templates.

# Requirements Document - Todo List Tracker SaaS Application

## Project Overview

### Product Name
TodoTracker - A comprehensive task management SaaS application

### Version
1.0.0

### Purpose
To provide individuals and teams with a powerful, intuitive web-based todo list and task management system with multiple views (dashboard, kanban, calendar) and full user authentication.

### Target Audience
- Individual users managing personal tasks
- Small teams collaborating on projects
- Professionals requiring organized task tracking
- Anyone needing a reliable, accessible todo list system

## Functional Requirements

### 1. User Authentication & Authorization

#### 1.1 User Registration
- **REQ-AUTH-001**: System shall allow new users to register with email and password
- **REQ-AUTH-002**: Email address must be unique in the system
- **REQ-AUTH-003**: Password must be minimum 8 characters with at least one uppercase, one lowercase, one number
- **REQ-AUTH-004**: System shall send email verification after registration
- **REQ-AUTH-005**: User account must be verified via email before full access is granted
- **REQ-AUTH-006**: System shall collect: email, password, first name, last name during registration
- **REQ-AUTH-007**: System shall provide clear error messages for invalid registration attempts

#### 1.2 User Login
- **REQ-AUTH-101**: Users shall log in with email and password
- **REQ-AUTH-102**: System shall maintain login session using secure cookies
- **REQ-AUTH-103**: System shall provide "Remember Me" option for extended sessions (30 days)
- **REQ-AUTH-104**: System shall lock account after 5 failed login attempts for 15 minutes
- **REQ-AUTH-105**: System shall log all login attempts with timestamp and IP address
- **REQ-AUTH-106**: Users must verify email before being able to log in

#### 1.3 Password Management
- **REQ-AUTH-201**: System shall provide "Forgot Password" functionality
- **REQ-AUTH-202**: Password reset link shall be sent to registered email
- **REQ-AUTH-203**: Password reset link shall expire after 1 hour
- **REQ-AUTH-204**: Users shall be able to change password from settings page
- **REQ-AUTH-205**: Current password must be verified before setting new password
- **REQ-AUTH-206**: Passwords shall be hashed using bcrypt or similar secure algorithm

#### 1.4 User Profile
- **REQ-AUTH-301**: Users shall be able to view and edit profile information
- **REQ-AUTH-302**: Editable fields: first name, last name, email, profile picture
- **REQ-AUTH-303**: Email changes require re-verification
- **REQ-AUTH-304**: Users shall be able to upload profile picture (max 5MB, JPG/PNG)
- **REQ-AUTH-305**: System shall provide account deletion option with confirmation

#### 1.5 Session Management
- **REQ-AUTH-401**: Sessions shall expire after 24 hours of inactivity
- **REQ-AUTH-402**: System shall provide "Logout" functionality
- **REQ-AUTH-403**: Logout shall clear all session data and cookies
- **REQ-AUTH-404**: Users shall be able to view active sessions
- **REQ-AUTH-405**: Users shall be able to terminate specific sessions remotely

### 2. Task Management (CRUD Operations)

#### 2.1 Create Tasks
- **REQ-TASK-001**: Users shall be able to create new tasks
- **REQ-TASK-002**: Task creation shall require: title (required)
- **REQ-TASK-003**: Task creation shall optionally include: description, due date, priority, status, category/tags
- **REQ-TASK-004**: Title shall be limited to 255 characters
- **REQ-TASK-005**: Description shall support up to 5000 characters
- **REQ-TASK-006**: System shall provide quick-add feature for rapid task entry
- **REQ-TASK-007**: Tasks shall be automatically assigned to the creating user
- **REQ-TASK-008**: System shall timestamp task creation

#### 2.2 Read/View Tasks
- **REQ-TASK-101**: Users shall view all their tasks in multiple views (list, grid, kanban, calendar)
- **REQ-TASK-102**: System shall display task count for each status category
- **REQ-TASK-103**: Users shall be able to search tasks by title and description
- **REQ-TASK-104**: Users shall be able to filter tasks by: status, priority, due date, category
- **REQ-TASK-105**: Users shall be able to sort tasks by: due date, priority, creation date, title
- **REQ-TASK-106**: System shall highlight overdue tasks visually
- **REQ-TASK-107**: System shall show tasks due today prominently on dashboard

#### 2.3 Update Tasks
- **REQ-TASK-201**: Users shall be able to edit any task field
- **REQ-TASK-202**: System shall track task modification history (who, when, what changed)
- **REQ-TASK-203**: Users shall be able to quickly change task status with one click
- **REQ-TASK-204**: Users shall be able to mark tasks as complete/incomplete
- **REQ-TASK-205**: System shall timestamp all task updates
- **REQ-TASK-206**: Completed tasks shall be visually distinct with strikethrough text

#### 2.4 Delete Tasks
- **REQ-TASK-301**: Users shall be able to delete tasks
- **REQ-TASK-302**: System shall require confirmation before permanent deletion
- **REQ-TASK-303**: Deleted tasks shall be moved to "Archive" for 30 days before permanent deletion
- **REQ-TASK-304**: Users shall be able to restore archived tasks
- **REQ-TASK-305**: Users shall be able to permanently delete archived tasks
- **REQ-TASK-306**: System shall allow bulk delete operations with confirmation

### 3. Task Properties

#### 3.1 Task Status
- **REQ-PROP-001**: System shall support three status types: Pending, In Progress, Completed
- **REQ-PROP-002**: Default status for new tasks shall be "Pending"
- **REQ-PROP-003**: Status changes shall be logged in task history
- **REQ-PROP-004**: Completed tasks shall record completion timestamp

#### 3.2 Task Priority
- **REQ-PROP-101**: System shall support three priority levels: Low, Medium, High
- **REQ-PROP-102**: Default priority shall be "Medium"
- **REQ-PROP-103**: Priority shall be indicated by colored badges
- **REQ-PROP-104**: High priority tasks shall be highlighted in task lists

#### 3.3 Due Dates
- **REQ-PROP-201**: Tasks may have optional due dates
- **REQ-PROP-202**: System shall warn users of tasks due within 24 hours
- **REQ-PROP-203**: System shall mark overdue tasks in red
- **REQ-PROP-204**: Due date shall accept date only (no time component in v1.0)
- **REQ-PROP-205**: System shall allow filtering by due date ranges

#### 3.4 Categories/Tags
- **REQ-PROP-301**: Users shall be able to create custom categories
- **REQ-PROP-302**: Tasks may have zero or more categories assigned
- **REQ-PROP-303**: Categories shall have customizable colors
- **REQ-PROP-304**: Users shall be able to filter tasks by category
- **REQ-PROP-305**: System shall show category statistics on dashboard

### 4. Dashboard View

#### 4.1 Statistics Display
- **REQ-DASH-001**: Dashboard shall display total task count
- **REQ-DASH-002**: Dashboard shall display count by status (Pending, In Progress, Completed)
- **REQ-DASH-003**: Dashboard shall show completion rate as percentage
- **REQ-DASH-004**: Dashboard shall display number of overdue tasks
- **REQ-DASH-005**: Dashboard shall show tasks due today count

#### 4.2 Recent Tasks
- **REQ-DASH-101**: Dashboard shall display 10 most recently created/updated tasks
- **REQ-DASH-102**: Recent tasks shall show: title, status, priority, due date
- **REQ-DASH-103**: Users shall be able to quick-edit tasks from dashboard

#### 4.3 Upcoming Deadlines
- **REQ-DASH-201**: Dashboard shall display tasks due in next 7 days
- **REQ-DASH-202**: Upcoming tasks shall be sorted by due date
- **REQ-DASH-203**: Overdue tasks shall appear at top of upcoming list

#### 4.4 Progress Visualization
- **REQ-DASH-301**: Dashboard shall display progress bar showing completion percentage
- **REQ-DASH-302**: Dashboard may include simple charts/graphs for task statistics
- **REQ-DASH-303**: Statistics shall update in real-time without page refresh

#### 4.5 Quick Actions
- **REQ-DASH-401**: Dashboard shall provide quick-add task input field
- **REQ-DASH-402**: Dashboard shall provide quick access buttons to all major views
- **REQ-DASH-403**: Dashboard shall allow one-click status changes for displayed tasks

### 5. Kanban Board View

#### 5.1 Board Layout
- **REQ-KANBAN-001**: Kanban board shall display three columns: Pending, In Progress, Completed
- **REQ-KANBAN-002**: Each column shall show task count in header
- **REQ-KANBAN-003**: Columns shall be vertically scrollable independently
- **REQ-KANBAN-004**: Board shall be horizontally scrollable on mobile devices

#### 5.2 Task Cards
- **REQ-KANBAN-101**: Task cards shall display: title, description (truncated), priority, due date
- **REQ-KANBAN-102**: Task cards shall have colored left border indicating priority
- **REQ-KANBAN-103**: Overdue tasks shall have visual warning indicator
- **REQ-KANBAN-104**: Users shall be able to click card to view/edit full details

#### 5.3 Drag and Drop
- **REQ-KANBAN-201**: Users shall be able to drag tasks between columns
- **REQ-KANBAN-202**: Dropping task in new column shall update status automatically
- **REQ-KANBAN-203**: System shall provide visual feedback during drag operation
- **REQ-KANBAN-204**: Status changes via drag-drop shall be saved via HTMX
- **REQ-KANBAN-205**: Failed status updates shall revert card to original position

#### 5.4 Filtering & Sorting
- **REQ-KANBAN-301**: Users shall be able to filter kanban board by priority
- **REQ-KANBAN-302**: Users shall be able to filter by category
- **REQ-KANBAN-303**: Users shall be able to sort cards within columns by due date or priority

### 6. Calendar View

#### 6.1 Calendar Display
- **REQ-CAL-001**: Calendar shall default to month view
- **REQ-CAL-002**: Calendar shall support month, week, and day views
- **REQ-CAL-003**: Calendar shall display current month/week/day prominently
- **REQ-CAL-004**: Users shall be able to navigate between months/weeks/days
- **REQ-CAL-005**: Current day shall be highlighted visually

#### 6.2 Task Display on Calendar
- **REQ-CAL-101**: Tasks with due dates shall appear on calendar on due date
- **REQ-CAL-102**: Tasks shall be displayed as colored badges/pills on date cells
- **REQ-CAL-103**: Badge color shall indicate priority level
- **REQ-CAL-104**: Date cells shall show count if multiple tasks exist
- **REQ-CAL-105**: Clicking task badge shall open task details modal

#### 6.3 Calendar Interactions
- **REQ-CAL-201**: Users shall be able to click date to view all tasks due that day
- **REQ-CAL-202**: Users shall be able to create new task from calendar by clicking date
- **REQ-CAL-203**: New task created from calendar shall auto-populate selected due date
- **REQ-CAL-204**: Calendar shall update dynamically without full page reload

#### 6.4 Navigation
- **REQ-CAL-301**: Calendar shall provide "Today" button to jump to current date
- **REQ-CAL-302**: Calendar shall provide previous/next navigation buttons
- **REQ-CAL-303**: Calendar shall display current month/year in header
- **REQ-CAL-304**: View toggle buttons shall switch between month/week/day views

### 7. Task List/Grid View

#### 7.1 Display Options
- **REQ-LIST-001**: Users shall toggle between list and grid views
- **REQ-LIST-002**: List view shall display tasks in table format
- **REQ-LIST-003**: Grid view shall display tasks as cards in responsive grid
- **REQ-LIST-004**: View preference shall be saved per user session

#### 7.2 List View Features
- **REQ-LIST-101**: Table shall display columns: checkbox, title, status, priority, due date, actions
- **REQ-LIST-102**: Table rows shall be clickable to edit task
- **REQ-LIST-103**: Table shall support row hover effects
- **REQ-LIST-104**: Users shall be able to select multiple tasks via checkboxes
- **REQ-LIST-105**: Bulk actions shall be available for selected tasks

#### 7.3 Grid View Features
- **REQ-LIST-201**: Cards shall display: title, description (truncated), status, priority, due date
- **REQ-LIST-202**: Cards shall be responsive: 1 column mobile, 2 tablet, 3 desktop
- **REQ-LIST-203**: Cards shall have action buttons: edit, complete, delete

#### 7.4 Filtering & Search
- **REQ-LIST-301**: Users shall search tasks by title and description
- **REQ-LIST-302**: Search shall be live/real-time as user types
- **REQ-LIST-303**: Filters shall include: status, priority, due date range, category
- **REQ-LIST-304**: Multiple filters shall work together (AND logic)
- **REQ-LIST-305**: Filter state shall be preserved during session

#### 7.5 Sorting
- **REQ-LIST-401**: Users shall sort by: due date, priority, creation date, title, status
- **REQ-LIST-402**: Sort shall support ascending and descending order
- **REQ-LIST-403**: Sort preference shall be saved during session

#### 7.6 Pagination
- **REQ-LIST-501**: Task list shall paginate at 20 tasks per page (default)
- **REQ-LIST-502**: Users shall be able to change page size: 10, 20, 50, 100
- **REQ-LIST-503**: Pagination controls shall show current page and total pages
- **REQ-LIST-504**: Users shall be able to jump to specific page number

### 8. Categories/Tags Management

#### 8.1 Category CRUD
- **REQ-CAT-001**: Users shall be able to create custom categories
- **REQ-CAT-002**: Category name must be unique per user
- **REQ-CAT-003**: Category name shall be limited to 50 characters
- **REQ-CAT-004**: Users shall be able to assign custom color to categories
- **REQ-CAT-005**: Users shall be able to edit category name and color
- **REQ-CAT-006**: Users shall be able to delete categories
- **REQ-CAT-007**: Deleting category shall not delete tasks, only remove tag

#### 8.2 Category Assignment
- **REQ-CAT-101**: Tasks may have multiple categories assigned
- **REQ-CAT-102**: Categories shall be displayed as colored pill badges
- **REQ-CAT-103**: Users shall add/remove categories from task edit modal
- **REQ-CAT-104**: Category selection shall use dropdown or tag input

#### 8.3 Category Filtering
- **REQ-CAT-201**: Users shall filter tasks by one or more categories
- **REQ-CAT-202**: Category filter shall show task count per category
- **REQ-CAT-203**: Filtering by multiple categories shall use OR logic

### 9. Search Functionality

#### 9.1 Global Search
- **REQ-SEARCH-001**: Search bar shall be accessible from all views in top navigation
- **REQ-SEARCH-002**: Search shall query task title and description
- **REQ-SEARCH-003**: Search shall be case-insensitive
- **REQ-SEARCH-004**: Search results shall display in real-time dropdown
- **REQ-SEARCH-005**: Search dropdown shall show maximum 10 results
- **REQ-SEARCH-006**: Clicking result shall navigate to task or open in modal
- **REQ-SEARCH-007**: "View all results" option shall be available if more than 10 matches

#### 9.2 Advanced Search
- **REQ-SEARCH-101**: Advanced search shall support filtering by all task properties
- **REQ-SEARCH-102**: Date range search shall be supported for due dates
- **REQ-SEARCH-103**: Search results page shall display all matching tasks
- **REQ-SEARCH-104**: Search results shall be sortable and filterable

### 10. Notifications

#### 10.1 Email Notifications
- **REQ-NOTIF-001**: System shall send email for account verification
- **REQ-NOTIF-002**: System shall send email for password reset requests
- **REQ-NOTIF-003**: System shall send daily digest of tasks due that day (optional, user preference)
- **REQ-NOTIF-004**: System shall send reminder 24 hours before task due date (optional)
- **REQ-NOTIF-005**: Users shall be able to enable/disable email notifications in settings

#### 10.2 In-App Notifications
- **REQ-NOTIF-101**: System shall display toast notifications for successful actions
- **REQ-NOTIF-102**: System shall display error messages for failed operations
- **REQ-NOTIF-103**: Notification badge shall appear on bell icon for unread notifications
- **REQ-NOTIF-104**: Clicking bell icon shall show notification dropdown
- **REQ-NOTIF-105**: Users shall be able to mark notifications as read
- **REQ-NOTIF-106**: Users shall be able to clear all notifications

### 11. Settings & Preferences

#### 11.1 Account Settings
- **REQ-SET-001**: Users shall access settings from user dropdown menu
- **REQ-SET-002**: Settings page shall include sections: Profile, Security, Notifications, Preferences
- **REQ-SET-003**: Users shall be able to update profile information
- **REQ-SET-004**: Users shall be able to change password
- **REQ-SET-005**: Users shall be able to enable two-factor authentication (future)

#### 11.2 Notification Preferences
- **REQ-SET-101**: Users shall toggle email notifications on/off
- **REQ-SET-102**: Users shall set daily digest time preference
- **REQ-SET-103**: Users shall enable/disable due date reminders
- **REQ-SET-104**: Users shall set reminder timing (24h, 48h, 1 week before)

#### 11.3 Display Preferences
- **REQ-SET-201**: Users shall toggle between light/dark theme
- **REQ-SET-202**: Users shall set default view (dashboard, list, kanban, calendar)
- **REQ-SET-203**: Users shall set default task sort order
- **REQ-SET-204**: Users shall set pagination page size preference
- **REQ-SET-205**: Theme preference shall be saved and persist across sessions

#### 11.4 Data Management
- **REQ-SET-301**: Users shall be able to export all tasks to CSV
- **REQ-SET-302**: Users shall be able to export to JSON format
- **REQ-SET-303**: Users shall be able to permanently delete archived tasks
- **REQ-SET-304**: Users shall be able to delete account with confirmation
- **REQ-SET-305**: Account deletion shall remove all user data within 30 days

### 12. Archive & Trash

#### 12.1 Archive Functionality
- **REQ-ARCH-001**: Completed tasks older than 30 days shall auto-archive (optional setting)
- **REQ-ARCH-002**: Users shall manually archive tasks
- **REQ-ARCH-003**: Archived tasks shall not appear in normal views
- **REQ-ARCH-004**: Users shall access archived tasks from dedicated archive view
- **REQ-ARCH-005**: Users shall restore archived tasks to active status
- **REQ-ARCH-006**: Archived tasks shall be searchable in archive view

#### 12.2 Trash/Deleted Tasks
- **REQ-ARCH-101**: Deleted tasks shall move to trash for 30 days
- **REQ-ARCH-102**: Users shall view tasks in trash from dedicated view
- **REQ-ARCH-103**: Users shall restore tasks from trash
- **REQ-ARCH-104**: Users shall permanently delete tasks from trash
- **REQ-ARCH-105**: Tasks in trash shall auto-delete after 30 days
- **REQ-ARCH-106**: Users shall be warned before permanent deletion

## Non-Functional Requirements

### 13. Performance

#### 13.1 Response Times
- **REQ-PERF-001**: Page load time shall be under 2 seconds on average connection
- **REQ-PERF-002**: HTMX request/response time shall be under 500ms
- **REQ-PERF-003**: Search results shall appear within 300ms of typing
- **REQ-PERF-004**: Task creation shall complete within 1 second
- **REQ-PERF-005**: Dashboard statistics shall load within 1 second

#### 13.2 Scalability
- **REQ-PERF-101**: System shall support minimum 1,000 concurrent users
- **REQ-PERF-102**: Database shall handle minimum 1,000,000 tasks
- **REQ-PERF-103**: Individual users shall be able to manage 10,000+ tasks
- **REQ-PERF-104**: Pagination shall prevent loading excessive data

#### 13.3 Optimization
- **REQ-PERF-201**: Images shall be optimized and compressed
- **REQ-PERF-202**: CSS/JS shall be minified in production
- **REQ-PERF-203**: Database queries shall use appropriate indexes
- **REQ-PERF-204**: Frequent queries shall be optimized/cached

### 14. Security

#### 14.1 Authentication Security
- **REQ-SEC-001**: Passwords shall be hashed using bcrypt with salt
- **REQ-SEC-002**: Session tokens shall be cryptographically secure
- **REQ-SEC-003**: Session cookies shall have HttpOnly and Secure flags
- **REQ-SEC-004**: Session cookies shall have SameSite=Strict or Lax
- **REQ-SEC-005**: HTTPS shall be enforced for all connections in production

#### 14.2 Authorization
- **REQ-SEC-101**: Users shall only access their own tasks
- **REQ-SEC-102**: All data modification requests shall verify user ownership
- **REQ-SEC-103**: Direct URL access to tasks shall require authentication
- **REQ-SEC-104**: API endpoints shall validate user permissions

#### 14.3 Input Validation
- **REQ-SEC-201**: All user input shall be validated server-side
- **REQ-SEC-202**: SQL injection prevention via prepared statements
- **REQ-SEC-203**: XSS prevention via output escaping
- **REQ-SEC-204**: File uploads shall validate file type and size
- **REQ-SEC-205**: CSRF tokens shall be used for state-changing operations

#### 14.4 Data Protection
- **REQ-SEC-301**: Database connections shall use encrypted connections
- **REQ-SEC-302**: Sensitive data shall not be logged
- **REQ-SEC-303**: Error messages shall not expose system details
- **REQ-SEC-304**: User data shall be isolated per user account
- **REQ-SEC-305**: Regular security audits shall be performed

### 15. Reliability

#### 15.1 Uptime
- **REQ-REL-001**: System shall maintain 99.5% uptime
- **REQ-REL-002**: Planned maintenance shall be scheduled during low-usage periods
- **REQ-REL-003**: Users shall be notified 48 hours before planned maintenance

#### 15.2 Data Integrity
- **REQ-REL-101**: Database shall be backed up daily
- **REQ-REL-102**: Backups shall be retained for 30 days
- **REQ-REL-103**: Database transactions shall ensure data consistency
- **REQ-REL-104**: Failed operations shall not corrupt data

#### 15.3 Error Handling
- **REQ-REL-201**: Application errors shall be logged with timestamp and context
- **REQ-REL-202**: Users shall see friendly error messages, not technical details
- **REQ-REL-203**: Critical errors shall notify system administrators
- **REQ-REL-204**: System shall gracefully handle database connection failures

### 16. Usability

#### 16.1 User Interface
- **REQ-USE-001**: Interface shall be intuitive and require no training
- **REQ-USE-002**: Common actions shall be accessible within 2 clicks
- **REQ-USE-003**: Interface shall provide clear visual feedback for all actions
- **REQ-USE-004**: Error messages shall be clear and actionable
- **REQ-USE-005**: Loading states shall be indicated with spinners/progress indicators

#### 16.2 Accessibility
- **REQ-USE-101**: Site shall meet WCAG 2.1 Level AA standards
- **REQ-USE-102**: All interactive elements shall be keyboard accessible
- **REQ-USE-103**: Color shall not be the only means of conveying information
- **REQ-USE-104**: Alt text shall be provided for all images
- **REQ-USE-105**: Form fields shall have associated labels
- **REQ-USE-106**: Minimum touch target size shall be 44x44 pixels

#### 16.3 Responsive Design
- **REQ-USE-201**: Application shall be fully functional on mobile devices (320px+)
- **REQ-USE-202**: Application shall be fully functional on tablets (768px+)
- **REQ-USE-203**: Application shall be fully functional on desktops (1024px+)
- **REQ-USE-204**: Touch gestures shall be supported on touch devices
- **REQ-USE-205**: Layout shall adapt smoothly to all screen sizes

### 17. Browser Compatibility

#### 17.1 Supported Browsers
- **REQ-COMPAT-001**: Chrome (last 2 versions)
- **REQ-COMPAT-002**: Firefox (last 2 versions)
- **REQ-COMPAT-003**: Safari (last 2 versions)
- **REQ-COMPAT-004**: Edge (last 2 versions)
- **REQ-COMPAT-005**: Mobile Safari (iOS 14+)
- **REQ-COMPAT-006**: Chrome Mobile (Android 10+)

#### 17.2 Progressive Enhancement
- **REQ-COMPAT-101**: Core functionality shall work without JavaScript
- **REQ-COMPAT-102**: Enhanced features shall degrade gracefully
- **REQ-COMPAT-103**: Application shall detect and warn about unsupported browsers

### 18. Data & Privacy

#### 18.1 Data Collection
- **REQ-PRIV-001**: System shall collect only necessary user data
- **REQ-PRIV-002**: Users shall consent to data collection during registration
- **REQ-PRIV-003**: Privacy policy shall be clearly accessible
- **REQ-PRIV-004**: Users shall be able to export their data
- **REQ-PRIV-005**: Users shall be able to delete their account and data

#### 18.2 Data Retention
- **REQ-PRIV-101**: Active tasks shall be retained indefinitely
- **REQ-PRIV-102**: Archived tasks shall be retained for 1 year unless deleted
- **REQ-PRIV-103**: Deleted tasks shall be retained for 30 days then permanently removed
- **REQ-PRIV-104**: Deleted accounts shall be purged after 30 days

#### 18.3 GDPR Compliance (if applicable)
- **REQ-PRIV-201**: Users shall have right to access their data
- **REQ-PRIV-202**: Users shall have right to data portability
- **REQ-PRIV-203**: Users shall have right to deletion
- **REQ-PRIV-204**: Users shall have right to rectification

### 19. Maintenance & Support

#### 19.1 Logging
- **REQ-MAINT-001**: System shall log all errors with stack traces
- **REQ-MAINT-002**: System shall log authentication events
- **REQ-MAINT-003**: System shall log security-related events
- **REQ-MAINT-004**: Logs shall be retained for 90 days
- **REQ-MAINT-005**: Logs shall not contain sensitive user data

#### 19.2 Monitoring
- **REQ-MAINT-101**: System shall monitor application uptime
- **REQ-MAINT-102**: System shall monitor database performance
- **REQ-MAINT-103**: System shall monitor disk space usage
- **REQ-MAINT-104**: Alerts shall be sent for critical issues

#### 19.3 Updates
- **REQ-MAINT-201**: Security updates shall be applied within 7 days
- **REQ-MAINT-202**: Feature updates shall not break existing functionality
- **REQ-MAINT-203**: Database migrations shall be reversible
- **REQ-MAINT-204**: Users shall be notified of major updates

## Technical Constraints

### 20. Technology Stack Constraints
- **REQ-TECH-001**: Must use Ubuntu 24.04 LTS as operating system
- **REQ-TECH-002**: Must use Apache 2.4.x as web server
- **REQ-TECH-003**: Must use MySQL 8.0.x or MariaDB 10.11.x as database
- **REQ-TECH-004**: Must use PHP 8.3.x for backend
- **REQ-TECH-005**: Must use Bootstrap 5.3.x for UI framework
- **REQ-TECH-006**: Must use HTMX 2.x for dynamic interactions
- **REQ-TECH-007**: Must use Alpine.js 3.x for client-side interactivity
- **REQ-TECH-008**: Must use jQuery 3.7.x (for Bootstrap compatibility)

## Out of Scope (Future Versions)

The following features are NOT included in version 1.0:

### Version 2.0+ Features
- Multi-user collaboration and task sharing
- Team workspaces
- Task assignments to other users
- Comments and discussions on tasks
- File attachments to tasks
- Recurring tasks
- Subtasks and task hierarchies
- Time tracking
- Task dependencies
- Gantt chart view
- Mobile native applications (iOS/Android)
- Third-party integrations (Google Calendar, Slack, etc.)
- API for external applications
- Custom fields for tasks
- Advanced reporting and analytics
- Webhooks
- Two-factor authentication (2FA)
- Single Sign-On (SSO)
- White-label options
- Multi-language support

## Acceptance Criteria

### Version 1.0 Launch Criteria
- All functional requirements marked as REQ-* are implemented
- All critical and high-priority bugs are resolved
- Security audit is completed and passed
- Performance benchmarks are met
- User acceptance testing is completed with 90%+ satisfaction
- Documentation is complete (user guide, admin guide)
- Backup and recovery procedures are tested
- Production environment is configured and tested

## Assumptions

1. Users have modern web browsers with JavaScript enabled
2. Users have stable internet connection
3. Application will be hosted on VPS or cloud infrastructure
4. Email service (SMTP) is available for notifications
5. SSL certificate will be obtained for HTTPS
6. Domain name is registered and configured
7. Initial user base is expected to be under 10,000 users
8. English is the only supported language in v1.0

## Dependencies

1. Ubuntu 24.04 LTS server with root access
2. LAMP stack components (Apache, MySQL/MariaDB, PHP)
3. Email service for transactional emails (SMTP server or service like SendGrid)
4. SSL certificate (Let's Encrypt or commercial)
5. Domain name and DNS configuration
6. CDN access for Bootstrap, HTMX, Alpine.js, jQuery libraries

## Risks & Mitigations

### Technical Risks
1. **Risk**: Performance degradation with large task lists
   **Mitigation**: Implement pagination, lazy loading, and database indexing

2. **Risk**: Security vulnerabilities
   **Mitigation**: Follow OWASP guidelines, regular security audits, keep dependencies updated

3. **Risk**: Browser compatibility issues
   **Mitigation**: Thorough testing on all supported browsers, progressive enhancement

### Business Risks
1. **Risk**: Low user adoption
   **Mitigation**: Focus on excellent UX, gather user feedback, iterate quickly

2. **Risk**: Competing with established solutions
   **Mitigation**: Emphasize unique features, simplicity, and value proposition

## Success Metrics

### Key Performance Indicators (KPIs)
1. User registration rate
2. Daily/Monthly active users (DAU/MAU)
3. Average tasks created per user
4. Task completion rate
5. User retention rate (30-day, 90-day)
6. Average session duration
7. Page load times
8. Error rate (< 0.1%)
9. User satisfaction score (target: 4/5 or higher)
10. Support ticket volume (target: < 5% of users)

## Glossary

- **Task**: A single item on the todo list with properties like title, description, status, priority, and due date
- **Category/Tag**: A label that can be applied to tasks for organization
- **Dashboard**: The main overview page showing statistics and recent activity
- **Kanban Board**: A visual workflow board with columns for different task statuses
- **Archive**: Storage area for old or completed tasks not needed in main views
- **CRUD**: Create, Read, Update, Delete operations
- **SaaS**: Software as a Service - web-based application accessed via browser
- **LAMP**: Linux, Apache, MySQL, PHP technology stack
- **HTMX**: Library for accessing AJAX directly in HTML
- **Alpine.js**: Lightweight JavaScript framework for interactivity

## Document Control

- **Version**: 1.0.0
- **Last Updated**: October 20, 2025
- **Document Owner**: Project Manager
- **Approval Status**: Draft
- **Next Review Date**: TBD

## Revision History

| Version | Date | Author | Changes |
|---------|------|--------|---------|
| 1.0.0 | 2025-10-20 | Initial | Initial requirements document creation |
# Tech Stack Documentation

## Project Overview
Todo List Tracker Application - A full-featured task management system built on a traditional LAMP stack.

## Operating System
- **Ubuntu 24.04 LTS** (Note: Ubuntu 24.3 doesn't exist; using 24.04 LTS which is the latest stable release)

## Server Stack (LAMP)

### Web Server
- **Apache 2.4.x**
  - mod_rewrite enabled
  - .htaccess support enabled
  - Virtual hosts configured

### Database
- **MySQL 8.0.x** or **MariaDB 10.11.x**
  - InnoDB storage engine
  - UTF-8 (utf8mb4) character set

### Backend Language
- **PHP 8.3.x**
  - Required Extensions:
    - mysqli or PDO_MySQL
    - json
    - mbstring
    - openssl
  - Configuration:
    - error_reporting enabled for development
    - display_errors off for production
    - session handling enabled

## Frontend Technologies

### CSS Framework
- **Bootstrap 5.3.x**
  - Source: https://getbootstrap.com/
  - Use CDN or local installation
  - Includes Popper.js for tooltips and popovers
  - Responsive grid system
  - Component library (cards, modals, forms, buttons, etc.)

### JavaScript Libraries

#### jQuery
- **jQuery 3.7.x** (required for Bootstrap)
  - Slim build acceptable if not using AJAX features
  - Used primarily for Bootstrap component functionality

#### HTMX
- **HTMX 2.x** (latest version)
  - For dynamic HTML updates without full page reloads
  - AJAX requests with HTML responses
  - Progressive enhancement approach
  - Attributes: hx-get, hx-post, hx-put, hx-delete, hx-target, hx-swap

#### Alpine.js
- **Alpine.js 3.x** (latest version)
  - Lightweight JavaScript framework
  - For interactive UI components
  - Client-side state management
  - Directives: x-data, x-show, x-if, x-for, x-model, x-on

## Application Architecture

### Directory Structure
```
/var/www/html/todo-app/
├── index.php
├── config/
│   └── database.php
├── includes/
│   ├── header.php
│   └── footer.php
├── api/
│   ├── tasks.php
│   ├── create.php
│   ├── update.php
│   └── delete.php
├── assets/
│   ├── css/
│   │   └── custom.css
│   ├── js/
│   │   └── app.js
│   └── images/
└── .htaccess
```

### Database Schema
```sql
CREATE TABLE tasks (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    description TEXT,
    status ENUM('pending', 'in_progress', 'completed') DEFAULT 'pending',
    priority ENUM('low', 'medium', 'high') DEFAULT 'medium',
    due_date DATE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
```

## Integration Strategy

### HTMX + PHP
- PHP endpoints return HTML fragments
- HTMX handles DOM updates without full page reloads
- Use hx-target to specify where responses should be inserted
- Use hx-swap to control how content is swapped

### Alpine.js + Bootstrap
- Alpine.js manages component state (modals, dropdowns)
- Bootstrap provides styling and layout
- Use Alpine for custom interactive behaviors
- Bootstrap JavaScript for complex components (carousels, etc.)

### jQuery + Bootstrap
- jQuery required for Bootstrap's JavaScript components
- Bootstrap JS depends on jQuery for event handling
- Use jQuery for Bootstrap component initialization

## Development Environment Setup

### Apache Configuration
```apache
<VirtualHost *:80>
    ServerName todo-app.local
    DocumentRoot /var/www/html/todo-app
    
    <Directory /var/www/html/todo-app>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ErrorLog ${APACHE_LOG_DIR}/todo-app-error.log
    CustomLog ${APACHE_LOG_DIR}/todo-app-access.log combined
</VirtualHost>
```

### .htaccess Configuration
```apache
RewriteEngine On
RewriteBase /

# Remove .php extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L]

# Security headers
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
```

## CDN Links (for reference)

### Bootstrap 5.3
```html
<!-- CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">

<!-- JavaScript Bundle -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
```

### jQuery
```html
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
```

### HTMX
```html
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
```

### Alpine.js
```html
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
```

## Security Considerations

### PHP Security
- Use prepared statements for all database queries
- Validate and sanitize all user inputs
- Implement CSRF protection
- Use secure session handling
- Set appropriate file permissions (644 for files, 755 for directories)

### Database Security
- Use separate database user with minimal privileges
- Store credentials outside web root
- Use environment variables for sensitive data

### Frontend Security
- Escape output to prevent XSS
- Use HTTPS in production
- Implement Content Security Policy

## Best Practices

### Code Organization
- Separate concerns (presentation, business logic, data access)
- Use PHP includes for reusable components
- Keep API endpoints RESTful
- Use meaningful naming conventions

### HTMX Patterns
- Return HTML fragments from server
- Use hx-indicator for loading states
- Implement proper error handling with hx-on
- Use hx-confirm for destructive actions

### Alpine.js Patterns
- Keep state management simple and local
- Use x-data for component initialization
- Avoid complex logic in templates
- Use Alpine for UI interactions, HTMX for data fetching

### Performance
- Minimize database queries
- Use appropriate indexes
- Enable browser caching
- Compress assets
- Use CDN for libraries

## Testing Checklist
- [ ] Apache serving PHP files correctly
- [ ] Database connection established
- [ ] Bootstrap styles loading
- [ ] jQuery functionality working
- [ ] HTMX requests sending/receiving properly
- [ ] Alpine.js reactivity functioning
- [ ] CRUD operations working
- [ ] Responsive design on mobile devices
- [ ] Cross-browser compatibility

## Documentation References
- Bootstrap: https://getbootstrap.com/docs/5.3/
- HTMX: https://htmx.org/docs/
- Alpine.js: https://alpinejs.dev/
- PHP: https://www.php.net/manual/en/
- MySQL: https://dev.mysql.com/doc/
# Design Notes - Todo List Tracker Application

## Design Overview
A modern, responsive todo list tracker featuring a dashboard, kanban board, calendar view, and comprehensive task management. Built with Bootstrap 5.3 components from https://getbootstrap.com/.

## Color Scheme & Branding

### Primary Colors
- **Primary**: Bootstrap's primary blue (`#0d6efd`) - for main actions, links
- **Success**: Green (`#198754`) - for completed tasks
- **Warning**: Yellow (`#ffc107`) - for pending/due soon tasks
- **Danger**: Red (`#dc3545`) - for overdue tasks
- **Info**: Cyan (`#0dcaf0`) - for in-progress tasks

### Task Status Colors
- **Pending**: Warning (yellow badge)
- **In Progress**: Info (cyan badge)
- **Completed**: Success (green badge with checkmark)

### Priority Colors
- **Low**: Secondary (`#6c757d`)
- **Medium**: Warning (`#ffc107`)
- **High**: Danger (`#dc3545`)

## Layout Structure

### Global Layout
Based on Bootstrap's Dashboard example: https://getbootstrap.com/docs/5.3/examples/dashboard/

```
┌─────────────────────────────────────────┐
│           Top Navigation Bar             │
├──────┬──────────────────────────────────┤
│      │                                   │
│ Side │      Main Content Area            │
│ Nav  │                                   │
│      │                                   │
└──────┴──────────────────────────────────┘
```

### Navigation Structure

#### Top Navbar
- **Component**: Navbar (Fixed top)
- **Reference**: https://getbootstrap.com/docs/5.3/components/navbar/
- **Elements**:
  - Brand/Logo (left)
  - Search bar (center) - for quick task search
  - User dropdown (right) - profile, settings, logout
  - Notification bell icon with badge
  - Theme toggle (light/dark mode)

```html
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
  <div class="container-fluid">
    <a class="navbar-brand" href="#">TodoTracker</a>
    <button class="navbar-toggler" ...>
    <div class="collapse navbar-collapse">
      <form class="d-flex mx-auto" style="width: 50%;">
        <input class="form-control" type="search" placeholder="Search tasks...">
      </form>
      <ul class="navbar-nav ms-auto">
        <!-- Notifications, Profile dropdown -->
      </ul>
    </div>
  </div>
</nav>
```

#### Sidebar Navigation
- **Component**: Offcanvas/Sidebar
- **Reference**: https://getbootstrap.com/docs/5.3/examples/sidebars/
- **Width**: 250px on desktop, collapsible on mobile
- **Menu Items**:
  - Dashboard (icon: speedometer)
  - All Tasks (icon: list)
  - Kanban Board (icon: columns)
  - Calendar (icon: calendar)
  - Categories/Tags (icon: tags)
  - Archived (icon: archive)
  - Settings (icon: gear)

```html
<div class="sidebar border-end bg-light" style="width: 250px; min-height: 100vh;">
  <div class="list-group list-group-flush">
    <a href="#" class="list-group-item list-group-item-action active">
      <i class="bi bi-speedometer2 me-2"></i>Dashboard
    </a>
    <!-- More items -->
  </div>
</div>
```

## Page Layouts

### 1. Dashboard View

#### Layout Grid
- **Reference**: https://getbootstrap.com/docs/5.3/examples/dashboard/
- **Structure**: 2-3 column layout with cards

#### Top Statistics Row
- **Component**: Cards with stats
- **Reference**: https://getbootstrap.com/docs/5.3/components/card/
- **Layout**: 4 columns on desktop, stacked on mobile

```html
<div class="row g-3 mb-4">
  <div class="col-lg-3 col-md-6">
    <div class="card text-white bg-primary">
      <div class="card-body">
        <h5 class="card-title">Total Tasks</h5>
        <h2 class="mb-0">47</h2>
      </div>
    </div>
  </div>
  <div class="col-lg-3 col-md-6">
    <div class="card text-white bg-warning">
      <div class="card-body">
        <h5 class="card-title">Pending</h5>
        <h2 class="mb-0">23</h2>
      </div>
    </div>
  </div>
  <!-- Repeat for In Progress, Completed -->
</div>
```

#### Recent Tasks Section
- **Component**: List Group
- **Reference**: https://getbootstrap.com/docs/5.3/components/list-group/
- **Features**:
  - Task title and description
  - Priority badge
  - Status badge
  - Due date
  - Action buttons (edit, delete)

```html
<div class="card">
  <div class="card-header">
    <h5 class="mb-0">Recent Tasks</h5>
  </div>
  <ul class="list-group list-group-flush">
    <li class="list-group-item d-flex justify-content-between align-items-start">
      <div class="ms-2 me-auto">
        <div class="fw-bold">Task Title</div>
        <small class="text-muted">Task description...</small>
        <div class="mt-1">
          <span class="badge bg-danger">High</span>
          <span class="badge bg-info">In Progress</span>
        </div>
      </div>
      <div>
        <small class="text-muted">Due: Oct 25</small>
        <div class="btn-group btn-group-sm mt-1">
          <button class="btn btn-outline-primary">Edit</button>
          <button class="btn btn-outline-danger">Delete</button>
        </div>
      </div>
    </li>
  </ul>
</div>
```

#### Task Progress Chart
- **Component**: Progress bars
- **Reference**: https://getbootstrap.com/docs/5.3/components/progress/
- **Display**: Overall completion percentage

#### Upcoming Deadlines
- **Component**: Timeline-style list
- **Shows**: Tasks due in next 7 days
- **Style**: List group with colored left border for priority

### 2. Kanban Board View

#### Layout
- **Reference**: Bootstrap Grid + Cards
- **Structure**: 3-4 columns (Pending, In Progress, Completed, Archived)
- **Horizontal scroll**: On mobile devices

```html
<div class="row g-3">
  <div class="col-lg-3 col-md-6">
    <div class="card">
      <div class="card-header bg-warning text-dark">
        <h5 class="mb-0">Pending <span class="badge bg-dark">12</span></h5>
      </div>
      <div class="card-body p-2" style="max-height: 70vh; overflow-y: auto;">
        <!-- Kanban task cards -->
        <div class="card mb-2 shadow-sm">
          <div class="card-body p-2">
            <h6 class="card-title">Task Title</h6>
            <p class="card-text small">Brief description...</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="badge bg-danger">High</span>
              <small class="text-muted">Oct 25</small>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- Repeat for other columns -->
</div>
```

#### Kanban Card Features
- Draggable cards (use HTMX for drag-drop updates)
- Color-coded priority indicator (left border)
- Assignee avatar (if multi-user)
- Due date badge
- Task tags/categories
- Quick action buttons on hover

### 3. Calendar View

#### Calendar Header
- **Component**: Buttons + Dropdown
- **Navigation**: Previous/Next month buttons
- **View options**: Month, Week, Day views

#### Calendar Grid
- **Component**: Table
- **Reference**: https://getbootstrap.com/docs/5.3/content/tables/
- **Structure**: 7-column grid (days of week)

```html
<div class="card">
  <div class="card-header">
    <div class="d-flex justify-content-between align-items-center">
      <div class="btn-group">
        <button class="btn btn-outline-primary btn-sm">← Prev</button>
        <button class="btn btn-outline-primary btn-sm">Today</button>
        <button class="btn btn-outline-primary btn-sm">Next →</button>
      </div>
      <h4 class="mb-0">October 2025</h4>
      <div class="btn-group">
        <button class="btn btn-outline-secondary btn-sm active">Month</button>
        <button class="btn btn-outline-secondary btn-sm">Week</button>
        <button class="btn btn-outline-secondary btn-sm">Day</button>
      </div>
    </div>
  </div>
  <div class="card-body p-0">
    <table class="table table-bordered mb-0">
      <thead>
        <tr>
          <th>Sun</th><th>Mon</th><!-- ... --><th>Sat</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="p-2 align-top" style="height: 100px;">
            <div class="fw-bold">1</div>
            <div class="badge bg-warning text-dark w-100 text-start small">
              Task title
            </div>
          </td>
          <!-- More days -->
        </tr>
      </tbody>
    </table>
  </div>
</div>
```

#### Calendar Day Cell
- Date number (top)
- Task indicators (colored dots or mini badges)
- Click to see day's tasks
- Different background for today
- Muted background for other months

### 4. Task List View (All Tasks)

#### Filters & Sorting
- **Component**: Button group + Dropdowns
- **Reference**: https://getbootstrap.com/docs/5.3/components/button-group/
- **Options**:
  - Filter by: Status, Priority, Category, Date range
  - Sort by: Due date, Created date, Priority, Title
  - View: List or Grid

```html
<div class="d-flex justify-content-between align-items-center mb-3">
  <div class="btn-group">
    <button class="btn btn-sm btn-outline-secondary dropdown-toggle">
      Filter: All Status
    </button>
    <button class="btn btn-sm btn-outline-secondary dropdown-toggle">
      Priority: All
    </button>
  </div>
  <div class="btn-group">
    <button class="btn btn-sm btn-outline-secondary">List</button>
    <button class="btn btn-sm btn-outline-secondary active">Grid</button>
  </div>
</div>
```

#### Task Cards (Grid View)
- **Component**: Cards in grid
- **Layout**: 3 columns on desktop, 1 on mobile

```html
<div class="row g-3">
  <div class="col-lg-4 col-md-6">
    <div class="card h-100">
      <div class="card-body">
        <div class="d-flex justify-content-between mb-2">
          <span class="badge bg-danger">High</span>
          <span class="badge bg-info">In Progress</span>
        </div>
        <h5 class="card-title">Task Title</h5>
        <p class="card-text">Task description goes here...</p>
        <div class="d-flex justify-content-between align-items-center">
          <small class="text-muted">
            <i class="bi bi-calendar"></i> Oct 25, 2025
          </small>
          <div class="btn-group btn-group-sm">
            <button class="btn btn-outline-primary">Edit</button>
            <button class="btn btn-outline-success">✓</button>
            <button class="btn btn-outline-danger">×</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
```

#### Task Table (List View)
- **Component**: Table
- **Reference**: https://getbootstrap.com/docs/5.3/content/tables/
- **Features**: Striped, hoverable rows, responsive

## Forms & Modals

### Add/Edit Task Modal
- **Component**: Modal
- **Reference**: https://getbootstrap.com/docs/5.3/components/modal/
- **Size**: Large modal
- **Form Elements**:
  - Task title (required)
  - Description (textarea)
  - Status (select dropdown)
  - Priority (select dropdown)
  - Due date (date picker)
  - Category/Tags (select with tags)
  - Attachments (file upload)

```html
<div class="modal fade" id="taskModal" tabindex="-1">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Add New Task</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
      </div>
      <div class="modal-body">
        <form>
          <div class="mb-3">
            <label class="form-label">Task Title *</label>
            <input type="text" class="form-control" required>
          </div>
          <div class="mb-3">
            <label class="form-label">Description</label>
            <textarea class="form-control" rows="3"></textarea>
          </div>
          <div class="row">
            <div class="col-md-4 mb-3">
              <label class="form-label">Status</label>
              <select class="form-select">
                <option>Pending</option>
                <option>In Progress</option>
                <option>Completed</option>
              </select>
            </div>
            <div class="col-md-4 mb-3">
              <label class="form-label">Priority</label>
              <select class="form-select">
                <option>Low</option>
                <option>Medium</option>
                <option>High</option>
              </select>
            </div>
            <div class="col-md-4 mb-3">
              <label class="form-label">Due Date</label>
              <input type="date" class="form-control">
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
        <button type="button" class="btn btn-primary">Save Task</button>
      </div>
    </div>
  </div>
</div>
```

### Quick Add Form (Dashboard)
- **Component**: Input group + Button
- **Reference**: https://getbootstrap.com/docs/5.3/forms/input-group/
- **Location**: Top of dashboard, always visible

```html
<div class="card mb-4">
  <div class="card-body">
    <div class="input-group input-group-lg">
      <input type="text" class="form-control" placeholder="Quick add a task...">
      <button class="btn btn-primary" type="button">
        <i class="bi bi-plus-lg"></i> Add Task
      </button>
    </div>
  </div>
</div>
```

## Interactive Components

### Toast Notifications
- **Component**: Toast
- **Reference**: https://getbootstrap.com/docs/5.3/components/toasts/
- **Usage**: Success/error feedback
- **Position**: Top-right corner

```html
<div class="toast-container position-fixed top-0 end-0 p-3">
  <div class="toast" role="alert">
    <div class="toast-header">
      <strong class="me-auto">Success</strong>
      <button type="button" class="btn-close" data-bs-dismiss="toast"></button>
    </div>
    <div class="toast-body">
      Task created successfully!
    </div>
  </div>
</div>
```

### Confirmation Dialogs
- **Component**: Modal (small)
- **Usage**: Delete confirmations, important actions

### Loading States
- **Component**: Spinner
- **Reference**: https://getbootstrap.com/docs/5.3/components/spinners/
- **Usage**: During HTMX requests

```html
<div class="htmx-indicator">
  <div class="spinner-border text-primary" role="status">
    <span class="visually-hidden">Loading...</span>
  </div>
</div>
```

### Badges
- **Component**: Badges
- **Reference**: https://getbootstrap.com/docs/5.3/components/badge/
- **Usage**: Status, priority, counts

## Additional Features

### Search Results
- **Component**: Dropdown menu (live search)
- **Reference**: https://getbootstrap.com/docs/5.3/components/dropdowns/
- **Appears**: Below search input as you type

### Filters Panel
- **Component**: Offcanvas
- **Reference**: https://getbootstrap.com/docs/5.3/components/offcanvas/
- **Trigger**: Filter button
- **Content**: All filter options with checkboxes

### Settings Page
- **Component**: Form + Accordion
- **Reference**: https://getbootstrap.com/docs/5.3/components/accordion/
- **Sections**:
  - Profile settings
  - Notification preferences
  - Theme settings
  - Data management

### Task Categories/Tags
- **Component**: Pills
- **Reference**: https://getbootstrap.com/docs/5.3/components/badge/#pills
- **Display**: Colored pill badges
- **Management**: Modal for CRUD operations

## Responsive Design

### Breakpoints
- **Mobile**: < 576px (stack all cards, hamburger menu)
- **Tablet**: 576px - 991px (2-column layout)
- **Desktop**: ≥ 992px (full layout with sidebar)

### Mobile Optimizations
- Collapsible sidebar (offcanvas)
- Bottom navigation for key actions
- Swipe gestures for kanban board
- Simplified forms
- Larger touch targets (min 44x44px)

### Desktop Enhancements
- Keyboard shortcuts
- Hover effects
- Multi-select capabilities
- Drag-and-drop functionality

## Icons

### Icon Library
- **Bootstrap Icons**: https://icons.getbootstrap.com/
- **CDN**: Include Bootstrap Icons CSS
- **Usage**: `<i class="bi bi-icon-name"></i>`

### Key Icons
- Dashboard: `bi-speedometer2`
- Tasks: `bi-list-task`
- Calendar: `bi-calendar3`
- Add: `bi-plus-circle`
- Edit: `bi-pencil`
- Delete: `bi-trash`
- Check: `bi-check-circle`
- Clock: `bi-clock`
- Tag: `bi-tag`
- Filter: `bi-funnel`

## Animation & Transitions

### CSS Transitions
- Smooth hover effects (0.3s ease)
- Card elevations on hover
- Button state changes
- Sidebar collapse/expand

### HTMX Transitions
- **Reference**: https://htmx.org/examples/animations/
- Fade in/out for content swaps
- Slide transitions for modals
- Loading indicators

## Accessibility

### Requirements
- Semantic HTML5 elements
- ARIA labels for icon-only buttons
- Keyboard navigation support
- Focus indicators
- Color contrast ratio ≥ 4.5:1
- Screen reader friendly text

### Bootstrap Built-in
- Form validation feedback
- Visually hidden labels where needed
- Proper heading hierarchy
- Skip navigation links

## Dark Mode Support (Optional)

### Implementation
- Bootstrap's data-bs-theme attribute
- Toggle button in navbar
- LocalStorage to persist preference
- Custom CSS variables for custom colors

```html
<html data-bs-theme="dark">
```

## Performance Considerations

### Optimization
- Lazy load calendar months
- Paginate task lists (20-50 items)
- Minimize DOM updates with HTMX
- Use Alpine.js for local state only
- Optimize images and assets

### Loading Strategy
- Critical CSS inline
- Defer non-critical JavaScript
- Use CDN for Bootstrap libraries
- Enable gzip compression

## Bootstrap Component Reference

### Primary Components Used
1. **Navbar**: https://getbootstrap.com/docs/5.3/components/navbar/
2. **Cards**: https://getbootstrap.com/docs/5.3/components/card/
3. **List Groups**: https://getbootstrap.com/docs/5.3/components/list-group/
4. **Modal**: https://getbootstrap.com/docs/5.3/components/modal/
5. **Forms**: https://getbootstrap.com/docs/5.3/forms/overview/
6. **Tables**: https://getbootstrap.com/docs/5.3/content/tables/
7. **Buttons**: https://getbootstrap.com/docs/5.3/components/buttons/
8. **Badges**: https://getbootstrap.com/docs/5.3/components/badge/
9. **Progress**: https://getbootstrap.com/docs/5.3/components/progress/
10. **Toasts**: https://getbootstrap.com/docs/5.3/components/toasts/
11. **Offcanvas**: https://getbootstrap.com/docs/5.3/components/offcanvas/
12. **Dropdowns**: https://getbootstrap.com/docs/5.3/components/dropdowns/

## Design Principles

1. **Consistency**: Use Bootstrap's design system throughout
2. **Clarity**: Clear visual hierarchy with typography scale
3. **Efficiency**: Minimize clicks to complete tasks
4. **Feedback**: Immediate visual feedback for all actions
5. **Accessibility**: Ensure usability for all users
6. **Responsiveness**: Mobile-first, progressive enhancement
7. **Performance**: Fast load times, smooth interactions

# Requirements Document - Todo List Tracker SaaS Application

## Project Overview

### Product Name
TodoTracker - A comprehensive task management SaaS application

### Version
1.0.0

### Purpose
To provide individuals and teams with a powerful, intuitive web-based todo list and task management system with multiple views (dashboard, kanban, calendar) and full user authentication.

### Target Audience
- Individual users managing personal tasks
- Small teams collaborating on projects
- Professionals requiring organized task tracking
- Anyone needing a reliable, accessible todo list system

## Functional Requirements

### 1. User Authentication & Authorization

#### 1.1 User Registration
- **REQ-AUTH-001**: System shall allow new users to register with email and password
- **REQ-AUTH-002**: Email address must be unique in the system
- **REQ-AUTH-003**: Password must be minimum 8 characters with at least one uppercase, one lowercase, one number
- **REQ-AUTH-004**: System shall send email verification after registration
- **REQ-AUTH-005**: User account must be verified via email before full access is granted
- **REQ-AUTH-006**: System shall collect: email, password, first name, last name during registration
- **REQ-AUTH-007**: System shall provide clear error messages for invalid registration attempts

#### 1.2 User Login
- **REQ-AUTH-101**: Users shall log in with email and password
- **REQ-AUTH-102**: System shall maintain login session using secure cookies
- **REQ-AUTH-103**: System shall provide "Remember Me" option for extended sessions (30 days)
- **REQ-AUTH-104**: System shall lock account after 5 failed login attempts for 15 minutes
- **REQ-AUTH-105**: System shall log all login attempts with timestamp and IP address
- **REQ-AUTH-106**: Users must verify email before being able to log in

#### 1.3 Password Management
- **REQ-AUTH-201**: System shall provide "Forgot Password" functionality
- **REQ-AUTH-202**: Password reset link shall be sent to registered email
- **REQ-AUTH-203**: Password reset link shall expire after 1 hour
- **REQ-AUTH-204**: Users shall be able to change password from settings page
- **REQ-AUTH-205**: Current password must be verified before setting new password
- **REQ-AUTH-206**: Passwords shall be hashed using bcrypt or similar secure algorithm

#### 1.4 User Profile
- **REQ-AUTH-301**: Users shall be able to view and edit profile information
- **REQ-AUTH-302**: Editable fields: first name, last name, email, profile picture
- **REQ-AUTH-303**: Email changes require re-verification
- **REQ-AUTH-304**: Users shall be able to upload profile picture (max 5MB, JPG/PNG)
- **REQ-AUTH-305**: System shall provide account deletion option with confirmation

#### 1.5 Session Management
- **REQ-AUTH-401**: Sessions shall expire after 24 hours of inactivity
- **REQ-AUTH-402**: System shall provide "Logout" functionality
- **REQ-AUTH-403**: Logout shall clear all session data and cookies
- **REQ-AUTH-404**: Users shall be able to view active sessions
- **REQ-AUTH-405**: Users shall be able to terminate specific sessions remotely

### 2. Task Management (CRUD Operations)

#### 2.1 Create Tasks
- **REQ-TASK-001**: Users shall be able to create new tasks
- **REQ-TASK-002**: Task creation shall require: title (required)
- **REQ-TASK-003**: Task creation shall optionally include: description, due date, priority, status, category/tags
- **REQ-TASK-004**: Title shall be limited to 255 characters
- **REQ-TASK-005**: Description shall support up to 5000 characters
- **REQ-TASK-006**: System shall provide quick-add feature for rapid task entry
- **REQ-TASK-007**: Tasks shall be automatically assigned to the creating user
- **REQ-TASK-008**: System shall timestamp task creation

#### 2.2 Read/View Tasks
- **REQ-TASK-101**: Users shall view all their tasks in multiple views (list, grid, kanban, calendar)
- **REQ-TASK-102**: System shall display task count for each status category
- **REQ-TASK-103**: Users shall be able to search tasks by title and description
- **REQ-TASK-104**: Users shall be able to filter tasks by: status, priority, due date, category
- **REQ-TASK-105**: Users shall be able to sort tasks by: due date, priority, creation date, title
- **REQ-TASK-106**: System shall highlight overdue tasks visually
- **REQ-TASK-107**: System shall show tasks due today prominently on dashboard

#### 2.3 Update Tasks
- **REQ-TASK-201**: Users shall be able to edit any task field
- **REQ-TASK-202**: System shall track task modification history (who, when, what changed)
- **REQ-TASK-203**: Users shall be able to quickly change task status with one click
- **REQ-TASK-204**: Users shall be able to mark tasks as complete/incomplete
- **REQ-TASK-205**: System shall timestamp all task updates
- **REQ-TASK-206**: Completed tasks shall be visually distinct with strikethrough text

#### 2.4 Delete Tasks
- **REQ-TASK-301**: Users shall be able to delete tasks
- **REQ-TASK-302**: System shall require confirmation before permanent deletion
- **REQ-TASK-303**: Deleted tasks shall be moved to "Archive" for 30 days before permanent deletion
- **REQ-TASK-304**: Users shall be able to restore archived tasks
- **REQ-TASK-305**: Users shall be able to permanently delete archived tasks
- **REQ-TASK-306**: System shall allow bulk delete operations with confirmation

### 3. Task Properties

#### 3.1 Task Status
- **REQ-PROP-001**: System shall support three status types: Pending, In Progress, Completed
- **REQ-PROP-002**: Default status for new tasks shall be "Pending"
- **REQ-PROP-003**: Status changes shall be logged in task history
- **REQ-PROP-004**: Completed tasks shall record completion timestamp

#### 3.2 Task Priority
- **REQ-PROP-101**: System shall support three priority levels: Low, Medium, High
- **REQ-PROP-102**: Default priority shall be "Medium"
- **REQ-PROP-103**: Priority shall be indicated by colored badges
- **REQ-PROP-104**: High priority tasks shall be highlighted in task lists

#### 3.3 Due Dates
- **REQ-PROP-201**: Tasks may have optional due dates
- **REQ-PROP-202**: System shall warn users of tasks due within 24 hours
- **REQ-PROP-203**: System shall mark overdue tasks in red
- **REQ-PROP-204**: Due date shall accept date only (no time component in v1.0)
- **REQ-PROP-205**: System shall allow filtering by due date ranges

#### 3.4 Categories/Tags
- **REQ-PROP-301**: Users shall be able to create custom categories
- **REQ-PROP-302**: Tasks may have zero or more categories assigned
- **REQ-PROP-303**: Categories shall have customizable colors
- **REQ-PROP-304**: Users shall be able to filter tasks by category
- **REQ-PROP-305**: System shall show category statistics on dashboard

### 4. Dashboard View

#### 4.1 Statistics Display
- **REQ-DASH-001**: Dashboard shall display total task count
- **REQ-DASH-002**: Dashboard shall display count by status (Pending, In Progress, Completed)
- **REQ-DASH-003**: Dashboard shall show completion rate as percentage
- **REQ-DASH-004**: Dashboard shall display number of overdue tasks
- **REQ-DASH-005**: Dashboard shall show tasks due today count

#### 4.2 Recent Tasks
- **REQ-DASH-101**: Dashboard shall display 10 most recently created/updated tasks
- **REQ-DASH-102**: Recent tasks shall show: title, status, priority, due date
- **REQ-DASH-103**: Users shall be able to quick-edit tasks from dashboard

#### 4.3 Upcoming Deadlines
- **REQ-DASH-201**: Dashboard shall display tasks due in next 7 days
- **REQ-DASH-202**: Upcoming tasks shall be sorted by due date
- **REQ-DASH-203**: Overdue tasks shall appear at top of upcoming list

#### 4.4 Progress Visualization
- **REQ-DASH-301**: Dashboard shall display progress bar showing completion percentage
- **REQ-DASH-302**: Dashboard may include simple charts/graphs for task statistics
- **REQ-DASH-303**: Statistics shall update in real-time without page refresh

#### 4.5 Quick Actions
- **REQ-DASH-401**: Dashboard shall provide quick-add task input field
- **REQ-DASH-402**: Dashboard shall provide quick access buttons to all major views
- **REQ-DASH-403**: Dashboard shall allow one-click status changes for displayed tasks

### 5. Kanban Board View

#### 5.1 Board Layout
- **REQ-KANBAN-001**: Kanban board shall display three columns: Pending, In Progress, Completed
- **REQ-KANBAN-002**: Each column shall show task count in header
- **REQ-KANBAN-003**: Columns shall be vertically scrollable independently
- **REQ-KANBAN-004**: Board shall be horizontally scrollable on mobile devices

#### 5.2 Task Cards
- **REQ-KANBAN-101**: Task cards shall display: title, description (truncated), priority, due date
- **REQ-KANBAN-102**: Task cards shall have colored left border indicating priority
- **REQ-KANBAN-103**: Overdue tasks shall have visual warning indicator
- **REQ-KANBAN-104**: Users shall be able to click card to view/edit full details

#### 5.3 Drag and Drop
- **REQ-KANBAN-201**: Users shall be able to drag tasks between columns
- **REQ-KANBAN-202**: Dropping task in new column shall update status automatically
- **REQ-KANBAN-203**: System shall provide visual feedback during drag operation
- **REQ-KANBAN-204**: Status changes via drag-drop shall be saved via HTMX
- **REQ-KANBAN-205**: Failed status updates shall revert card to original position

#### 5.4 Filtering & Sorting
- **REQ-KANBAN-301**: Users shall be able to filter kanban board by priority
- **REQ-KANBAN-302**: Users shall be able to filter by category
- **REQ-KANBAN-303**: Users shall be able to sort cards within columns by due date or priority

### 6. Calendar View

#### 6.1 Calendar Display
- **REQ-CAL-001**: Calendar shall default to month view
- **REQ-CAL-002**: Calendar shall support month, week, and day views
- **REQ-CAL-003**: Calendar shall display current month/week/day prominently
- **REQ-CAL-004**: Users shall be able to navigate between months/weeks/days
- **REQ-CAL-005**: Current day shall be highlighted visually

#### 6.2 Task Display on Calendar
- **REQ-CAL-101**: Tasks with due dates shall appear on calendar on due date
- **REQ-CAL-102**: Tasks shall be displayed as colored badges/pills on date cells
- **REQ-CAL-103**: Badge color shall indicate priority level
- **REQ-CAL-104**: Date cells shall show count if multiple tasks exist
- **REQ-CAL-105**: Clicking task badge shall open task details modal

#### 6.3 Calendar Interactions
- **REQ-CAL-201**: Users shall be able to click date to view all tasks due that day
- **REQ-CAL-202**: Users shall be able to create new task from calendar by clicking date
- **REQ-CAL-203**: New task created from calendar shall auto-populate selected due date
- **REQ-CAL-204**: Calendar shall update dynamically without full page reload

#### 6.4 Navigation
- **REQ-CAL-301**: Calendar shall provide "Today" button to jump to current date
- **REQ-CAL-302**: Calendar shall provide previous/next navigation buttons
- **REQ-CAL-303**: Calendar shall display current month/year in header
- **REQ-CAL-304**: View toggle buttons shall switch between month/week/day views

### 7. Task List/Grid View

#### 7.1 Display Options
- **REQ-LIST-001**: Users shall toggle between list and grid views
- **REQ-LIST-002**: List view shall display tasks in table format
- **REQ-LIST-003**: Grid view shall display tasks as cards in responsive grid
- **REQ-LIST-004**: View preference shall be saved per user session

#### 7.2 List View Features
- **REQ-LIST-101**: Table shall display columns: checkbox, title, status, priority, due date, actions
- **REQ-LIST-102**: Table rows shall be clickable to edit task
- **REQ-LIST-103**: Table shall support row hover effects
- **REQ-LIST-104**: Users shall be able to select multiple tasks via checkboxes
- **REQ-LIST-105**: Bulk actions shall be available for selected tasks

#### 7.3 Grid View Features
- **REQ-LIST-201**: Cards shall display: title, description (truncated), status, priority, due date
- **REQ-LIST-202**: Cards shall be responsive: 1 column mobile, 2 tablet, 3 desktop
- **REQ-LIST-203**: Cards shall have action buttons: edit, complete, delete

#### 7.4 Filtering & Search
- **REQ-LIST-301**: Users shall search tasks by title and description
- **REQ-LIST-302**: Search shall be live/real-time as user types
- **REQ-LIST-303**: Filters shall include: status, priority, due date range, category
- **REQ-LIST-304**: Multiple filters shall work together (AND logic)
- **REQ-LIST-305**: Filter state shall be preserved during session

#### 7.5 Sorting
- **REQ-LIST-401**: Users shall sort by: due date, priority, creation date, title, status
- **REQ-LIST-402**: Sort shall support ascending and descending order
- **REQ-LIST-403**: Sort preference shall be saved during session

#### 7.6 Pagination
- **REQ-LIST-501**: Task list shall paginate at 20 tasks per page (default)
- **REQ-LIST-502**: Users shall be able to change page size: 10, 20, 50, 100
- **REQ-LIST-503**: Pagination controls shall show current page and total pages
- **REQ-LIST-504**: Users shall be able to jump to specific page number

### 8. Categories/Tags Management

#### 8.1 Category CRUD
- **REQ-CAT-001**: Users shall be able to create custom categories
- **REQ-CAT-002**: Category name must be unique per user
- **REQ-CAT-003**: Category name shall be limited to 50 characters
- **REQ-CAT-004**: Users shall be able to assign custom color to categories
- **REQ-CAT-005**: Users shall be able to edit category name and color
- **REQ-CAT-006**: Users shall be able to delete categories
- **REQ-CAT-007**: Deleting category shall not delete tasks, only remove tag

#### 8.2 Category Assignment
- **REQ-CAT-101**: Tasks may have multiple categories assigned
- **REQ-CAT-102**: Categories shall be displayed as colored pill badges
- **REQ-CAT-103**: Users shall add/remove categories from task edit modal
- **REQ-CAT-104**: Category selection shall use dropdown or tag input

#### 8.3 Category Filtering
- **REQ-CAT-201**: Users shall filter tasks by one or more categories
- **REQ-CAT-202**: Category filter shall show task count per category
- **REQ-CAT-203**: Filtering by multiple categories shall use OR logic

### 9. Search Functionality

#### 9.1 Global Search
- **REQ-SEARCH-001**: Search bar shall be accessible from all views in top navigation
- **REQ-SEARCH-002**: Search shall query task title and description
- **REQ-SEARCH-003**: Search shall be case-insensitive
- **REQ-SEARCH-004**: Search results shall display in real-time dropdown
- **REQ-SEARCH-005**: Search dropdown shall show maximum 10 results
- **REQ-SEARCH-006**: Clicking result shall navigate to task or open in modal
- **REQ-SEARCH-007**: "View all results" option shall be available if more than 10 matches

#### 9.2 Advanced Search
- **REQ-SEARCH-101**: Advanced search shall support filtering by all task properties
- **REQ-SEARCH-102**: Date range search shall be supported for due dates
- **REQ-SEARCH-103**: Search results page shall display all matching tasks
- **REQ-SEARCH-104**: Search results shall be sortable and filterable

### 10. Notifications

#### 10.1 Email Notifications
- **REQ-NOTIF-001**: System shall send email for account verification
- **REQ-NOTIF-002**: System shall send email for password reset requests
- **REQ-NOTIF-003**: System shall send daily digest of tasks due that day (optional, user preference)
- **REQ-NOTIF-004**: System shall send reminder 24 hours before task due date (optional)
- **REQ-NOTIF-005**: Users shall be able to enable/disable email notifications in settings

#### 10.2 In-App Notifications
- **REQ-NOTIF-101**: System shall display toast notifications for successful actions
- **REQ-NOTIF-102**: System shall display error messages for failed operations
- **REQ-NOTIF-103**: Notification badge shall appear on bell icon for unread notifications
- **REQ-NOTIF-104**: Clicking bell icon shall show notification dropdown
- **REQ-NOTIF-105**: Users shall be able to mark notifications as read
- **REQ-NOTIF-106**: Users shall be able to clear all notifications

### 11. Settings & Preferences

#### 11.1 Account Settings
- **REQ-SET-001**: Users shall access settings from user dropdown menu
- **REQ-SET-002**: Settings page shall include sections: Profile, Security, Notifications, Preferences
- **REQ-SET-003**: Users shall be able to update profile information
- **REQ-SET-004**: Users shall be able to change password
- **REQ-SET-005**: Users shall be able to enable two-factor authentication (future)

#### 11.2 Notification Preferences
- **REQ-SET-101**: Users shall toggle email notifications on/off
- **REQ-SET-102**: Users shall set daily digest time preference
- **REQ-SET-103**: Users shall enable/disable due date reminders
- **REQ-SET-104**: Users shall set reminder timing (24h, 48h, 1 week before)

#### 11.3 Display Preferences
- **REQ-SET-201**: Users shall toggle between light/dark theme
- **REQ-SET-202**: Users shall set default view (dashboard, list, kanban, calendar)
- **REQ-SET-203**: Users shall set default task sort order
- **REQ-SET-204**: Users shall set pagination page size preference
- **REQ-SET-205**: Theme preference shall be saved and persist across sessions

#### 11.4 Data Management
- **REQ-SET-301**: Users shall be able to export all tasks to CSV
- **REQ-SET-302**: Users shall be able to export to JSON format
- **REQ-SET-303**: Users shall be able to permanently delete archived tasks
- **REQ-SET-304**: Users shall be able to delete account with confirmation
- **REQ-SET-305**: Account deletion shall remove all user data within 30 days

### 12. Archive & Trash

#### 12.1 Archive Functionality
- **REQ-ARCH-001**: Completed tasks older than 30 days shall auto-archive (optional setting)
- **REQ-ARCH-002**: Users shall manually archive tasks
- **REQ-ARCH-003**: Archived tasks shall not appear in normal views
- **REQ-ARCH-004**: Users shall access archived tasks from dedicated archive view
- **REQ-ARCH-005**: Users shall restore archived tasks to active status
- **REQ-ARCH-006**: Archived tasks shall be searchable in archive view

#### 12.2 Trash/Deleted Tasks
- **REQ-ARCH-101**: Deleted tasks shall move to trash for 30 days
- **REQ-ARCH-102**: Users shall view tasks in trash from dedicated view
- **REQ-ARCH-103**: Users shall restore tasks from trash
- **REQ-ARCH-104**: Users shall permanently delete tasks from trash
- **REQ-ARCH-105**: Tasks in trash shall auto-delete after 30 days
- **REQ-ARCH-106**: Users shall be warned before permanent deletion

## Non-Functional Requirements

### 13. Performance

#### 13.1 Response Times
- **REQ-PERF-001**: Page load time shall be under 2 seconds on average connection
- **REQ-PERF-002**: HTMX request/response time shall be under 500ms
- **REQ-PERF-003**: Search results shall appear within 300ms of typing
- **REQ-PERF-004**: Task creation shall complete within 1 second
- **REQ-PERF-005**: Dashboard statistics shall load within 1 second

#### 13.2 Scalability
- **REQ-PERF-101**: System shall support minimum 1,000 concurrent users
- **REQ-PERF-102**: Database shall handle minimum 1,000,000 tasks
- **REQ-PERF-103**: Individual users shall be able to manage 10,000+ tasks
- **REQ-PERF-104**: Pagination shall prevent loading excessive data

#### 13.3 Optimization
- **REQ-PERF-201**: Images shall be optimized and compressed
- **REQ-PERF-202**: CSS/JS shall be minified in production
- **REQ-PERF-203**: Database queries shall use appropriate indexes
- **REQ-PERF-204**: Frequent queries shall be optimized/cached

### 14. Security

#### 14.1 Authentication Security
- **REQ-SEC-001**: Passwords shall be hashed using bcrypt with salt
- **REQ-SEC-002**: Session tokens shall be cryptographically secure
- **REQ-SEC-003**: Session cookies shall have HttpOnly and Secure flags
- **REQ-SEC-004**: Session cookies shall have SameSite=Strict or Lax
- **REQ-SEC-005**: HTTPS shall be enforced for all connections in production

#### 14.2 Authorization
- **REQ-SEC-101**: Users shall only access their own tasks
- **REQ-SEC-102**: All data modification requests shall verify user ownership
- **REQ-SEC-103**: Direct URL access to tasks shall require authentication
- **REQ-SEC-104**: API endpoints shall validate user permissions

#### 14.3 Input Validation
- **REQ-SEC-201**: All user input shall be validated server-side
- **REQ-SEC-202**: SQL injection prevention via prepared statements
- **REQ-SEC-203**: XSS prevention via output escaping
- **REQ-SEC-204**: File uploads shall validate file type and size
- **REQ-SEC-205**: CSRF tokens shall be used for state-changing operations

#### 14.4 Data Protection
- **REQ-SEC-301**: Database connections shall use encrypted connections
- **REQ-SEC-302**: Sensitive data shall not be logged
- **REQ-SEC-303**: Error messages shall not expose system details
- **REQ-SEC-304**: User data shall be isolated per user account
- **REQ-SEC-305**: Regular security audits shall be performed

### 15. Reliability

#### 15.1 Uptime
- **REQ-REL-001**: System shall maintain 99.5% uptime
- **REQ-REL-002**: Planned maintenance shall be scheduled during low-usage periods
- **REQ-REL-003**: Users shall be notified 48 hours before planned maintenance

#### 15.2 Data Integrity
- **REQ-REL-101**: Database shall be backed up daily
- **REQ-REL-102**: Backups shall be retained for 30 days
- **REQ-REL-103**: Database transactions shall ensure data consistency
- **REQ-REL-104**: Failed operations shall not corrupt data

#### 15.3 Error Handling
- **REQ-REL-201**: Application errors shall be logged with timestamp and context
- **REQ-REL-202**: Users shall see friendly error messages, not technical details
- **REQ-REL-203**: Critical errors shall notify system administrators
- **REQ-REL-204**: System shall gracefully handle database connection failures

### 16. Usability

#### 16.1 User Interface
- **REQ-USE-001**: Interface shall be intuitive and require no training
- **REQ-USE-002**: Common actions shall be accessible within 2 clicks
- **REQ-USE-003**: Interface shall provide clear visual feedback for all actions
- **REQ-USE-004**: Error messages shall be clear and actionable
- **REQ-USE-005**: Loading states shall be indicated with spinners/progress indicators

#### 16.2 Accessibility
- **REQ-USE-101**: Site shall meet WCAG 2.1 Level AA standards
- **REQ-USE-102**: All interactive elements shall be keyboard accessible
- **REQ-USE-103**: Color shall not be the only means of conveying information
- **REQ-USE-104**: Alt text shall be provided for all images
- **REQ-USE-105**: Form fields shall have associated labels
- **REQ-USE-106**: Minimum touch target size shall be 44x44 pixels

#### 16.3 Responsive Design
- **REQ-USE-201**: Application shall be fully functional on mobile devices (320px+)
- **REQ-USE-202**: Application shall be fully functional on tablets (768px+)
- **REQ-USE-203**: Application shall be fully functional on desktops (1024px+)
- **REQ-USE-204**: Touch gestures shall be supported on touch devices
- **REQ-USE-205**: Layout shall adapt smoothly to all screen sizes

### 17. Browser Compatibility

#### 17.1 Supported Browsers
- **REQ-COMPAT-001**: Chrome (last 2 versions)
- **REQ-COMPAT-002**: Firefox (last 2 versions)
- **REQ-COMPAT-003**: Safari (last 2 versions)
- **REQ-COMPAT-004**: Edge (last 2 versions)
- **REQ-COMPAT-005**: Mobile Safari (iOS 14+)
- **REQ-COMPAT-006**: Chrome Mobile (Android 10+)

#### 17.2 Progressive Enhancement
- **REQ-COMPAT-101**: Core functionality shall work without JavaScript
- **REQ-COMPAT-102**: Enhanced features shall degrade gracefully
- **REQ-COMPAT-103**: Application shall detect and warn about unsupported browsers

### 18. Data & Privacy

#### 18.1 Data Collection
- **REQ-PRIV-001**: System shall collect only necessary user data
- **REQ-PRIV-002**: Users shall consent to data collection during registration
- **REQ-PRIV-003**: Privacy policy shall be clearly accessible
- **REQ-PRIV-004**: Users shall be able to export their data
- **REQ-PRIV-005**: Users shall be able to delete their account and data

#### 18.2 Data Retention
- **REQ-PRIV-101**: Active tasks shall be retained indefinitely
- **REQ-PRIV-102**: Archived tasks shall be retained for 1 year unless deleted
- **REQ-PRIV-103**: Deleted tasks shall be retained for 30 days then permanently removed
- **REQ-PRIV-104**: Deleted accounts shall be purged after 30 days

#### 18.3 GDPR Compliance (if applicable)
- **REQ-PRIV-201**: Users shall have right to access their data
- **REQ-PRIV-202**: Users shall have right to data portability
- **REQ-PRIV-203**: Users shall have right to deletion
- **REQ-PRIV-204**: Users shall have right to rectification

### 19. Maintenance & Support

#### 19.1 Logging
- **REQ-MAINT-001**: System shall log all errors with stack traces
- **REQ-MAINT-002**: System shall log authentication events
- **REQ-MAINT-003**: System shall log security-related events
- **REQ-MAINT-004**: Logs shall be retained for 90 days
- **REQ-MAINT-005**: Logs shall not contain sensitive user data

#### 19.2 Monitoring
- **REQ-MAINT-101**: System shall monitor application uptime
- **REQ-MAINT-102**: System shall monitor database performance
- **REQ-MAINT-103**: System shall monitor disk space usage
- **REQ-MAINT-104**: Alerts shall be sent for critical issues

#### 19.3 Updates
- **REQ-MAINT-201**: Security updates shall be applied within 7 days
- **REQ-MAINT-202**: Feature updates shall not break existing functionality
- **REQ-MAINT-203**: Database migrations shall be reversible
- **REQ-MAINT-204**: Users shall be notified of major updates

## Technical Constraints

### 20. Technology Stack Constraints
- **REQ-TECH-001**: Must use Ubuntu 24.04 LTS as operating system
- **REQ-TECH-002**: Must use Apache 2.4.x as web server
- **REQ-TECH-003**: Must use MySQL 8.0.x or MariaDB 10.11.x as database
- **REQ-TECH-004**: Must use PHP 8.3.x for backend
- **REQ-TECH-005**: Must use Bootstrap 5.3.x for UI framework
- **REQ-TECH-006**: Must use HTMX 2.x for dynamic interactions
- **REQ-TECH-007**: Must use Alpine.js 3.x for client-side interactivity
- **REQ-TECH-008**: Must use jQuery 3.7.x (for Bootstrap compatibility)

## Out of Scope (Future Versions)

The following features are NOT included in version 1.0:

### Version 2.0+ Features
- Multi-user collaboration and task sharing
- Team workspaces
- Task assignments to other users
- Comments and discussions on tasks
- File attachments to tasks
- Recurring tasks
- Subtasks and task hierarchies
- Time tracking
- Task dependencies
- Gantt chart view
- Mobile native applications (iOS/Android)
- Third-party integrations (Google Calendar, Slack, etc.)
- API for external applications
- Custom fields for tasks
- Advanced reporting and analytics
- Webhooks
- Two-factor authentication (2FA)
- Single Sign-On (SSO)
- White-label options
- Multi-language support

## Acceptance Criteria

### Version 1.0 Launch Criteria
- All functional requirements marked as REQ-* are implemented
- All critical and high-priority bugs are resolved
- Security audit is completed and passed
- Performance benchmarks are met
- User acceptance testing is completed with 90%+ satisfaction
- Documentation is complete (user guide, admin guide)
- Backup and recovery procedures are tested
- Production environment is configured and tested

## Assumptions

1. Users have modern web browsers with JavaScript enabled
2. Users have stable internet connection
3. Application will be hosted on VPS or cloud infrastructure
4. Email service (SMTP) is available for notifications
5. SSL certificate will be obtained for HTTPS
6. Domain name is registered and configured
7. Initial user base is expected to be under 10,000 users
8. English is the only supported language in v1.0

## Dependencies

1. Ubuntu 24.04 LTS server with root access
2. LAMP stack components (Apache, MySQL/MariaDB, PHP)
3. Email service for transactional emails (SMTP server or service like SendGrid)
4. SSL certificate (Let's Encrypt or commercial)
5. Domain name and DNS configuration
6. CDN access for Bootstrap, HTMX, Alpine.js, jQuery libraries

## Risks & Mitigations

### Technical Risks
1. **Risk**: Performance degradation with large task lists
   **Mitigation**: Implement pagination, lazy loading, and database indexing

2. **Risk**: Security vulnerabilities
   **Mitigation**: Follow OWASP guidelines, regular security audits, keep dependencies updated

3. **Risk**: Browser compatibility issues
   **Mitigation**: Thorough testing on all supported browsers, progressive enhancement

### Business Risks
1. **Risk**: Low user adoption
   **Mitigation**: Focus on excellent UX, gather user feedback, iterate quickly

2. **Risk**: Competing with established solutions
   **Mitigation**: Emphasize unique features, simplicity, and value proposition

## Success Metrics

### Key Performance Indicators (KPIs)
1. User registration rate
2. Daily/Monthly active users (DAU/MAU)
3. Average tasks created per user
4. Task completion rate
5. User retention rate (30-day, 90-day)
6. Average session duration
7. Page load times
8. Error rate (< 0.1%)
9. User satisfaction score (target: 4/5 or higher)
10. Support ticket volume (target: < 5% of users)

## Glossary

- **Task**: A single item on the todo list with properties like title, description, status, priority, and due date
- **Category/Tag**: A label that can be applied to tasks for organization
- **Dashboard**: The main overview page showing statistics and recent activity
- **Kanban Board**: A visual workflow board with columns for different task statuses
- **Archive**: Storage area for old or completed tasks not needed in main views
- **CRUD**: Create, Read, Update, Delete operations
- **SaaS**: Software as a Service - web-based application accessed via browser
- **LAMP**: Linux, Apache, MySQL, PHP technology stack
- **HTMX**: Library for accessing AJAX directly in HTML
- **Alpine.js**: Lightweight JavaScript framework for interactivity

## Document Control

- **Version**: 1.0.0
- **Last Updated**: October 20, 2025
- **Document Owner**: Project Manager
- **Approval Status**: Draft
- **Next Review Date**: TBD

## Revision History

| Version | Date | Author | Changes |
|---------|------|--------|---------|
| 1.0.0 | 2025-10-20 | Initial | Initial requirements document creation |

# Tech Stack Documentation

## Project Overview
Todo List Tracker Application - A full-featured task management system built on a traditional LAMP stack.

## Operating System
- **Ubuntu 24.04 LTS** (Note: Ubuntu 24.3 doesn't exist; using 24.04 LTS which is the latest stable release)

## Server Stack (LAMP)

### Web Server
- **Apache 2.4.x**
  - mod_rewrite enabled
  - .htaccess support enabled
  - Virtual hosts configured

### Database
- **MySQL 8.0.x** or **MariaDB 10.11.x**
  - InnoDB storage engine
  - UTF-8 (utf8mb4) character set

### Backend Language
- **PHP 8.3.x**
  - Required Extensions:
    - mysqli or PDO_MySQL
    - json
    - mbstring
    - openssl
  - Configuration:
    - error_reporting enabled for development
    - display_errors off for production
    - session handling enabled

## Frontend Technologies

### CSS Framework
- **Bootstrap 5.3.x**
  - Source: https://getbootstrap.com/
  - Use CDN or local installation
  - Includes Popper.js for tooltips and popovers
  - Responsive grid system
  - Component library (cards, modals, forms, buttons, etc.)

### JavaScript Libraries

#### jQuery
- **jQuery 3.7.x** (required for Bootstrap)
  - Slim build acceptable if not using AJAX features
  - Used primarily for Bootstrap component functionality

#### HTMX
- **HTMX 2.x** (latest version)
  - For dynamic HTML updates without full page reloads
  - AJAX requests with HTML responses
  - Progressive enhancement approach
  - Attributes: hx-get, hx-post, hx-put, hx-delete, hx-target, hx-swap

#### Alpine.js
- **Alpine.js 3.x** (latest version)
  - Lightweight JavaScript framework
  - For interactive UI components
  - Client-side state management
  - Directives: x-data, x-show, x-if, x-for, x-model, x-on

## Application Architecture

### Directory Structure
```
/var/www/html/todo-app/
├── index.php
├── config/
│   └── database.php
├── includes/
│   ├── header.php
│   └── footer.php
├── api/
│   ├── tasks.php
│   ├── create.php
│   ├── update.php
│   └── delete.php
├── assets/
│   ├── css/
│   │   └── custom.css
│   ├── js/
│   │   └── app.js
│   └── images/
└── .htaccess
```

### Database Schema
```sql
CREATE TABLE tasks (
    id INT AUTO_INCREMENT PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    description TEXT,
    status ENUM('pending', 'in_progress', 'completed') DEFAULT 'pending',
    priority ENUM('low', 'medium', 'high') DEFAULT 'medium',
    due_date DATE,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
```

## Integration Strategy

### HTMX + PHP
- PHP endpoints return HTML fragments
- HTMX handles DOM updates without full page reloads
- Use hx-target to specify where responses should be inserted
- Use hx-swap to control how content is swapped

### Alpine.js + Bootstrap
- Alpine.js manages component state (modals, dropdowns)
- Bootstrap provides styling and layout
- Use Alpine for custom interactive behaviors
- Bootstrap JavaScript for complex components (carousels, etc.)

### jQuery + Bootstrap
- jQuery required for Bootstrap's JavaScript components
- Bootstrap JS depends on jQuery for event handling
- Use jQuery for Bootstrap component initialization

## Development Environment Setup

### Apache Configuration
```apache
<VirtualHost *:80>
    ServerName todo-app.local
    DocumentRoot /var/www/html/todo-app
    
    <Directory /var/www/html/todo-app>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ErrorLog ${APACHE_LOG_DIR}/todo-app-error.log
    CustomLog ${APACHE_LOG_DIR}/todo-app-access.log combined
</VirtualHost>
```

### .htaccess Configuration
```apache
RewriteEngine On
RewriteBase /

# Remove .php extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L]

# Security headers
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
```

## CDN Links (for reference)

### Bootstrap 5.3
```html
<!-- CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">

<!-- JavaScript Bundle -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
```

### jQuery
```html
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
```

### HTMX
```html
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
```

### Alpine.js
```html
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
```

## Security Considerations

### PHP Security
- Use prepared statements for all database queries
- Validate and sanitize all user inputs
- Implement CSRF protection
- Use secure session handling
- Set appropriate file permissions (644 for files, 755 for directories)

### Database Security
- Use separate database user with minimal privileges
- Store credentials outside web root
- Use environment variables for sensitive data

### Frontend Security
- Escape output to prevent XSS
- Use HTTPS in production
- Implement Content Security Policy

## Best Practices

### Code Organization
- Separate concerns (presentation, business logic, data access)
- Use PHP includes for reusable components
- Keep API endpoints RESTful
- Use meaningful naming conventions

### HTMX Patterns
- Return HTML fragments from server
- Use hx-indicator for loading states
- Implement proper error handling with hx-on
- Use hx-confirm for destructive actions

### Alpine.js Patterns
- Keep state management simple and local
- Use x-data for component initialization
- Avoid complex logic in templates
- Use Alpine for UI interactions, HTMX for data fetching

### Performance
- Minimize database queries
- Use appropriate indexes
- Enable browser caching
- Compress assets
- Use CDN for libraries

## Testing Checklist
- [ ] Apache serving PHP files correctly
- [ ] Database connection established
- [ ] Bootstrap styles loading
- [ ] jQuery functionality working
- [ ] HTMX requests sending/receiving properly
- [ ] Alpine.js reactivity functioning
- [ ] CRUD operations working
- [ ] Responsive design on mobile devices
- [ ] Cross-browser compatibility

## Documentation References
- Bootstrap: https://getbootstrap.com/docs/5.3/
- HTMX: https://htmx.org/docs/
- Alpine.js: https://alpinejs.dev/
- PHP: https://www.php.net/manual/en/
- MySQL: https://dev.mysql.com/doc/

# Design Notes - Todo List Tracker Application

## Design Overview
A modern, responsive todo list tracker featuring a dashboard, kanban board, calendar view, and comprehensive task management. Built with Bootstrap 5.3 components from https://getbootstrap.com/.

## Color Scheme & Branding

### Primary Colors
- **Primary**: Bootstrap's primary blue (`#0d6efd`) - for main actions, links
- **Success**: Green (`#198754`) - for completed tasks
- **Warning**: Yellow (`#ffc107`) - for pending/due soon tasks
- **Danger**: Red (`#dc3545`) - for overdue tasks
- **Info**: Cyan (`#0dcaf0`) - for in-progress tasks

### Task Status Colors
- **Pending**: Warning (yellow badge)
- **In Progress**: Info (cyan badge)
- **Completed**: Success (green badge with checkmark)

### Priority Colors
- **Low**: Secondary (`#6c757d`)
- **Medium**: Warning (`#ffc107`)
- **High**: Danger (`#dc3545`)

## Layout Structure

### Global Layout
Based on Bootstrap's Dashboard example: https://getbootstrap.com/docs/5.3/examples/dashboard/

```
┌─────────────────────────────────────────┐
│           Top Navigation Bar             │
├──────┬──────────────────────────────────┤
│      │                                   │
│ Side │      Main Content Area            │
│ Nav  │                                   │
│      │                                   │
└──────┴──────────────────────────────────┘
```

### Navigation Structure

#### Top Navbar
- **Component**: Navbar (Fixed top)
- **Reference**: https://getbootstrap.com/docs/5.3/components/navbar/
- **Elements**:
  - Brand/Logo (left)
  - Search bar (center) - for quick task search
  - User dropdown (right) - profile, settings, logout
  - Notification bell icon with badge
  - Theme toggle (light/dark mode)

```html
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
  <div class="container-fluid">
    <a class="navbar-brand" href="#">TodoTracker</a>
    <button class="navbar-toggler" ...>
    <div class="collapse navbar-collapse">
      <form class="d-flex mx-auto" style="width: 50%;">
        <input class="form-control" type="search" placeholder="Search tasks...">
      </form>
      <ul class="navbar-nav ms-auto">
        <!-- Notifications, Profile dropdown -->
      </ul>
    </div>
  </div>
</nav>
```

#### Sidebar Navigation
- **Component**: Offcanvas/Sidebar
- **Reference**: https://getbootstrap.com/docs/5.3/examples/sidebars/
- **Width**: 250px on desktop, collapsible on mobile
- **Menu Items**:
  - Dashboard (icon: speedometer)
  - All Tasks (icon: list)
  - Kanban Board (icon: columns)
  - Calendar (icon: calendar)
  - Categories/Tags (icon: tags)
  - Archived (icon: archive)
  - Settings (icon: gear)

```html
<div class="sidebar border-end bg-light" style="width: 250px; min-height: 100vh;">
  <div class="list-group list-group-flush">
    <a href="#" class="list-group-item list-group-item-action active">
      <i class="bi bi-speedometer2 me-2"></i>Dashboard
    </a>
    <!-- More items -->
  </div>
</div>
```

## Page Layouts

### 1. Dashboard View

#### Layout Grid
- **Reference**: https://getbootstrap.com/docs/5.3/examples/dashboard/
- **Structure**: 2-3 column layout with cards

#### Top Statistics Row
- **Component**: Cards with stats
- **Reference**: https://getbootstrap.com/docs/5.3/components/card/
- **Layout**: 4 columns on desktop, stacked on mobile

```html
<div class="row g-3 mb-4">
  <div class="col-lg-3 col-md-6">
    <div class="card text-white bg-primary">
      <div class="card-body">
        <h5 class="card-title">Total Tasks</h5>
        <h2 class="mb-0">47</h2>
      </div>
    </div>
  </div>
  <div class="col-lg-3 col-md-6">
    <div class="card text-white bg-warning">
      <div class="card-body">
        <h5 class="card-title">Pending</h5>
        <h2 class="mb-0">23</h2>
      </div>
    </div>
  </div>
  <!-- Repeat for In Progress, Completed -->
</div>
```

#### Recent Tasks Section
- **Component**: List Group
- **Reference**: https://getbootstrap.com/docs/5.3/components/list-group/
- **Features**:
  - Task title and description
  - Priority badge
  - Status badge
  - Due date
  - Action buttons (edit, delete)

```html
<div class="card">
  <div class="card-header">
    <h5 class="mb-0">Recent Tasks</h5>
  </div>
  <ul class="list-group list-group-flush">
    <li class="list-group-item d-flex justify-content-between align-items-start">
      <div class="ms-2 me-auto">
        <div class="fw-bold">Task Title</div>
        <small class="text-muted">Task description...</small>
        <div class="mt-1">
          <span class="badge bg-danger">High</span>
          <span class="badge bg-info">In Progress</span>
        </div>
      </div>
      <div>
        <small class="text-muted">Due: Oct 25</small>
        <div class="btn-group btn-group-sm mt-1">
          <button class="btn btn-outline-primary">Edit</button>
          <button class="btn btn-outline-danger">Delete</button>
        </div>
      </div>
    </li>
  </ul>
</div>
```

#### Task Progress Chart
- **Component**: Progress bars
- **Reference**: https://getbootstrap.com/docs/5.3/components/progress/
- **Display**: Overall completion percentage

#### Upcoming Deadlines
- **Component**: Timeline-style list
- **Shows**: Tasks due in next 7 days
- **Style**: List group with colored left border for priority

### 2. Kanban Board View

#### Layout
- **Reference**: Bootstrap Grid + Cards
- **Structure**: 3-4 columns (Pending, In Progress, Completed, Archived)
- **Horizontal scroll**: On mobile devices

```html
<div class="row g-3">
  <div class="col-lg-3 col-md-6">
    <div class="card">
      <div class="card-header bg-warning text-dark">
        <h5 class="mb-0">Pending <span class="badge bg-dark">12</span></h5>
      </div>
      <div class="card-body p-2" style="max-height: 70vh; overflow-y: auto;">
        <!-- Kanban task cards -->
        <div class="card mb-2 shadow-sm">
          <div class="card-body p-2">
            <h6 class="card-title">Task Title</h6>
            <p class="card-text small">Brief description...</p>
            <div class="d-flex justify-content-between align-items-center">
              <span class="badge bg-danger">High</span>
              <small class="text-muted">Oct 25</small>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- Repeat for other columns -->
</div>
```

#### Kanban Card Features
- Draggable cards (use HTMX for drag-drop updates)
- Color-coded priority indicator (left border)
- Assignee avatar (if multi-user)
- Due date badge
- Task tags/categories
- Quick action buttons on hover

### 3. Calendar View

#### Calendar Header
- **Component**: Buttons + Dropdown
- **Navigation**: Previous/Next month buttons
- **View options**: Month, Week, Day views

#### Calendar Grid
- **Component**: Table
- **Reference**: https://getbootstrap.com/docs/5.3/content/tables/
- **Structure**: 7-column grid (days of week)

```html
<div class="card">
  <div class="card-header">
    <div class="d-flex justify-content-between align-items-center">
      <div class="btn-group">
        <button class="btn btn-outline-primary btn-sm">← Prev</button>
        <button class="btn btn-outline-primary btn-sm">Today</button>
        <button class="btn btn-outline-primary btn-sm">Next →</button>
      </div>
      <h4 class="mb-0">October 2025</h4>
      <div class="btn-group">
        <button class="btn btn-outline-secondary btn-sm active">Month</button>
        <button class="btn btn-outline-secondary btn-sm">Week</button>
        <button class="btn btn-outline-secondary btn-sm">Day</button>
      </div>
    </div>
  </div>
  <div class="card-body p-0">
    <table class="table table-bordered mb-0">
      <thead>
        <tr>
          <th>Sun</th><th>Mon</th><!-- ... --><th>Sat</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="p-2 align-top" style="height: 100px;">
            <div class="fw-bold">1</div>
            <div class="badge bg-warning text-dark w-100 text-start small">
              Task title
            </div>
          </td>
          <!-- More days -->
        </tr>
      </tbody>
    </table>
  </div>
</div>
```

#### Calendar Day Cell
- Date number (top)
- Task indicators (colored dots or mini badges)
- Click to see day's tasks
- Different background for today
- Muted background for other months

### 4. Task List View (All Tasks)

#### Filters & Sorting
- **Component**: Button group + Dropdowns
- **Reference**: https://getbootstrap.com/docs/5.3/components/button-group/
- **Options**:
  - Filter by: Status, Priority, Category, Date range
  - Sort by: Due date, Created date, Priority, Title
  - View: List or Grid

```html
<div class="d-flex justify-content-between align-items-center mb-3">
  <div class="btn-group">
    <button class="btn btn-sm btn-outline-secondary dropdown-toggle">
      Filter: All Status
    </button>
    <button class="btn btn-sm btn-outline-secondary dropdown-toggle">
      Priority: All
    </button>
  </div>
  <div class="btn-group">
    <button class="btn btn-sm btn-outline-secondary">List</button>
    <button class="btn btn-sm btn-outline-secondary active">Grid</button>
  </div>
</div>
```

#### Task Cards (Grid View)
- **Component**: Cards in grid
- **Layout**: 3 columns on desktop, 1 on mobile

```html
<div class="row g-3">
  <div class="col-lg-4 col-md-6">
    <div class="card h-100">
      <div class="card-body">
        <div class="d-flex justify-content-between mb-2">
          <span class="badge bg-danger">High</span>
          <span class="badge bg-info">In Progress</span>
        </div>
        <h5 class="card-title">Task Title</h5>
        <p class="card-text">Task description goes here...</p>
        <div class="d-flex justify-content-between align-items-center">
          <small class="text-muted">
            <i class="bi bi-calendar"></i> Oct 25, 2025
          </small>
          <div class="btn-group btn-group-sm">
            <button class="btn btn-outline-primary">Edit</button>
            <button class="btn btn-outline-success">✓</button>
            <button class="btn btn-outline-danger">×</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
```

#### Task Table (List View)
- **Component**: Table
- **Reference**: https://getbootstrap.com/docs/5.3/content/tables/
- **Features**: Striped, hoverable rows, responsive

## Forms & Modals

### Add/Edit Task Modal
- **Component**: Modal
- **Reference**: https://getbootstrap.com/docs/5.3/components/modal/
- **Size**: Large modal
- **Form Elements**:
  - Task title (required)
  - Description (textarea)
  - Status (select dropdown)
  - Priority (select dropdown)
  - Due date (date picker)
  - Category/Tags (select with tags)
  - Attachments (file upload)

```html
<div class="modal fade" id="taskModal" tabindex="-1">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Add New Task</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
      </div>
      <div class="modal-body">
        <form>
          <div class="mb-3">
            <label class="form-label">Task Title *</label>
            <input type="text" class="form-control" required>
          </div>
          <div class="mb-3">
            <label class="form-label">Description</label>
            <textarea class="form-control" rows="3"></textarea>
          </div>
          <div class="row">
            <div class="col-md-4 mb-3">
              <label class="form-label">Status</label>
              <select class="form-select">
                <option>Pending</option>
                <option>In Progress</option>
                <option>Completed</option>
              </select>
            </div>
            <div class="col-md-4 mb-3">
              <label class="form-label">Priority</label>
              <select class="form-select">
                <option>Low</option>
                <option>Medium</option>
                <option>High</option>
              </select>
            </div>
            <div class="col-md-4 mb-3">
              <label class="form-label">Due Date</label>
              <input type="date" class="form-control">
            </div>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
        <button type="button" class="btn btn-primary">Save Task</button>
      </div>
    </div>
  </div>
</div>
```

### Quick Add Form (Dashboard)
- **Component**: Input group + Button
- **Reference**: https://getbootstrap.com/docs/5.3/forms/input-group/
- **Location**: Top of dashboard, always visible

```html
<div class="card mb-4">
  <div class="card-body">
    <div class="input-group input-group-lg">
      <input type="text" class="form-control" placeholder="Quick add a task...">
      <button class="btn btn-primary" type="button">
        <i class="bi bi-plus-lg"></i> Add Task
      </button>
    </div>
  </div>
</div>
```

## Interactive Components

### Toast Notifications
- **Component**: Toast
- **Reference**: https://getbootstrap.com/docs/5.3/components/toasts/
- **Usage**: Success/error feedback
- **Position**: Top-right corner

```html
<div class="toast-container position-fixed top-0 end-0 p-3">
  <div class="toast" role="alert">
    <div class="toast-header">
      <strong class="me-auto">Success</strong>
      <button type="button" class="btn-close" data-bs-dismiss="toast"></button>
    </div>
    <div class="toast-body">
      Task created successfully!
    </div>
  </div>
</div>
```

### Confirmation Dialogs
- **Component**: Modal (small)
- **Usage**: Delete confirmations, important actions

### Loading States
- **Component**: Spinner
- **Reference**: https://getbootstrap.com/docs/5.3/components/spinners/
- **Usage**: During HTMX requests

```html
<div class="htmx-indicator">
  <div class="spinner-border text-primary" role="status">
    <span class="visually-hidden">Loading...</span>
  </div>
</div>
```

### Badges
- **Component**: Badges
- **Reference**: https://getbootstrap.com/docs/5.3/components/badge/
- **Usage**: Status, priority, counts

## Additional Features

### Search Results
- **Component**: Dropdown menu (live search)
- **Reference**: https://getbootstrap.com/docs/5.3/components/dropdowns/
- **Appears**: Below search input as you type

### Filters Panel
- **Component**: Offcanvas
- **Reference**: https://getbootstrap.com/docs/5.3/components/offcanvas/
- **Trigger**: Filter button
- **Content**: All filter options with checkboxes

### Settings Page
- **Component**: Form + Accordion
- **Reference**: https://getbootstrap.com/docs/5.3/components/accordion/
- **Sections**:
  - Profile settings
  - Notification preferences
  - Theme settings
  - Data management

### Task Categories/Tags
- **Component**: Pills
- **Reference**: https://getbootstrap.com/docs/5.3/components/badge/#pills
- **Display**: Colored pill badges
- **Management**: Modal for CRUD operations

## Responsive Design

### Breakpoints
- **Mobile**: < 576px (stack all cards, hamburger menu)
- **Tablet**: 576px - 991px (2-column layout)
- **Desktop**: ≥ 992px (full layout with sidebar)

### Mobile Optimizations
- Collapsible sidebar (offcanvas)
- Bottom navigation for key actions
- Swipe gestures for kanban board
- Simplified forms
- Larger touch targets (min 44x44px)

### Desktop Enhancements
- Keyboard shortcuts
- Hover effects
- Multi-select capabilities
- Drag-and-drop functionality

## Icons

### Icon Library
- **Bootstrap Icons**: https://icons.getbootstrap.com/
- **CDN**: Include Bootstrap Icons CSS
- **Usage**: `<i class="bi bi-icon-name"></i>`

### Key Icons
- Dashboard: `bi-speedometer2`
- Tasks: `bi-list-task`
- Calendar: `bi-calendar3`
- Add: `bi-plus-circle`
- Edit: `bi-pencil`
- Delete: `bi-trash`
- Check: `bi-check-circle`
- Clock: `bi-clock`
- Tag: `bi-tag`
- Filter: `bi-funnel`

## Animation & Transitions

### CSS Transitions
- Smooth hover effects (0.3s ease)
- Card elevations on hover
- Button state changes
- Sidebar collapse/expand

### HTMX Transitions
- **Reference**: https://htmx.org/examples/animations/
- Fade in/out for content swaps
- Slide transitions for modals
- Loading indicators

## Accessibility

### Requirements
- Semantic HTML5 elements
- ARIA labels for icon-only buttons
- Keyboard navigation support
- Focus indicators
- Color contrast ratio ≥ 4.5:1
- Screen reader friendly text

### Bootstrap Built-in
- Form validation feedback
- Visually hidden labels where needed
- Proper heading hierarchy
- Skip navigation links

## Dark Mode Support (Optional)

### Implementation
- Bootstrap's data-bs-theme attribute
- Toggle button in navbar
- LocalStorage to persist preference
- Custom CSS variables for custom colors

```html
<html data-bs-theme="dark">
```

## Performance Considerations

### Optimization
- Lazy load calendar months
- Paginate task lists (20-50 items)
- Minimize DOM updates with HTMX
- Use Alpine.js for local state only
- Optimize images and assets

### Loading Strategy
- Critical CSS inline
- Defer non-critical JavaScript
- Use CDN for Bootstrap libraries
- Enable gzip compression

## Bootstrap Component Reference

### Primary Components Used
1. **Navbar**: https://getbootstrap.com/docs/5.3/components/navbar/
2. **Cards**: https://getbootstrap.com/docs/5.3/components/card/
3. **List Groups**: https://getbootstrap.com/docs/5.3/components/list-group/
4. **Modal**: https://getbootstrap.com/docs/5.3/components/modal/
5. **Forms**: https://getbootstrap.com/docs/5.3/forms/overview/
6. **Tables**: https://getbootstrap.com/docs/5.3/content/tables/
7. **Buttons**: https://getbootstrap.com/docs/5.3/components/buttons/
8. **Badges**: https://getbootstrap.com/docs/5.3/components/badge/
9. **Progress**: https://getbootstrap.com/docs/5.3/components/progress/
10. **Toasts**: https://getbootstrap.com/docs/5.3/components/toasts/
11. **Offcanvas**: https://getbootstrap.com/docs/5.3/components/offcanvas/
12. **Dropdowns**: https://getbootstrap.com/docs/5.3/components/dropdowns/

## Design Principles

1. **Consistency**: Use Bootstrap's design system throughout
2. **Clarity**: Clear visual hierarchy with typography scale
3. **Efficiency**: Minimize clicks to complete tasks
4. **Feedback**: Immediate visual feedback for all actions
5. **Accessibility**: Ensure usability for all users
6. **Responsiveness**: Mobile-first, progressive enhancement
7. **Performance**: Fast load times, smooth interactions

Choose License

Regular License
For one end product
FREE
Non-Member Price
For non-members
$99
Available Add-ons
License:
Add-ons:
Total:

Go to Cart
Included with purchase:
  • Quality checked by VibeTemplates
  • Future updates
  • Detailed documentation
About the Author
E
Edward Honour
3 sales