Commit Graph

109 Commits

Author SHA1 Message Date
William Valentin
3992765833 chore(container): remove obsolete nginx.conf; docs: update references from Nginx to Caddy 2025-09-09 12:47:54 -07:00
William Valentin
da9d221dae build(container): replace nginx with caddy for static SPA serving (no TLS); embed Caddyfile; keep health endpoint on /health 2025-09-09 12:44:19 -07:00
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
062e0973c1 chore: remove CHANGELOG.md and CONTRIBUTING.md 2025-09-08 22:35:26 -07:00
William Valentin
c4152c9061 fix: clean up tsconfig.json and remove Playwright references
- Remove @playwright/test from types array since Playwright was removed
- Update test documentation to use Jest-based tools instead
- Verify TypeScript compilation still works correctly
- Maintains working Jest types for existing tests
2025-09-08 22:31:18 -07:00
William Valentin
da21692785 remove: broken component test examples
- Remove components/__tests__/example.component.test.tsx
- File contained mock/demo components that don't exist in actual codebase
- All 14 tests were failing due to DOM environment setup issues
- File was example/template code, not real functional tests
- Remove empty __tests__ directory
2025-09-08 22:26:11 -07:00
William Valentin
286ceeb106 remove: obsolete env.test.ts with broken imports
- Remove utils/__tests__/env.test.ts (imports non-existent getEnv function)
- Test was written for old environment utilities API before unified config
- Current env.ts implementation uses unified config system with different exports
- Schedule tests remain and pass (14/14) - keeping functional tests
2025-09-08 22:25:05 -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
b5b475f21b remove: obsolete HTML template processing system
- Remove index.html.template (template processing never implemented)
- Fix empty title in index.html by adding proper default title
- Update documentation to remove references to non-existent:
  - scripts/process-html.sh
  - predev/prebuild npm scripts
  - HTML template processing workflow
- Simplifies build process and fixes broken page title
2025-09-08 22:21:14 -07:00
William Valentin
10e0d6d14b docs: update references to removed debug and deployment files
- Update tests/README-CLEANUP.md to reflect removal of auth-debug files
- Update docs/development/SECURITY_CHANGES.md to remove Gitea references
- Ensures documentation accurately reflects current codebase state
- Maintains consistency between docs and actual file structure
2025-09-08 22:18:41 -07:00
William Valentin
ad8a16271c remove: legacy test cleanup report
- Remove tests/cleanup-report.json artifact from previous cleanup
- File contained historical cleanup information no longer needed
- Reduces codebase clutter and focuses on current state
2025-09-08 22:18:33 -07:00
William Valentin
930e044144 remove: obsolete auth debug test infrastructure
- Remove auth-debug.spec.ts (functionality merged into auth.spec.ts)
- Remove auth-debug-setup.ts and auth-debug-teardown.ts
- Remove AUTH-DEBUG-GUIDE.md and AUTH-DEBUG-SETUP-GUIDE.md documentation
- Remove specialized playwright.auth.config.ts configuration
- Consolidates testing into main E2E test suite for better maintainability
2025-09-08 22:18:25 -07:00
William Valentin
5e749b8982 remove: pre-production Gitea deployment configuration
- Remove .gitea/workflows/ci-cd.yml deployment workflow
- Remove .gitea/README.md deployment documentation
- App is not yet deployed to production, making these configs premature
- Will recreate deployment configs when ready for production deployment
2025-09-08 22:18:16 -07:00
William Valentin
13a06b71d1 feat: update Docker build to support amd64 and arm64, use --push 2025-09-08 22:09:33 -07:00
William Valentin
2bda21dc2a docs: add configuration management commands to README
- Document the useful show-config.js script and related npm scripts
- Add section explaining bun run config, config:env, config:help commands
- These commands help developers understand the unified configuration system
- Script is functional and well-integrated, so keeping it and making it more discoverable
2025-09-08 22:08:37 -07:00
William Valentin
0bb9e95e7d remove: delete corrupted rename-app.sh file and update references
- Remove rename-app.sh which contains corrupted deployment validation content
- File was misnamed (should be deployment validation, not app renaming)
- Contains broken/mixed content and isn't relevant for current development
- App is not deployed to production yet, so deployment validation scripts aren't needed
- Update SECURITY_CHANGES.md to remove references to deleted file
2025-09-08 22:07:01 -07:00
William Valentin
147be3bcb5 remove: delete Makefile.original backup file
- Remove unused Makefile.original (18KB) backup file
- The current simplified Makefile (3KB) is working well
- No need to keep the complex backup that could confuse developers
- Reduces repository clutter and focuses on current implementation
2025-09-08 22:06:06 -07:00
William Valentin
a7e5c1f7cb docs: major README cleanup and simplification
- Remove irrelevant deployment and production information (app not deployed yet)
- Focus on current development state and local development workflow
- Consolidate redundant sections and remove duplicate commands
- Simplify quick start to focus on development setup
- Remove complex deployment scenarios (K8s, cloud providers, production scripts)
- Streamline Docker section to focus on development use
- Consolidate troubleshooting to common development issues
- Remove extensive production deployment guides and cloud provider instructions
- Simplify API documentation to overview level
- Focus on development workflow rather than operational concerns

