This document outlines recommended improvements to make the Redezeit project more maintainable, robust, and production-ready.
- Total Lines of Code: ~4,587 (TypeScript/TSX)
- Current Type Errors: 0 ✅ (Fixed in PR #332)
- Current Lint Errors: 2
- Test Coverage: Minimal (1 test file)
- Outdated Dependencies: 37+
- Security Vulnerabilities: 9 ✅ (all moderate, dev-only) - Fixed in PR #[TBD], reduced from 22
- Node Version: >=22.2.0
Status: ✅ Completed in PRs #331 and #332
Impact: High - Type safety is compromised, potential runtime errors
Completed Tasks:
- Fix null assignment type errors in
SpeakingTimeContent.tsx:275-279 - Fix
Documenttype mismatches inSpeakingTimeContent.tsx:283 - Add proper type guards for
pageproperty in route loaders - Fix meta function type signature in blog post route
- Add proper type assertions for Contentful fields that are currently typed as
any - Fix array iteration type issues in tag filtering
- Remove unused
app/utils/i18n.tsfile
Actual effort: ~4 hours
Status: ✅ Completed in PR #[TBD]
Impact: High - Security risks, potential exploits
Completed Tasks:
- Ran
npm audit fixto auto-update vulnerable dependencies - Fixed 13 vulnerabilities automatically (all critical, high, and low severity issues)
- Verified TypeScript compilation passes
- Verified production build succeeds
- All tests pass
Results:
- Before: 22 vulnerabilities (1 critical, 4 high, 11 moderate, 6 low)
- After: 9 moderate severity vulnerabilities
- Fixed: All critical and high severity vulnerabilities ✅
Remaining vulnerabilities (all moderate, development-only):
esbuild(8 instances) - Only affects development server, not production. Fix requires breaking change to Vitest v4.remark-mdx-frontmatter(1 instance) - Remix dependency, will be fixed in future Remix updates.
Packages updated:
- @babel/helpers, @babel/runtime (fixed RegExp complexity)
- @remix-run/express, @remix-run/node, @remix-run/serve (fixed URL manipulation)
- brace-expansion (fixed ReDoS)
- on-headers (fixed header manipulation)
- tar-fs (fixed path traversal)
- undici (fixed random values and certificate issues)
- vitest (fixed critical RCE - updated to 2.1.9)
Actual effort: ~1.5 hours
Status: ✅ Completed in PR #334
Impact: High - Currently no working linter for project files, plus faster tooling
Issue: ESLint parsing errors in getContentfulEnvironment.js and tailwind.config.js suggest missing or misconfigured setup. Biome is significantly faster than ESLint (10-100x) and can replace both ESLint and Prettier.
Completed Tasks:
- Install Biome:
npm install --save-dev --save-exact @biomejs/biome - Initialize Biome:
npx @biomejs/biome init - Configure
biome.jsonwith:- TypeScript and React support
- JSX accessibility rules
- Import sorting
- Formatting rules
- Remove ESLint and Prettier dependencies
- Remove
.prettierrcand.prettierignorefiles - Update npm scripts:
-
"lint": "biome check ." -
"lint:fix": "biome check --write ." -
"format": "biome format --write ."
-
- Run auto-fix (fixed 128 files automatically)
- Verify TypeScript compilation passes
- Verify production build succeeds
- Add pre-commit hook using Biome (husky + lint-staged) - deferred to future PR
- Update CI/CD to use Biome - deferred to future PR
Results:
- Auto-fixed: 128 files
- Identified Issues: 44 errors, 62 warnings (mostly accessibility and code quality improvements)
- TypeScript: ✅ All type checks pass
- Production Build: ✅ Build succeeds
Remaining Work (for follow-up PRs):
- Fix accessibility issues (missing alt text, button types, etc.)
- Remove
as anytype assertions (see task #4) - Add pre-commit hooks
- Update CI/CD pipeline
Actual effort: ~2 hours
Impact: Medium - New developers cannot easily set up the project
Issue: README.md references .env.template but file doesn't exist.
Tasks:
- Create
.env.templatewith all required variables:CONTENTFUL_SPACE= CONTENTFUL_ACCESSTOKEN= CONTENTFUL_ENVIRONMENT=master CONTENTFUL_MANAGEMENT_API_ACCESS_TOKEN= - Ensure
.envis in.gitignore(✓ already done) - Add comments explaining where to find each value
Estimated effort: 15 minutes
Impact: High - Type safety bypass, defeats TypeScript purpose
Issue: Extensive use of as any in ContentBlocks.tsx (lines 39, 52, 64, 77, 98, 114, 130, 142, 154, 159, 171, 185, 199)
Tasks:
- Create proper TypeScript discriminated union types for content blocks
- Use type guards instead of
as anyassertions - Create helper functions with proper type narrowing
- Consider using Contentful's generated types more effectively
Example refactor:
// Instead of: const { content } = item!.fields as any;
// Use proper type narrowing:
if (
id === "centeredContent" &&
item.sys.contentType.sys.id === "centeredContent"
) {
const block = item as Entry<TypeCenteredContentSkeleton>;
const { content, bgcolor } = block.fields;
// ... rest of logic
}Estimated effort: 6-8 hours
Impact: High - Foundation for all future tests
Current state: Only 1 test file, Vitest has issues
Tasks:
- Create
vitest.config.tswith proper setup - Fix Vitest hanging issue (pool settings, environment config)
- Add test setup file with React Testing Library
- Add test utilities and mocks for Contentful
- Set coverage targets (70% utilities, 60% components)
- Update npm scripts for test workflows
Estimated effort: 3-4 hours
Impact: High - Test business logic
Tasks:
-
contentful.ts- Test data fetching functions- Test
getPage,getPageById - Test
getCoacheswith filtering - Test
getBlogposts,getBlogpost - Test error handling
- Test
-
getSearchPageContents.ts- Test coach filtering -
getFlagCodes.ts- Test flag mapping -
documentToSimpleString.ts- Expand existing test
Estimated effort: 6-8 hours
Impact: Medium-High - Catch UI regressions
Tasks:
-
CoachCard.tsx- Test rendering and contact methods -
ContentBlocks.tsx- Test block type rendering -
CoachFilterTag.tsx- Test filter interactions -
CookieBanner.tsx- Test consent management
Estimated effort: 6-8 hours
Impact: Medium - Ensure tracking and navigation work
Tasks:
-
gtag.client.ts- Test analytics tracking - Coach search route - Test filtering logic
- Blog routes - Test rendering and navigation
- Sitemap generation - Test XML output
Estimated effort: 5-6 hours
Impact: High - Major architectural change, future-proofs the app
Context: React Router v7 is the successor to Remix. The Remix team recommends migrating to React Router v7 as it combines the best of both frameworks with better performance and a more streamlined API.
- https://reactrouter.com/upgrading/remix - This is the canonical migration guide from the React Router team
Tasks:
- Read the entire migration guide: https://reactrouter.com/upgrading/remix
- Install React Router v7 packages (follow guide for exact versions)
- Update file-based routing (likely minimal changes per guide)
- Migrate from Remix loaders/actions to React Router loaders/actions
- Update data fetching patterns
- Replace
@remix-run/*imports withreact-routerequivalents (use codemod if available) - Update
entry.client.tsxandentry.server.tsx(follow guide examples) - Update Netlify adapter (check for
@react-router/netlifyor follow deployment guide) - Update
vite.config.tsto use React Router plugin - Update package.json scripts if needed
- Test all routes thoroughly (especially loaders, actions, and error boundaries)
- Update documentation and CLAUDE.md
Benefits:
- Modern framework with active development
- Better performance characteristics
- Simplified mental model
- Official successor to Remix
Notes:
- The migration guide includes codemods to automate many changes
- File-based routing conventions are largely compatible
- Most breaking changes are in package names, not APIs
Estimated effort: 8-10 hours
Impact: Medium - Quick security and bug fixes
Tasks:
- Update TypeScript 5.7.2 → 5.9.3
- Update Remix 2.15.2 → 2.17.1 (all packages)
- Update all other patch/minor versions
- Remove ESLint/Prettier if Biome is adopted
- Run tests and build
- Fix any breaking changes
Estimated effort: 2-3 hours
Impact: High - Major version with breaking changes
Tasks:
- Create separate branch for React 19 upgrade
- Update React and React-DOM to 19.2.0
- Update
@types/reactand@types/react-dom - Review React 19 migration guide
- Update deprecated APIs (if any)
- Test thoroughly (especially forms and suspense)
- Fix any type errors
Estimated effort: 3-4 hours
Impact: High - Major version with new engine
Tasks:
- Create separate branch for Tailwind 4 upgrade
- Review Tailwind v4 migration guide
- Update Tailwind CSS and related plugins
- Update configuration file format (if needed)
- Test all components for styling regressions
- Update custom CSS if needed
Estimated effort: 3-4 hours
Impact: Medium - Gradual modernization
Tasks:
- Update i18next 23.16.8 → 25.6.0
- Update Contentful 10.15.1 → 11.8.7
- Update Vite 5.4.11 → 7.1.11
- Review migration guides for each
- Test after each update
- Fix breaking changes
Estimated effort: 4-6 hours
Impact: Medium - Current type usage is incomplete
Issues:
- Type assertions in
contentful.ts(e.g.,as string,as any) - Inconsistent use of generated Contentful types
- Manual type casting of field values
Tasks:
- Review and regenerate Contentful types
- Add proper error handling for missing/invalid content
- Create type guard functions for Contentful entries
- Add JSDoc comments for complex type unions
- Consider using
Entry<T, 'WITHOUT_UNRESOLVABLE_LINKS'>consistently
Estimated effort: 4-6 hours
Impact: Medium - Better user experience on errors
Tasks:
- Add error tracking/logging (e.g., Sentry)
- Improve
BasicErrorBoundarycomponent with:- Localized error messages
- Different error states (404, 500, network errors)
- User-friendly error UI
- Retry mechanisms
- Add error boundaries at route level for better isolation
- Log errors to external service for monitoring
Estimated effort: 4-6 hours
Impact: Medium - Helps onboarding and maintenance
Tasks:
- Expand README with:
- Architecture overview
- Development workflow
- Deployment process
- Troubleshooting guide
- Contributing guidelines
- Document Contentful content model structure
- Add JSDoc comments to complex functions
- Create architecture decision records (ADRs) for major decisions
- Document environment-specific configurations
- Add component documentation (Storybook or similar)
Estimated effort: 6-8 hours
Impact: Low-Medium - Clean up technical debt
Found in:
app/utils/contentful.ts:201- "TODO: getGender requires lang due to getCoaches requires it"
Tasks:
- Review TODO in
contentful.tsabout gender/language coupling - Search for any FIXMEs or XXX comments
- Create issues for unresolved TODOs
- Either fix or document why they exist
Estimated effort: 2-3 hours
Impact: Medium - Faster rendering
Tasks:
- Add React.memo to expensive components (
CoachCard,ContentBlockschildren) - Implement virtual scrolling for coach list (react-window or react-virtual)
- Memoize expensive calculations in filters
- Add useMemo/useCallback where beneficial
Estimated effort: 3-4 hours
Impact: Medium - Faster page loads
Tasks:
- Add proper
sizesattributes to all images - Review Contentful image CDN parameters
- Lazy load images below the fold
- Consider WebP/AVIF fallbacks (already partially done)
- Optimize font loading (font-display already set)
Estimated effort: 3-4 hours
Impact: Medium - Better performance metrics
Tasks:
- Add route-level code splitting
- Implement caching strategy for Contentful requests
- Review and optimize bundle size (currently 1.8MB)
- Add performance monitoring (Web Vitals)
- Set up performance budgets
Estimated effort: 4-5 hours
Impact: Medium - Better understanding of user behavior
Current state: GTM and GA4 setup, but tracking could be improved
Tasks:
- Audit existing tracking events
- Add TypeScript types for all GA events
- Document all tracked events
- Add conversion tracking
- Implement event validation/testing
- Consider adding privacy-focused analytics (Plausible, Fathom)
- Review GDPR compliance
Estimated effort: 4-6 hours
Impact: Medium - Better UX for all users
Tasks:
- Run accessibility audit (axe, Lighthouse)
- Add proper ARIA labels throughout
- Ensure keyboard navigation works everywhere
- Add focus management in modals/filters
- Test with screen readers
- Add skip links
- Ensure color contrast meets WCAG AA standards
- Add alt text validation for images from Contentful
Estimated effort: 6-8 hours
Impact: Medium - Better localization support
Tasks:
- Audit translation completeness across all locales
- Add missing translations
- Implement translation fallbacks
- Add pluralization support where needed
- Consider using Contentful localization features more effectively
- Add RTL support preparation
- Document translation workflow for contributors
Estimated effort: 4-6 hours
Impact: Low-Medium - Better maintainability
Tasks:
- If not using Biome: Add Prettier configuration (currently empty
.prettierrc) - Configure import sorting (Biome handles this automatically)
- Add consistent file naming convention
- Extract magic strings to constants
- Remove unused imports/variables (Biome can auto-fix this)
- Standardize component prop interfaces naming
- Add consistent error handling patterns
- Remove commented-out code
Estimated effort: 4-6 hours
Impact: Low-Medium - Faster development
Tasks:
- Add VS Code recommended extensions and settings
- Create debug configurations
- Add npm scripts for common tasks:
-
npm run check-all- Run all checks -
npm run clean- Clean build artifacts -
npm run validate- Type check + lint + test
-
- Document local development tips
Estimated effort: 3-4 hours
Impact: Low-Medium - Better deployment confidence
Current state: Only CodeQL analysis workflow exists
Tasks:
- Add GitHub Actions for:
- Run tests on PR
- Type checking on PR
- Biome check on PR (linting + formatting)
- Build verification
- Lighthouse CI for performance
- Dependency vulnerability scanning
- Add PR preview deployments (Netlify already supports this)
- Add automatic changelog generation
- Set up branch protection rules
Estimated effort: 4-6 hours
Impact: Medium - Better security posture
Tasks:
- Add security headers in
netlify.toml:- Content-Security-Policy
- X-Frame-Options
- X-Content-Type-Options
- Referrer-Policy
- Audit third-party scripts (GTM, Brevo)
- Implement subresource integrity (SRI) for external scripts
- Add rate limiting for form submissions
- Review cookie security settings
- Add dependency vulnerability scanning in CI
Estimated effort: 3-4 hours
Impact: Low - Better content workflow
Tasks:
- Document Contentful content model
- Create content entry templates/examples
- Add content validation in loaders
- Implement preview mode for unpublished content
- Add webhook handlers for cache invalidation
- Consider implementing incremental static regeneration (ISR)
Estimated effort: 4-6 hours
Impact: Low - Reduced maintenance burden
Tasks:
- Remove unused dependencies (check with
knip) - Remove commented-out code in routes and components
- Remove unused icons if any
- Clean up
.DS_Storefiles (add to.gitignore) - Remove
remix-development-toolsfrom production build
Estimated effort: 2-3 hours
| Priority | Total Estimated Hours | Number of Tasks |
|---|---|---|
| Critical | 16-20 hours | 4 tasks |
| High | 40-59 hours | 9 tasks |
| Medium | 32-44 hours | 9 tasks |
| Low | 16-23 hours | 6 tasks |
| Total | 104-146 hours | 28 tasks |
Note: Tasks are now broken down into ≤10 hour chunks for easier PR review and implementation.
Phase 1: Critical Fixes (Sprint 1-2)
- Fix TypeScript errors
- Migrate to Biome for linting and formatting
- Create
.env.template - Remove
as anytype assertions
Phase 2: Foundation (Sprint 3-5)
- Set up test infrastructure (5a)
- Add utility function tests (5b)
- Add component tests (5c)
- Add analytics/route tests (5d)
- Update patch/minor dependencies (6a)
- Improve type safety in Contentful integration
- Add error boundary improvements
Phase 3: Major Updates (Sprint 6-9)
- Update React to v19 (6b)
- Update Tailwind to v4 (6c)
- Migrate from Remix v2 to React Router v7 (6d) ⭐
- Update other major dependencies (6e)
Phase 4: Quality & Performance (Sprint 10-12)
- Documentation improvements
- Component performance optimizations (11a)
- Image/asset optimizations (11b)
- Bundle/caching optimizations (11c)
- Accessibility improvements
- Analytics improvements
- i18n improvements
Phase 5: Polish (Sprint 13+)
- Code quality improvements
- Developer experience improvements
- CI/CD improvements
- Security improvements
- Content management improvements
- Clean up unused code
- Resolve TODO comments
If time is limited, focus on these high-impact, low-effort tasks first:
- ✅ Create
.env.template(15 min) - ✅ Install and configure Biome (1-2 hours) - replaces ESLint + Prettier
- ✅ Fix critical TypeScript errors (3-4 hours)
- ✅ Update patch-level dependencies (1-2 hours)
- ✅ Add pre-commit hooks with Biome (1-2 hours)
Total: ~7-11 hours for significant improvement
- This analysis was performed on branch
feat/adjust-filter-display - Last commit:
73d4b81 - chore: first bit of setting up Claude for the repo - Some improvements may uncover additional issues
- Prioritize based on your team's capacity and project goals
- Consider pairing junior and senior developers for knowledge transfer during refactoring
Generated: 2025-10-22 Codebase size: ~4,587 lines of TypeScript/TSX Node version: >=22.2.0