Overview
PhotoFlow’s task management system allows you to track photography orders through their entire lifecycle - from initial booking to final delivery. Each task represents an order or project with details like client information, due dates, and current status.Task Data Model
Each task in PhotoFlow contains the following information:Tasks table in PostgreSQL. See the Prisma schema for technical details.
Creating Tasks
There are multiple ways to create tasks in PhotoFlow:Via Kanban Board
Fill in Details
Complete the task form:
- Task Name - Brief description (e.g., “Wedding Photography - Smith Family”)
- Description - Additional details about the order
- Due Date - When the task should be completed
- Status - Current status of the order
Via API
Create tasks programmatically using the API endpoint:API Implementation
The task creation endpoint is implemented insrc/routes/api/(tasks-clients)/createNewTask/+server.ts:
The same endpoint handles both task creation (no taskID) and updates (with taskID).
Updating Tasks
Modify task details at any time:From Kanban Board
All changes are immediately visible to other users on the network via real-time sync.
Using the Helper Function
PhotoFlow provides a utility function for programmatic updates insrc/lib/utils/generalHelpers.ts:
Moving Tasks Between Columns
Tasks can be moved between workflow stages:Drag and Drop
The easiest method:- Click and hold a task card
- Drag it to the target column
- Release to drop
taskColumn is automatically updated in the database.
Edit Modal
Alternatively:- Click the task to open the edit modal
- Change the column/status field
- Save changes
Finishing Tasks
Mark tasks as complete when the order is delivered:From Task Overview
Via API
Finish tasks programmatically:Finished tasks are hidden from the Kanban board but remain in the database. You can view them in the Task Overview by filtering for completed tasks.
Deleting Tasks
Delete tasks via the API:- The task record is removed from the database
- All associated comments are deleted (cascading delete)
- The change syncs to all connected clients
Viewing Tasks
Kanban Board View
The primary view showing active tasks organized by workflow stage:- Visual, drag-and-drop interface
- Only shows unfinished tasks
- Grouped by column
- Real-time updates
/dashboard
Task Overview
An alternative list view with more details:- All tasks in a sortable list
- Filter by status, date, or completion
- Bulk operations
- Detailed information display
/taskOverview
Task Filters
Active Tasks Only
By default, the Kanban board filters out finished tasks:By Column
Tasks are filtered by theirtaskColumn property to show only relevant cards in each column.
Custom Filtering
You can implement custom filters in the Task Overview or by modifying the API endpoints to filter by:- Date range
- Status
- Client name
- Priority
Task Comments
Every task can have comments for team collaboration. Theamount_of_comments field tracks how many comments exist:
Bulk Operations
CSV Import
Import multiple tasks at once from a CSV file. See Data Export/Import for details.Batch Updates
For programmatic batch updates, you can loop through tasks and call the API:Real-Time Sync
All task operations trigger real-time updates via Socket.io:
This ensures your team always sees the current state of all orders without manual refreshing.
Best Practices
Descriptive Names
Use clear, consistent naming:
- Include client name
- Add event type or order number
- Keep it concise but informative
Accurate Due Dates
Set realistic due dates:
- Account for all workflow stages
- Build in buffer time
- Update if timeline changes
Regular Updates
Keep tasks current:
- Move tasks as work progresses
- Add comments for status changes
- Mark finished when complete
Use Descriptions
Add helpful details:
- Special client requests
- Location information
- Technical requirements
Sorting Tasks
PhotoFlow includes a utility function for sorting insrc/lib/utils/generalHelpers.ts:
Validation
Task creation and updates include basic validation:- Required fields: Task name and due date are required
- Date format: Due dates must be valid ISO date strings
- Status: Status field accepts any string value
- Column: Must reference a valid column ID
Troubleshooting
Task not appearing after creation
Task not appearing after creation
- Check browser console for API errors
- Verify database connection is working
- Ensure all required fields are provided
- Check Socket.io is connected for real-time updates
Cannot update task
Cannot update task
- Verify you have a valid taskID
- Check the API response for error messages
- Ensure database permissions allow UPDATE operations
- Verify the task exists in the database
Finished tasks still appearing
Finished tasks still appearing
The Kanban board filters finished tasks automatically. If they’re appearing:
- Verify
is_finishedis set totrue - Check the filter logic in the page component
- Refresh the page
Real-time sync not working
Real-time sync not working
If changes don’t appear on other PCs:
- Check Socket.io connection status
- Verify
VITE_SOCKET_URLis configured - Ensure no firewall is blocking WebSocket connections
- Check server logs for errors
API Reference Summary
| Endpoint | Method | Purpose |
|---|---|---|
/api/createNewTask | POST | Create or update task |
/api/getUserTasks | POST | Retrieve tasks |
/api/finishUserTask | POST | Mark task as finished |
/api/deleteUserTask | POST | Delete task |
src/routes/api/(tasks-clients)/ for implementation details.
Next Steps
Kanban Board
Learn about the visual workflow interface
Task Comments
Add comments to tasks for team collaboration
CSV Import/Export
Bulk import/export tasks via CSV files
Database Setup
Understand the database schema