- Node.js and npm installed
- Database connection configured
- Existing TaskChain application running
# Install Radix UI Collapsible component
npm install @radix-ui/react-collapsible@1.1.2Note:
@radix-ui/react-scroll-areaand@radix-ui/react-separatorare already installed.
# Run migrations to create new tables and columns
npm run migrateExpected Output:
✓ Migration 008_milestone_submission_history.sql completed
✓ Table milestone_submission_history created
✓ Columns added to milestones table
Verify Migration:
-- Check if table exists
SELECT * FROM milestone_submission_history LIMIT 1;
-- Check new columns
SELECT submission_notes, revision_requested, revision_count
FROM milestones LIMIT 1;Ensure all new files are in place:
# Check API routes
ls app/api/milestones/[id]/request-changes/route.ts
ls app/api/milestones/[id]/history/route.ts
# Check components
ls components/dashboard/milestone-review.tsx
ls components/dashboard/milestone-submission-card.tsx
ls components/ui/collapsible.tsx
ls components/ui/separator.tsx
ls components/ui/scroll-area.tsx
# Check page
ls app/dashboard/milestones/[id]/page.tsx
# Check migrations
ls lib/db/migrations/008_milestone_submission_history.sql
# Check documentation
ls docs/milestone-review-interface.md
ls docs/milestone-review-quick-start.md
ls MILESTONE_REVIEW_FEATURE.md# Start development server
npm run dev
# Navigate to:
http://localhost:3000/dashboard/milestones/[any-milestone-id]# Run test suite
npm run test
# Run specific test
npm run test milestone-review.test.tsxTest each endpoint manually:
# Get milestone
curl -X GET http://localhost:3000/api/milestones/[id] \
-H "Authorization: Bearer YOUR_TOKEN"
# Submit milestone (Freelancer)
curl -X POST http://localhost:3000/api/milestones/[id]/submit \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"submission_notes":"Test","deliverable_links":["https://test.com"]}'
# Approve milestone (Client)
curl -X POST http://localhost:3000/api/milestones/[id]/approve \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"action":"approve"}'
# Request changes (Client)
curl -X POST http://localhost:3000/api/milestones/[id]/request-changes \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"revision_notes":"Please revise"}'
# Get history
curl -X GET http://localhost:3000/api/milestones/[id]/history \
-H "Authorization: Bearer YOUR_TOKEN"- Migration file exists:
lib/db/migrations/008_milestone_submission_history.sql - Migration ran successfully
- Table
milestone_submission_historycreated - Columns added to
milestonestable - Indexes created successfully
-
@radix-ui/react-collapsibleinstalled -
@radix-ui/react-scroll-areaexists (already installed) -
@radix-ui/react-separatorexists (already installed) - No dependency conflicts
-
GET /api/milestones/[id]returns milestone data -
POST /api/milestones/[id]/submitaccepts submissions -
POST /api/milestones/[id]/approveprocesses approvals -
POST /api/milestones/[id]/request-changescreates revision requests -
GET /api/milestones/[id]/historyreturns history - All endpoints return proper error codes
- Authentication required on all endpoints
- Role-based access control working
-
MilestoneReviewcomponent renders -
MilestoneSubmissionCardcomponent renders - Status badges display correctly
- Action buttons appear for correct roles
- Dialogs open and close properly
- Loading states show correctly
- Error states display messages
- Toast notifications work
-
/dashboard/milestones/[id]page accessible - Client view shows review actions
- Freelancer view shows submission card
- Navigation works correctly
- Back button functions
- Error page displays on failures
- Client can approve milestone
- Client can request changes
- Client can reject milestone
- Freelancer can submit milestone
- Freelancer sees revision alerts
- Submission history loads
- History entries display correctly
- Timestamps formatted properly
- Deliverables display correctly
- Desktop view (>1024px) works
- Tablet view (640-1024px) works
- Mobile view (<640px) works
- Buttons accessible on touch devices
- Text readable on all screen sizes
- No horizontal scrolling issues
- Keyboard navigation works
- Screen reader compatible
- Focus management correct
- ARIA labels present
- Color contrast sufficient
- Semantic HTML used
- Authentication enforced
- Role-based access working
- SQL injection protected
- XSS protection in place
- Input validation working
- Error messages don't leak info
-
milestone-review-interface.mdcomplete -
milestone-review-quick-start.mdavailable -
MILESTONE_REVIEW_FEATURE.mdreadable - API documented
- Component props documented
- Database schema documented
- Test file created:
__tests__/milestone-review.test.tsx - Tests pass:
npm run test - Manual testing completed
- Edge cases tested
- Error scenarios tested
Symptoms:
Error: relation "milestone_submission_history" already exists
Solution:
-- Check if table exists
SELECT * FROM milestone_submission_history;
-- If it exists but has issues, drop and re-run
DROP TABLE IF EXISTS milestone_submission_history CASCADE;
-- Re-run migration
npm run migrateSymptoms:
Module not found: Can't resolve '@radix-ui/react-collapsible'
Solution:
npm install @radix-ui/react-collapsible@1.1.2
npm run devSymptoms:
404 Not Found for /api/milestones/[id]/history
Solution:
- Verify file exists:
app/api/milestones/[id]/history/route.ts - Restart dev server:
npm run dev - Check for TypeScript errors:
npm run build
Symptoms:
Error: DATABASE_URL environment variable is not set
Solution:
# Check .env file exists
cat .env
# Verify DATABASE_URL is set
grep DATABASE_URL .env
# Copy from example if missing
cp env.example .env
# Then edit .env with your database credentialsSymptoms:
- Blank page
- "Component is not defined" error
Solution:
- Check imports are correct
- Verify component file exists
- Clear Next.js cache:
rm -rf .next
npm run devSymptoms:
Test suite failed to run
Solution:
# Install test dependencies
npm install --save-dev @testing-library/react @testing-library/jest-dom vitest jsdom
# Clear test cache
npm run test -- --clearCache
# Run tests again
npm run testEnsure notification system is set up for:
- Milestone submitted
- Milestone approved
- Milestone rejected
- Revisions requested
Add links to milestone review in:
- Dashboard contract cards
- Freelancer milestone list
- Client project views
Set up monitoring for:
- API endpoint response times
- Database query performance
- User interaction metrics
Provide documentation to:
- Clients on how to review submissions
- Freelancers on how to submit work
- Both on submission history
# Check all files exist
find . -name "milestone-review*" -o -name "milestone-submission*"
# Count new API routes
find app/api/milestones -name "route.ts" | wc -l
# Check database tables
psql $DATABASE_URL -c "\dt milestone*"
# Test build
npm run build
# Check for errors
npm run lintYour installation is complete when:
- ✅ All dependencies installed
- ✅ Database migration successful
- ✅ All API endpoints working
- ✅ UI components rendering correctly
- ✅ Tests passing
- ✅ Client can approve/reject/request changes
- ✅ Freelancer can submit milestones
- ✅ History tracking working
- ✅ Responsive on all devices
- ✅ No console errors
After successful installation:
- Deploy to staging for QA testing
- Gather user feedback from beta testers
- Monitor metrics for adoption and issues
- Plan enhancements based on usage
- Update user documentation as needed
If you encounter issues not covered here:
- Check the comprehensive documentation:
docs/milestone-review-interface.md - Review the quick start guide:
docs/milestone-review-quick-start.md - Check console logs for error details
- Verify all environment variables are set
- Ensure database connection is working
Installation Guide Version 1.0.0
Last Updated: August 2026