Skip to content

feat: add Projects management feature#768

Open
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/1780442063-add-projects-feature
Open

feat: add Projects management feature#768
devin-ai-integration[bot] wants to merge 6 commits into
mainfrom
devin/1780442063-add-projects-feature

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Jun 2, 2026

Summary

Adds full-stack "Projects" management: a new entity linking clients to work entries with status tracking and budget hours.

Backend:

  • projects table (id, name, description, client_id FK, start_date, end_date, status enum, budget_hours, user_email FK) + project_id nullable FK on work_entries
  • /api/projects CRUD with Joi validation, user_email scoping, client-ownership checks, status/clientId query filters
  • projectId ownership validation in work entry POST/PUT — prevents cross-user data access
  • Shared schema.js module for DDL used by both dev and Docker init.js
  • Docker override server.js updated to register project routes

Frontend:

  • ProjectsPage with MUI table, create/edit dialog (client dropdown, status select, date pickers, budget hours), status chips
  • TypeScript types + API client + sidebar nav (AccountTree icon) + route

Tests: 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


Open in Devin Review

- 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
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

- 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
devin-ai-integration[bot]

This comment was marked as resolved.

…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
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Both issues addressed in commit 6b82437:

  1. Docker override server.js — added projectRoutes registration (import + app.use) so /api/projects works in Docker/production deployments.
  2. projectId ownership validation — added user_email scoping check for projectId in both work entry POST and PUT handlers, preventing cross-user data access.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 2, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant