Skip to content

feat: add Projects management feature with full CRUD#472

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1776165444-add-projects-feature
Open

feat: add Projects management feature with full CRUD#472
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1776165444-add-projects-feature

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Apr 14, 2026

Summary

Adds a new "Projects" resource to the app with full create/read/update/delete support across backend and frontend.

Backend:

  • New projects table (name, description, client_id FK, start_date, status with CHECK constraint for active/completed/on-hold, user_email FK, timestamps) with indexes
  • Joi validation schemas for create (projectSchema) and update (updateProjectSchema)
  • Express CRUD routes at /api/projects — all user-scoped, with LEFT JOIN to include client_name, and client ownership validation when assigning a client
  • 490 lines of Jest tests (30+ cases) covering all endpoints, validation, and error paths

Frontend:

  • Project, CreateProjectRequest, UpdateProjectRequest TypeScript interfaces
  • API client methods for all 5 endpoints
  • ProjectsPage component with table view, create/edit dialog (name, client dropdown, date picker, status select, description), and delete with confirmation
  • Route added at /projects, navigation item added to sidebar

Review & Testing Checklist for Human

  • Dynamic SQL construction in PUT /api/projects/:id (backend/src/routes/projects.js): The update route dynamically builds SET clauses and a params array based on which fields are provided. Verify no off-by-one or missing field mapping bugs, especially for clientId → client_id and startDate → start_date field name translations.
  • Client ID null/0 edge cases: Frontend uses 0 as a sentinel for "no client" in the Select, converting to null before API calls. Backend checks if (clientId) to decide whether to validate client ownership. Confirm this handles explicit unassignment (setting clientId to null on an existing project) correctly.
  • Date timezone handling: Frontend converts DatePicker values via toISOString().split('T')[0] which uses UTC. A user in a negative UTC offset picking a date could see it shift back one day. Verify this is acceptable or if local date formatting is preferred.
  • Manual E2E test: No automated frontend tests exist. Run both servers, navigate to /projects, and exercise the full CRUD flow — create a project with and without a client, edit status/name/dates, delete. Verify the table updates correctly after each mutation.
  • Existing database migration: The CREATE TABLE IF NOT EXISTS in init.js works for in-memory SQLite (recreated on restart) but won't affect already-existing persistent databases. Confirm this matches the deployment model.

Notes

  • CreateProjectRequest and UpdateProjectRequest types are defined in types/api.ts but the API client methods use inline type annotations instead of referencing these interfaces — minor consistency gap, no functional impact.
  • Deleting a client will SET NULL on associated projects' client_id (FK constraint). This is intentional but worth being aware of.
  • Backend tests mock the database layer; they do not exercise actual SQLite behavior (e.g., FK constraints, CHECK constraints).

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/fed3787d437b460680227291e4790f38


Open with Devin

- Add projects table with name, description, client_id, start_date, status
- Create REST API endpoints (GET, POST, PUT, DELETE) with auth and validation
- Add Joi validation schemas for create and update operations
- Write comprehensive backend tests (30+ test cases)
- Create ProjectsPage frontend component with table and CRUD dialog
- Add project types, API client methods, routing, and 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 and CI monitoring

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

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.

0 participants