| index.html | Update saveActiveTimesheet to use tableUrl and unwrapRow | |
| README.md | Update README.md |
Freelance Timesheets & Validation System
A comprehensive web application for managing freelance timesheets, contracts, invoices, and administrative validation workflows.
Features
1. Real Authentication & User Session Management
- Full Auth Flow: Modern accessible Login & Register modals supporting email, password, full name, and role selection ('freelancer' or 'admin').
- Backend API Integration: Connects with
/api/auth/login,/api/auth/register, and/api/auth/mewith automatic session verification and graceful offline fallback. - Bearer Token Authorization: Automatically attaches
Authorization: Bearer <token>to all backend API calls. - Top Navigation User Profile: Replaces static personas with a live User Profile widget showing user name, email, avatar initials, role badge, and a Logout button.
- 1-Click Demo Accounts: Instant testing helper for pre-configured Admin (Sarah Jenkins) and Freelancer (Charlie Dupont) sessions with real API authentication.
- Role-Based Permission Enforcement: Freelancers only access Freelancer views (My Timesheets, My Projects), while Administrators access Project Admin views (Validation Queue, Projects) and can preview the Freelancer view.
2. Freelancer Interface
- Timesheet Entry:
- Interactive project & month selector.
- Automatic calculation and display of the assignment date range.
- Visual differentiation of active contract dates vs. outside-contract dates.
- Day-by-day table/grid: Worked checkbox toggle, Task details input, and Meeting minutes duration.
- Real-time metrics: Total Days Worked, Total Meeting Hours, Estimated Earnings.
- Mandatory Base64 Invoice Attachment: Supports uploading PDF or image files, plus an instant "Generate Sample PDF Invoice" button for rapid testing.
- Timesheet submission workflow: Validates mandatory invoice, marks submitted, and securely locks timesheet against edits.
- My Projects:
- Overview of all assigned client projects with start and end dates, daily rates, and direct links to enter timesheets.
- Submitted Months History:
- Summary table of all monthly timesheets.
- Status badges:
Draft,Submitted(Pending Admin Review),Validated(Approved), andRefused. - Preview and download attached invoices (Base64 PDF / image viewer).
- Prominent display of Admin Rejection Notes for refused submissions.
- Edit & Resubmit action for refused months that re-enables editing to adjust days, update notes, replace invoice, and resubmit.
3. Project Admin Interface
- Projects & Assignments Tab:
- Complete list of projects with administrator contacts and status.
- Assigned freelancers per project with active Start Date and End Date.
- "Edit Dates" modal to modify contract periods.
- "Add Freelancer" modal to assign existing or new freelancers with date ranges and daily rates.
- "Remove Freelancer" workflow with confirmation.
- "Add New Project" modal to create new projects.
- Timesheet Validation Queue:
- Real-time queue of all submitted timesheets with status filters (Pending Review, Validated, Refused, All).
- Detailed inspection modal:
- Complete summary of days worked, meeting hours, daily rate, total payout.
- Full day-by-day breakdown of tasks and meeting durations.
- Invoice inspection with inline Base64 viewer and direct download.
- Validate Month action: Approves timesheet.
- Refuse Month action: Prompts for rejection feedback notes, marks refused, and instantly unlocks the timesheet on the freelancer's side for re-editing.
4. Data Persistence & Kallax API Integration
- Initial seed data matching Kallax tables:
projectsassignmentstimesheetstimesheet_days
- Automatic bidirectional sync with Kallax REST endpoints and persistent client-side
localStoragefallback. - Modern, clean UI built with Tailwind CSS, responsive tables, cards, modals, and toast alerts.