Result: README is now ~50% shorter and focused on actual current capabilities
2025-09-08 22:05:40 -07:00
William Valentin
a76f94fba7 fix: resolve Docker build and nginx configuration issues
- Add unzip package to Dockerfile for Bun installation
- Fix nginx.conf gzip_proxied directive (remove invalid 'must-revalidate')
- Add comment acknowledging password warning in Dockerfile
- Docker build now completes successfully and nginx starts without errors
2025-09-08 21:53:08 -07:00
William Valentin
9b854f75d5 refactor: simplify Docker commands in Makefile
- Reduce Docker targets from 10 to 3 essential commands
- Combine docker-build-local into docker-build (local development focus)
- Integrate build step into docker-run for streamlined workflow
- Remove redundant targets: docker-build (multi-arch), docker-push, docker-config,
  docker-stop, docker-logs, docker-shell, docker-clean-all, docker-dev, docker-rebuild
- Keep most relevant commands:
  - docker-build: Build local image
  - docker-run: Build and run container (one-command workflow)
  - docker-clean: Clean all related resources
- Simplify Docker development to essential use cases
2025-09-08 21:48:08 -07:00
William Valentin
d08533712f feat: enhance Makefile with APP_NAME integration and improved Docker workflows
- Add APP_NAME from .env for personalized application naming
- Use APP_NAME in all echo messages and Docker container names
- Pass APP_NAME as build arg to Docker builds
- Generate default DOCKER_IMAGE from APP_NAME (APP_NAME:latest)
- Add new targets:
  - info: Show project information
  - docker-stop: Stop running container
  - docker-logs: Show container logs
  - docker-shell: Open shell in container
  - docker-clean-all: Complete cleanup
  - docker-dev: Build and run (development workflow)
  - docker-rebuild: Complete refresh workflow
- Improve error handling and safety checks
- Add container cleanup in docker-run to prevent conflicts
- Add image existence check in docker-push

Variable precedence:
1. Environment variables (highest)
2. .env file values (medium)
3. Defaults: APP_NAME=meds-app, DOCKER_IMAGE=APP_NAME:latest (lowest)
2025-09-08 21:45:45 -07:00
William Valentin
518752ab6e feat: use DOCKER_IMAGE from .env in Makefile
- Update Makefile to read DOCKER_IMAGE from .env file with proper precedence
- Environment variables override .env file values
- Fallback to 'meds-app:latest' if not defined anywhere
- Add new Docker targets: docker-run, docker-push, docker-config
- Improve help output with environment variable documentation
- Update APP_NAME_CONFIGURATION.md to show Makefile usage examples

