Commit Graph

13 Commits

Author SHA1 Message Date
William Valentin
15170a4f43 db(couchdb): auto-provision databases on startup for production strategy; add TokenService with CouchDB-backed token storage and localStorage fallback; switch OAuth to unified config for client IDs and redirect URI; express Request typing for req.user; align exportAsEnvVars with show-config expectations; remove Vite importmap from index.html; prefer babel-jest over ts-jest; remove duplicate uuid mocking from Jest config 2025-09-09 12:30:38 -07:00
William Valentin
d693dcf45c remove: broken Playwright E2E testing infrastructure
- Remove playwright.config.ts (references non-existent docker/docker-compose.yaml)
- Remove tests/e2e/ directory with broken test files
- Remove @playwright/test dependency from package.json
- Update documentation to remove E2E test references:
  - docs/architecture/PROJECT_STRUCTURE.md
  - docs/implementation/IMPLEMENTATION_SUMMARY.md
  - README.md
  - CONTRIBUTING.md
- E2E tests were non-functional due to missing Docker setup
- Focus on working unit and integration tests instead
2025-09-08 22:23:17 -07:00
William Valentin
491f9d0314 refactor: simplify package.json scripts and add config helpers
- Remove references to deleted deployment scripts
- Simplify build commands (remove environment variants)
- Add config helper scripts (config, config:env, config:help)
- Remove complex docker, gitea, and deployment scripts
- Focus on core development workflow
- Maintain essential scripts: dev, build, test, lint
2025-09-08 21:23:56 -07:00
William Valentin
25b68ee67d feat: improve unified config system and build process
- Enhance unified config environment variable loading with better precedence
- Add environment-aware validation (production validation only when NODE_ENV=production)
- Add environment-specific build commands (build:dev, build:prod, build:staging)
- Improve configuration debugging with cleaner logging
- Remove unnecessary development warnings
- Provides more flexible and maintainable configuration system
2025-09-08 20:43:02 -07:00
William Valentin
8c591563c9 feat: consolidate architecture and eliminate code duplication
🏗️ Major architectural improvements:

Database Layer:
- Consolidated duplicate CouchDB services (~800 lines of duplicated code eliminated)
- Implemented strategy pattern with MockDatabaseStrategy and ProductionDatabaseStrategy
- Created unified DatabaseService with automatic environment detection
- Maintained backward compatibility via updated factory pattern

Configuration System:
- Centralized all environment variables in single config/app.config.ts
- Added comprehensive configuration validation with clear error messages
- Eliminated hardcoded base URLs and scattered env var access across 8+ files
- Supports both legacy and new environment variable names

Logging Infrastructure:
- Replaced 25+ scattered console.log statements with structured Logger service
- Added log levels (ERROR, WARN, INFO, DEBUG, TRACE) and contexts (AUTH, DATABASE, API, UI)
- Production-safe logging with automatic level adjustment
- Development helpers for debugging and performance monitoring

Docker & Deployment:
- Removed duplicate docker/Dockerfile configuration
- Enhanced root Dockerfile with comprehensive environment variable support
- Added proper health checks and security improvements

Code Quality:
- Fixed package name consistency (rxminder → RxMinder)
- Updated services to use centralized configuration and logging
- Resolved all ESLint errors and warnings
- Added comprehensive documentation and migration guides

📊 Impact:
- Eliminated ~500 lines of duplicate code
- Single source of truth for database, configuration, and logging
- Better type safety and error handling
- Improved development experience and maintainability

📚 Documentation:
- Added ARCHITECTURE_MIGRATION.md with detailed migration guide
- Created IMPLEMENTATION_SUMMARY.md with metrics and benefits
- Inline documentation for all new services and interfaces

🔄 Backward Compatibility:
- All existing code continues to work unchanged
- Legacy services show deprecation warnings but remain functional
- Gradual migration path available for development teams

Breaking Changes: None (full backward compatibility maintained)
2025-09-08 01:09:48 -07:00
William Valentin
16d025e747 Add comprehensive test suite and update configuration
- Add Jest testing framework configuration
- Add test files for services, types, and utilities
- Update package.json with Jest dependencies and test scripts
- Enhance pre-commit checks to include testing
- Add proper environment validation and error handling in mailgun service
2025-09-07 18:18:25 -07:00
William Valentin
bffd13e6fc feat(build): add backend-focused testing commands
- Add 'make full-check-backend' for fast backend testing without E2E
- Add 'make test-backend' for unit and integration tests only
- Update 'test:integration' to use Jest instead of bun for consistency
- Improve command descriptions for clarity
- Enable fast development workflow by skipping E2E tests when not needed
2025-09-07 16:14:58 -07:00
William Valentin
2814237e71 deps: add testing dependencies and update configuration
- Add Babel core, presets for env and TypeScript support
- Add babel-jest for JavaScript transformation in Jest
- Add node-fetch and @types/node-fetch for HTTP testing
- Update TypeScript config for better Jest compatibility
- Update bun.lock with new dependency resolutions
2025-09-07 15:21:27 -07:00
William Valentin
315303b120 Fix pre-commit script to properly handle multiple files and resolve ESLint warnings 2025-09-07 13:34:39 -07:00
William Valentin
8fa2d3fb60 feat: Switch project tooling from npm to bun and add enhanced pre-commit
checks

- Replace npm commands with bun/bunx in scripts, docs, and CI - Add
enhanced pre-commit checks with parallel execution - Document pre-commit
hook behavior in PRE_COMMIT_HOOKS.md - Update .gitignore/.dockerignore
for bun-debug.log - Refine ESLint config for bun and Prettier
integration - Add scripts/type-check-staged.sh for fast staged type
checks - Improve developer workflow and code quality automation
2025-09-07 12:40:57 -07:00
William Valentin
585c526a65 feat: Add APP_NAME env support for branding and deployment
- Make app name configurable via APP_NAME env variable - Update UI,
HTML, Docker, scripts, and k8s to use APP_NAME - Add process-html.sh for
template substitution - Document APP_NAME usage in
docs/APP_NAME_CONFIGURATION.md - Update Dockerfile, compose, and scripts
for dynamic naming - Add index.html.template for environment-based
branding
2025-09-07 12:21:44 -07:00
William Valentin
48a2802411 Add undeploy script and ensure namespace function for Kubernetes management 2025-09-06 02:46:11 -07:00
William Valentin
e48adbcb00 Initial commit: Complete NodeJS-native setup
- Migrated from Python pre-commit to NodeJS-native solution
- Reorganized documentation structure
- Set up Husky + lint-staged for efficient pre-commit hooks
- Fixed Dockerfile healthcheck issue
- Added comprehensive documentation index
2025-09-06 01:42:48 -07:00