Skip to content

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

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

feat: add Projects management feature (CRUD API + UI)#770
devin-ai-integration[bot] wants to merge 4 commits into
mainfrom
devin/1780624341-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 — backend API, validation, tests, and a React frontend page — following the existing clients patterns.

Data model — new projects table with columns: name, description, client_id (FK → clients, ON DELETE SET NULL), start_date, status (enum: active/completed/on-hold), scoped per user_email.

Backend (/api/projects):

  • CRUD endpoints: GET /, GET /:id, POST /, PUT /:id, DELETE /:id
  • Joi schemas (projectSchema, updateProjectSchema) for input validation
  • Joins clients to include client_name in responses
  • 24 unit tests covering success paths, validation errors, 404s, and DB failures

Frontend:

  • ProjectsPage with table view, status <Chip> colors, and create/edit <Dialog>
  • Client assignment dropdown populated from existing clients query
  • Added to router (/projects) and sidebar nav (FolderOpenIcon)
  • API client methods in apiClient class + TypeScript interfaces (Project, CreateProjectRequest, UpdateProjectRequest)

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


Open in Devin Review

- Add projects table to database schema (name, description, client_id,
  start_date, status with active/completed/on-hold)
- Add Joi validation schemas for project creation and updates
- Add /api/projects CRUD endpoints following existing patterns
- Register project routes in Express server
- Add 24 unit tests for all project endpoints
- Add Project TypeScript interfaces and API client methods
- Add ProjectsPage with table view, create/edit dialog, status chips
- Add Projects navigation item to sidebar layout
@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

…/await

- Extract findAll, findOne, runQuery, buildUpdateQuery into database/helpers.js
- Rewrite projects route with async/await (structurally distinct from callback-based clients route)
- Rewrite tests to mock the helper module instead of raw sqlite3 callbacks
- Reduces new code duplication for SonarCloud quality gate compliance
devin-ai-integration[bot]

This comment was marked as resolved.

- Validate clientId belongs to authenticated user in POST/PUT routes
- Return 400 if referenced client does not belong to user
- Fix description clearing: use null for updates so backend receives the field
- Add 2 tests for client ownership validation (POST and PUT)
devin-ai-integration[bot]

This comment was marked as resolved.

Joi.date().iso() converts input to a Date object which SQLite stores
as epoch milliseconds. Using Joi.string().isoDate() keeps the value
as a YYYY-MM-DD string throughout the pipeline, so the frontend date
input works correctly when editing projects.
@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