Skip to content

feat: add Projects management feature (CRUD API + UI)#772

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

feat: add Projects management feature (CRUD API + UI)#772
devin-ai-integration[bot] wants to merge 5 commits into
mainfrom
devin/1780671943-add-projects-feature

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

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

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:

  • projects table in SQLite with ON DELETE SET NULL for client FK
  • Joi schemas: projectSchema / updateProjectSchema in validation/schemas.js
  • /api/projects routes (GET list, GET :id, POST, PUT :id, DELETE :id) — all scoped to user_email
  • 28 unit tests covering all endpoints + error paths

Frontend:

  • ProjectsPage.tsx with MUI table, create/edit dialog (Select for client + status, date picker), delete confirmation
  • API client methods: getProjects, createProject, updateProject, deleteProject
  • Route /projects added to App.tsx, nav item with FolderIcon in Layout.tsx

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/5a7fb17d419c4232a7421cac55a474f2
Requested by: @bsmitches


Open in Devin Review

- 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
@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

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

This comment was marked as resolved.

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

This comment was marked as resolved.

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

This comment was marked as resolved.

…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.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 5, 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