Variable precedence:
1. Environment variable (highest)
2. .env file (medium)
3. Default fallback (lowest)
2025-09-08 21:43:02 -07:00
William Valentin
36dcdbd459 docs: fix broken references and update paths
- Update README.md to remove references to deleted migration/deployment docs
- Fix CONTRIBUTING.md to point to correct documentation paths
- Remove broken references in API.md to non-existent files
- Update ENVIRONMENT_VARIABLES.md to reference existing documentation
- Ensure all documentation links work correctly after reorganization
2025-09-08 21:38:07 -07:00
William Valentin
fd82b7755b docs: simplify implementation summary to current status
- Transform from verbose migration history to concise current status overview
- Focus on what developers need to know now rather than historical changes
- Document current features, architecture, and development workflow
- Remove redundant migration details and focus on actionable information
- Make content more relevant for ongoing development work
2025-09-08 21:37:57 -07:00
William Valentin
f51bdeb284 docs: refocus architecture docs on current development state
- Update TEMPLATE_APPROACH.md from Kubernetes deployment to development configuration
- Update PROJECT_STRUCTURE.md to reflect current development structure
- Remove references to non-existent deployment artifacts
- Focus on environment-based configuration and template processing
- Document actual current features rather than future deployment scenarios
2025-09-08 21:37:46 -07:00
William Valentin
280eb489e7 docs: update main documentation index for simplified structure
- Remove references to deleted migration and deployment documents
- Update file paths to reflect new organization structure
- Simplify navigation sections to focus on current development needs
- Remove broken links and obsolete sections
- Update documentation version to 3.0 to reflect major reorganization
2025-09-08 21:37:35 -07:00
William Valentin
fdb0c78827 docs: reorganize files into logical folder structure
- Move PRE_COMMIT_HOOKS.md to development/ (development-focused)
- Move APP_NAME_CONFIGURATION.md to setup/ (configuration-focused)
- Move ENVIRONMENT_VARIABLES.md to setup/ (configuration-focused)
- Improves organization by grouping related documentation together
- Makes it easier to find relevant docs based on purpose
2025-09-08 21:37:25 -07:00
William Valentin
8f70dca7b7 docs: remove irrelevant migration and summary documents
- Remove migration documents (BUILDX_MIGRATION.md, NODEJS_PRECOMMIT_MIGRATION.md)
- Remove architecture migration guide (ARCHITECTURE_MIGRATION.md)
- Remove redundant summary documents (REORGANIZATION_SUMMARY.md, REFACTORING_SUMMARY.md, DOCS_UPDATE_SUMMARY.md)
- These files contained historical migration information not relevant for current development
- App is not deployed to production yet, so migration scripts and reports are unnecessary
2025-09-08 21:37:16 -07:00
William Valentin
79394455ee docs: update README to reflect unified configuration system
- Add Configuration section explaining unified config approach
- Document config helper commands (bun run config, config:help)
- Update deployment section to focus on essential overrides
- Remove references to deleted deployment infrastructure
- Explain single source of truth philosophy
- Provide examples of environment variable usage
- Emphasize smart defaults and type safety
2025-09-08 21:24:42 -07:00
William Valentin
f6b0e919ef fix: resolve configuration loading issues
- Simplify vite.config.ts to avoid unified config initialization during build
- Fix pre-commit hook to remove reference to deleted script
- Prevent circular dependencies and initialization conflicts
- Ensure proper lazy loading of configuration
- Resolve blank page issue caused by config loading timing
2025-09-08 21:24:31 -07:00
William Valentin
190cffb61b refactor: simplify Docker and CI/CD to use unified config
- Replace symlinked Dockerfile with simplified version in root
- Reduce Docker build args (unified config provides defaults)
- Update CI/CD workflows to use minimal build arguments
- Add nginx.conf to root directory (replace docker/nginx.conf)
- Remove docker-bake references from CI/CD workflows
- Focus on essential runtime overrides only
- Let unified config handle smart defaults
2025-09-08 21:24:20 -07:00
William Valentin
a8647ff33d refactor: update application code to use unified configuration
- Update App.tsx to use getAppConfig() instead of import.meta.env
- Update email templates to use getAppConfig() for base URL
- Update database strategy to use getDatabaseConfig() function
- Update mailgun service to use getter functions
- Remove direct unified config imports in favor of functions
- Ensure consistent configuration access throughout codebase
2025-09-08 21:24:07 -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
b59160eb10 feat: implement unified configuration as single source of truth
- Make unified config lazy-loaded to avoid initialization issues
- Replace direct config exports with getter functions
- Rewrite utils/env.ts to use unified config instead of scattered access
- Add show-config.js helper script for configuration management
- Type-safe configuration access throughout the app
- Smart defaults for all environments with environment overrides
- Eliminates scattered process.env and import.meta.env access
2025-09-08 21:23:44 -07:00
William Valentin
8830842ba2 refactor: remove scattered environment configuration files
- Remove 8 redundant .env files (.env.demo, .env.development, etc.)
- Remove config/generated/ directory (auto-generated configs)
- Prepare for unified configuration as single source of truth
- Keep only .env and .env.example for simplicity
- Reduces configuration complexity by 90%
2025-09-08 21:23:33 -07:00
William Valentin
11a0066b67 refactor: remove unused deployment infrastructure
- Remove scripts/ directory (21 deployment/helper scripts)
- Remove k8s/ and k8s-kustomize/ directories (Kubernetes configs)
- Remove docker/ directory (docker-compose and configs)
- Remove docs/deployment/ directory and related documentation
- Remove CI-specific docker compose and bake files
- App is not production-ready yet, focusing on development
- Can be re-added when needed for production deployment
2025-09-08 21:23:23 -07:00
William Valentin
8aaeb1fe85 feat: simplify Makefile to focus on core development commands
- Reduce from 400+ lines to 58 lines (85% reduction)
- Keep only essential commands: build, test, dev, docker-build
- Remove deployment-specific targets (k8s, complex workflows)
- Preserve multi-architecture Docker buildx support
- Improve maintainability and focus on development needs
2025-09-08 21:23:10 -07:00
William Valentin
8e1456d52b feat: update generated configs and environment files
- Regenerate all environment-specific config files with unified config
- Update Vite environment files for all environments (dev/staging/prod)
- Update Docker environment files with current configuration
- Update Kubernetes config.env files for development and production
- Add staging environment configurations and overlays
- Ensures all generated files reflect unified configuration system
2025-09-08 20:44:19 -07:00
William Valentin
b81f9b2970 docs: update documentation to reflect unified config system
- Update config README to focus on current unified system rather than migration
- Update architecture migration doc to reference unifiedConfig instead of appConfig
- Update implementation summary to reference unified.config.ts
- Remove migration-specific content not relevant for new applications
- Provide clear guidance for working with unified configuration system
2025-09-08 20:43:44 -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
9132d78bfa feat: enhance Docker buildx commands with unified config integration
- Add comprehensive Docker buildx commands for multi-platform builds
- Integrate buildx commands with unified config for automatic:
  - Image tagging from container.imageUrl
  - Build arguments from app configuration
  - Environment-aware builds (dev/staging/prod)
