6.0 KiB
6.0 KiB
Dashy Project Refactor: Progress Report
Objective: Transition Dashy from a browser-based SQLite (local storage) application to a Client-Server architecture using a Python FastAPI backend with a persistent database.
✅ Completed Tasks
1. Backend Infrastructure Setup
- Created
backend/directory structure. - Configured
requirements.txtwith essential libraries (fastapi,sqlalchemy,pydantic,jose, etc.). - Fix: Pinned
bcrypt==4.0.1to resolve compatibility issues withpasslib.
2. Database Modeling
- Schema Design: Translated the original
db.jsschema into SQLAlchemy models inmodels.py. - Relationships: Established Many-to-Many relationships for Task Tags and One-to-Many for User Tasks and Notes.
- Audit Logging: Implemented a robust Audit Log system to track all user actions.
3. API Development
- Main App (
main.py): Set up FastAPI with CORS middleware enabled for frontend communication. - Authentication: Built JWT-based login flow in
auth.py. - Endpoints: Created initial endpoints for:
- User retrieval
- Task CRUD (Create, Read, Update)
- Audit log retrieval/creation
4. Data Migration & Environment Handling
- Seeding: Created
seed.pyto migrate initial prototype data into the new database. - CIFS/NAS Fix:
- Implemented
DASHY_DB_PATHenvironment variable support to allow the database file to reside on a local disk while code stays on the NAS. - Added a 30-second connection timeout to mitigate network latency.
- Implemented
🚧 Current Status
- Backend: Feature-complete for the first phase.
- Database: Schema is stabilized, seeding logic is verified, and database is active.
- Frontend: Integrated with FastAPI backend via
api.js. Legacy WASM SQLite files archived.
⏭️ Upcoming Steps
Phase 2: Frontend Refactor & Workflow Polish (✅ Completed)
- API Integration: Created
api.jsto handle network requests, swappedDashyDBfor async API calls inapp.jsx, and updated Login to use JWT tokens. - Legacy Cleanup: Archived
db.jsanddata.jsxtoDashy-v1/scraps/and removedsql.jsWASM dependency fromDashy.html. - API Base URL Fix: Updated
api.jsto dynamically use the browser's hostname to resolve "Connection Refused" errors. - Audit Rendering Crash Fix: Resolved the
TASK_AUDITReferenceError by passing live API audit logs into theTaskDetailmodal. - UI State Refresh Fix: Modified the
useApiDatahook to fetch subsequent updates silently without unmounting the app (fixing the drag-and-drop refresh bug). - Task Completion: Added a "Mark as completed" button, removed closed tasks from the main Overview board, and set up audit logging.
- User Views Update: Updated
UserScreento accurately display open task counts and render a dedicated, faded "Completed" section for closed tasks. - Task Reopening: Added a "Reopen task" button to restore accidentally closed tasks back to the queue.
- User Management (Settings): Built backend API endpoints (
POST,PATCH,DELETEfor/users) and wired up theWorkspaceTaballowing Admins to manage the team from the UI. - Task Editing: Implemented inline editing for task descriptions using an active text box state with "Save/Cancel" actions.
- UI Cleanup: Removed hardcoded, prototype placeholder notes from the
TaskDetailmodal to prepare for future dynamic notes integration. - Permanent Deletion: Added a "Delete task permanently" button to the
TaskDetailsidebar with a confirmation dialog, backed by a newDELETE /tasks/{id}API endpoint. - Permanent Deletion Wiring Fix: Resolved a three-layer bug where the delete button was non-functional:
- Added the missing
onDeleteTaskprop to theTaskDetailcomponent signature inscreens.jsx. - Added the missing
deleteTaskhandler inapp.jsx(callsapi.deleteTask, writes an audit entry, and closes the modal). - Restarted the FastAPI backend so the previously-added
DELETE /tasks/{id}route was loaded into the running process (was returning 405 prior to restart).
- Added the missing
- Password Management: Made the "Change password" flow real (previously a placeholder UI).
- Backend: Added
PasswordChangeschema and a newPOST /users/{user_id}/passwordendpoint that verifies the current password (401 on mismatch) before re-hashing and saving the new one. - API client: Added
api.changePassword(id, oldPwd, newPwd)that surfaces the backend'sdetailmessage inline rather than just the HTTP status text. - Frontend: Wired the previously-inert "Update password" button in
SettingsScreen— submits viaonChangePassword, shows inline error / success states, disables while in flight, clears the fields on success, and writes apassword_changedaudit entry. - Defaults confirmed: Seeded users (
seed.py) and admin-created users (app.jsx) both default topassword123.
- Backend: Added
- Real Login Authentication: Fixed a security bug where the login screen accepted any password. Bound the input to component state and implemented proper 401 handling with inline error messaging.
- Network Hardening: Configured the frontend to use a relative
/apipath, allowing the FastAPI backend to be completely shielded behind an Nginx SSL reverse proxy on127.0.0.1. No internal ports are now exposed to the public internet. - API Authentication Enforcement: Fixed a security vulnerability where API endpoints were publicly accessible without a token. Implemented the
get_current_userdependency inbackend/auth.pyand applied it to all sensitive routes. Accessing/tasks,/users, etc. now strictly requires a valid JWT Bearer token.
Phase 3: Advanced Features
- Real-time Notifications: Explore WebSockets for task assignments.
- iMessage Integration: Develop the "Molty" bridge for phone-to-task creation.
- File Uploads: Support for attaching photos/documents to tasks.
Last Updated: Monday, May 11, 2026 Status: Phase 2 Complete / Ready for Phase 3