feat: add Projects management feature (CRUD API + UI)#772
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
feat: add Projects management feature (CRUD API + UI)#772devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
- Add projects table to SQLite database schema with name, description, client_id (FK), start_date, status (active/completed/on-hold), user_email - Add Joi validation schemas for project create/update - Add /api/projects routes with GET, GET/:id, POST, PUT/:id, DELETE/:id - Register project routes in server.js - Add comprehensive backend tests (28 test cases) - Add Project types and API client methods on frontend - Add ProjectsPage with table view, create/edit dialog, delete confirmation - Add Projects link to sidebar navigation with Folder icon - Add /projects route to App.tsx
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Extract PROJECT_SELECT, fetchProjectById, parseProjectId, verifyOwnership helpers in routes/projects.js to avoid repeating the JOIN query - Extract mockDbInsert, mockDbRunError, mockDbGetResult, mockDbGetError helpers in tests to reduce structural duplication with other test files - Use loop-based field assignment in PUT handler instead of repetitive if blocks
Adds verifyClientOwnership check in POST and PUT routes to ensure the referenced client belongs to the authenticated user, preventing cross-tenant data leakage. Follows the same pattern used in workEntries.js for client validation.
Joi.date().iso() converts date strings to Date objects, which sqlite3 stores as epoch milliseconds. Switch to Joi.string().pattern(/YYYY-MM-DD/) to preserve the date string format through the entire pipeline.
…dation Restore Joi.date().iso() for real date validation (rejects 2024-99-99), but convert Date objects to YYYY-MM-DD strings before sqlite3 storage to prevent epoch millis.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds a full "Projects" management feature following existing codebase patterns. Each project has a name, description, client assignment (FK →
clients), start date, and status (active/completed/on-hold).Backend:
projectstable in SQLite withON DELETE SET NULLfor client FKprojectSchema/updateProjectSchemainvalidation/schemas.js/api/projectsroutes (GET list, GET :id, POST, PUT :id, DELETE :id) — all scoped touser_emailFrontend:
ProjectsPage.tsxwith MUI table, create/edit dialog (Select for client + status, date picker), delete confirmationgetProjects,createProject,updateProject,deleteProject/projectsadded toApp.tsx, nav item withFolderIconinLayout.tsxLink to Devin session: https://partner-workshops.devinenterprise.com/sessions/5a7fb17d419c4232a7421cac55a474f2
Requested by: @bsmitches