- Add configuration health check and debug commands
- Remove irrelevant migration-related commands
- Provides consistent, configuration-driven container builds
2025-09-08 20:42:29 -07:00
William Valentin
341aaf1ae0 refactor: simplify Vite config to use unified config as single source
- Remove loadEnv() double-loading in Vite configuration
- Use unifiedConfig directly for all environment variables
- Add additional config variables for better frontend access
- Eliminates configuration conflicts and reduces complexity
- Provides cleaner, more predictable build process
2025-09-08 20:41:47 -07:00
William Valentin
7b3a5e0506 cleanup: remove legacy config and backup files
- Remove deprecated config/app.config.ts
- Clean up old test backup files in tests/.backup/
- Completes transition to unified configuration system
- Eliminates potential confusion from dual config sources
2025-09-08 20:41:38 -07:00
William Valentin
a7e5df4b2e test: update mocks to use unified config structure
- Update mailgun service test mock to use unifiedConfig.app.baseUrl
- Update database service test mock to use unifiedConfig.app.baseUrl
- Ensures test mocks reflect actual unified configuration structure
- Maintains test compatibility after config system consolidation
2025-09-08 20:40:29 -07:00
William Valentin
811339cea2 refactor: migrate services from app.config to unified config
- Update email verification template to use unifiedConfig
- Update ProductionDatabaseStrategy to use databaseConfig from unified config
- Update mailgun service to use unifiedConfig for baseUrl
- Provides consistent configuration access across all services
- Part of migration to single source of truth configuration system
2025-09-08 20:39:03 -07:00
William Valentin
6f1cf76a86 feat: enhance Docker build process and deployment options
- Add multi-platform Docker build support with docker-bake.hcl
- Update Dockerfile with improved production build configurations
- Enhance Makefile with streamlined deployment targets for local, dev, and prod
- Improve buildx-helper.sh script for better cross-platform builds
- Fix production build security validations for JWT_SECRET and SESSION_SECRET
- Add comprehensive deployment documentation and environment setup guides

