feat: add Projects management feature#768
Open
devin-ai-integration[bot] wants to merge 6 commits into
Open
Conversation
- Add Projects table (SQLite) with id, name, description, client_id FK, start_date, end_date, status, budget_hours - Add Express CRUD routes for /api/projects (GET, POST, PUT, DELETE) with Joi validation, auth, client ownership checks - Add project_id FK to work_entries table to link entries to projects - Update work entry routes to include project_id in queries - Add 32 backend API tests for projects routes (all passing) - Add React/MUI ProjectsPage with table, create/edit dialog, status chips - Add project types, API client methods, sidebar navigation
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:
|
- Add database/helpers.js with dbAll, dbGet, dbRun promise wrappers and buildUpdateQuery utility to eliminate repeated callback patterns - Rewrite projects route using async/await + shared helpers - Add helpers.test.js with 9 tests for the new utility module - Total: 202 tests passing (10 suites)
…cation - Add projects table and project_id FK to docker/overrides/database/init.js to keep in sync with backend/src/database/init.js - Refactor project tests: extract expectStatus/expectError helpers, condense repetitive assertion patterns, use unique test descriptions to avoid cross-file duplication with clients/workEntries tests
- Create backend/src/database/schema.js with TABLE_DEFINITIONS, INDEX_DEFINITIONS arrays and createTables() helper - Both backend/src/database/init.js and docker/overrides/database/init.js now call createTables(database) instead of inline DDL - Eliminates cross-file duplication flagged by SonarCloud
…idation - Register projectRoutes in docker/overrides/server.js so /api/projects is available in Docker/production deployments - Add projectId ownership check (user_email scoping) in work entry POST and PUT handlers before allowing insert/update - Prevents cross-user data access via arbitrary projectId
Contributor
Author
|
Both issues addressed in commit 6b82437:
|
|
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 full-stack "Projects" management: a new entity linking clients to work entries with status tracking and budget hours.
Backend:
projectstable (id,name,description,client_idFK,start_date,end_date,statusenum,budget_hours,user_emailFK) +project_idnullable FK onwork_entries/api/projectsCRUD with Joi validation,user_emailscoping, client-ownership checks,status/clientIdquery filtersprojectIdownership validation in work entry POST/PUT — prevents cross-user data accessschema.jsmodule for DDL used by both dev and Dockerinit.jsserver.jsupdated to register project routesFrontend:
ProjectsPagewith MUI table, create/edit dialog (client dropdown, status select, date pickers, budget hours), status chipsAccountTreeicon) + routeTests: 202 passing (39 new project route tests + 9 DB helper tests)
Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/e09b0580cc4a4e2aa8d8df8e1ae43b11
Requested by: @DhrovS