These changes enable efficient multi-platform image creation and provide
clear deployment workflows for different environments.
2025-09-08 19:48:26 -07:00
William Valentin
430ed7458b Add comprehensive deployment solutions and fix production deployment
🚀 New Deployment Commands:
- deploy-local: Docker-based local deployment (http://localhost:8080)
- deploy-demo: Demo deployment with development settings
- deploy-prod-quick: Production deployment with auto-generated secrets
- deploy-prod-configured: Production deployment with pre-configured secrets
- stop-local: Stop local Docker deployment

🔧 Fixes:
- Fixed deploy-prod-quick to properly generate secure secrets
- Updated local deployments to use development environment
- Fixed Docker Compose environment variable handling
- Improved error handling and user feedback

📚 Documentation:
- Added Quick Deployment Guide (docs/QUICK_DEPLOYMENT.md)
- Updated README with practical deployment guidance
- Clear explanation of deployment options and use cases
- Troubleshooting section for common issues

 Features:
- Auto-generated secure JWT and session secrets for production
- Local Docker deployment with persistent CouchDB
- Clear separation between development and production processes
- Comprehensive deployment option matrix

🧪 Verification:
-  Local deployment: make deploy-local (working with Docker)
-  Production build: JWT_SECRET=x SESSION_SECRET=y make build-prod (working)
-  Development build: make build (working)
-  All existing functionality preserved

🎯 Ready for use:
- Immediate testing: make deploy-local
- Production deployment: make deploy-prod-quick
2025-09-08 19:32:52 -07:00
William Valentin
beb9d84071 Fix build process and add production build support
🔧 Build Process Improvements:
- Update default 'build' target to use development mode
- Add new 'build-prod' target for production builds with validation
- Fix 'deploy-prod-quick' to use production build command
- Update 'build-test' to use development build (safer for CI)

📚 Documentation:
- Add comprehensive Production Build Guide (docs/deployment/PRODUCTION_BUILD.md)
- Include security requirements, configuration methods, and troubleshooting
- Update main documentation index with production build guide
- Update README with both build command options

 Features:
- Development builds work without security configuration
- Production builds require proper JWT/SESSION secrets
- Clear separation between dev and prod build processes
- Comprehensive production deployment documentation

🔒 Security:
- Enforced JWT_SECRET validation for production builds
- Clear documentation of required security configurations
- Examples for CI/CD integration with proper secret management
- Best practices for production deployment

🧪 Verification:
-  Development build: make build (works with warnings)
-  Production build validation: make build-prod (fails without secrets)
-  Production build with secrets: works correctly
-  All existing functionality preserved
2025-09-08 19:23:42 -07:00
William Valentin
430bc6acf8 Remove deprecated entries from Makefile and update documentation
🗑️ Removed:
- Legacy Support section with deprecated targets (k8s-deploy, k8s-undeploy, deploy, undeploy)
- 18 lines of deprecated makefile targets and warnings

📚 Documentation Updates:
- README.md: Updated Kubernetes deployment commands and project structure
- KUSTOMIZE_MIGRATION.md: Replaced deprecated commands with current ones
- k8s-kustomize/README.md: Updated deployment command references
- APP_NAME_CONFIGURATION.md: Updated deployment example command
- config/README.md: Replaced migration script references with config generation
- ARCHITECTURE_MIGRATION.md: Updated to reflect completed migration status
- PROJECT_STRUCTURE.md: Updated services structure to show unified database service
- IMPLEMENTATION_SUMMARY.md: Updated legacy compatibility notes

 Improvements:
- Clean Makefile with only current, supported targets
- Consistent documentation referring to current command structure
- Removed all references to deleted CouchDB service files
- Updated project structure diagrams to reflect current architecture

🧪 Verification:
- All 292 unit tests passing
- Integration tests passing
- Makefile help command displays cleanly
- No deprecated command references remain in documentation
2025-09-08 19:07:26 -07:00
William Valentin
598c1da17b Complete database service consolidation and documentation
 Features:
- Add comprehensive database service documentation
- Create detailed module README with usage examples
- Expand main documentation index with database links
- Add component test support to Jest configuration

🔧 Improvements:
- Fix AvatarDropdown test failures (dark mode classes and rapid clicking)
- Update documentation version to 2.1
- Include migration guide and troubleshooting sections
- Add performance considerations and security notes

📚 Documentation:
- Complete API reference with code examples
- Architecture overview with Strategy pattern explanation
- Environment configuration and strategy selection guide
- Best practices and development guidelines
- Comprehensive refactoring summary

🧪 Testing:
- All 292 tests passing across all modules
- Component tests now properly integrated with Jest
- Fixed TypeScript compatibility issues in tests
- Verified database service functionality in all environments

📋 Summary:
- Removed deprecated CouchDB service files
- Consolidated database operations under unified service
- Enhanced documentation structure and content
- Improved test coverage and reliability
- Maintained backward compatibility where possible
2025-09-08 18:59:08 -07:00