Commit Graph

132 Commits

Author SHA1 Message Date
f0baef0c22 fix: update dependencies to address security vulnerabilities
- body-parser: 2.2.0 -> 2.2.1 (fixes DoS vulnerability)
- glob: updated to fix command injection via -c/--cmd
- js-yaml: 3.14.1 -> 3.14.2 (fixes prototype pollution)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 10:21:16 +01:00
9f6ffd9a07 feat: add database backup stage before production deploy 2025-11-27 10:04:55 +01:00
a850e5dd28 feat: add HTTP metrics middleware for Prometheus monitoring
- Add custom metrics: http_requests_total, http_request_duration_seconds,
  http_errors_total, http_requests_in_progress, http_response_size_bytes
- Track method, route, and status_code labels
- Normalize routes to avoid high cardinality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 10:54:45 +01:00
7d295e6883 fix: use sonar-project.properties for SonarQube config 2025-11-25 15:48:32 +01:00
9017313bf7 perf: optimize pipeline with npm cache and parallel stages 2025-11-25 15:36:19 +01:00
63096f22e4 fix: update SonarQube project key to match 2025-11-25 14:55:05 +01:00
6232c3584f feat: add SonarQube analysis stage to pipeline
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 14:19:03 +01:00
5c8d6b9262 feat: harmonize newsletter email colors with orange theme
- Change header background from gold to vibrant orange (#f59e0b → #ea580c)
- Update welcome section to match header colors
- Change footer from dark gray to orange gradient for consistency
- Add logo icon in white circle for professional appearance
- Update game section border to orange
- Change benefit items background to orange tones (#fef3c7 → #fed7aa)
- All sections now use consistent orange/red color palette

Design improvements:
- Cohesive color scheme throughout the email
- Logo icon in white circular background with shadow
- Modern and energetic orange theme matching buttons
- Better visual hierarchy and brand consistency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 16:29:36 +01:00
93cd8d38ff feat: improve newsletter email design and buttons
- Change game button to redirect to /jeux instead of /register
- Improve button colors: orange/red for primary, gold for secondary
- Add hover effects with shadows and transform animations
- Remove unsubscribe section from footer
- Clean up email subject: remove emoji, keep professional format
- Increase button font size and add letter spacing for better readability

Button improvements:
- Primary button (Jouer Maintenant): vibrant orange gradient (#f59e0b → #ea580c)
- Secondary button (Visiter le Site): gold gradient matching brand colors
- Enhanced shadows and hover effects for better interactivity

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 15:57:42 +01:00
0850614264 feat: redesign newsletter email with modern template
- Redesign email template with brand colors and modern layout
- Add animated welcome icon and professional styling
- Improve button design with gradient colors matching the site
- Add TLS configuration to fix SSL certificate errors
- Fix email validation regex to be more permissive
- Update email subject to include logo emoji

Design improvements:
- Logo in header with brand colors (#d4a574, #c4956a, #5a5a4e)
- Beautiful rounded buttons for "Jouer Maintenant" and "Visiter le Site"
- Responsive design with proper spacing and shadows
- Benefits section with visual icons
- Professional footer with unsubscribe link

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 14:49:40 +01:00
772202dc6e fix: configure Gmail App Password and SSL for contact form emails
- Update SMTP_PASS with Gmail App Password in all environment files
- Add TLS configuration to ignore self-signed certificate errors
- Fix email sending functionality for contact form

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 14:07:12 +01:00
6d7c536a7e feat: add contact form email functionality
- Add SMTP configuration in all .env files
- Create sendContactEmail function in email service
- Add contact controller with form validation
- Create contact API route (POST /api/contact)
- Register contact route in main index.js
- Emails sent to thetiptopgr3@gmail.com

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 11:38:08 +01:00
4759ce99e7 feat: add newsletter subscription feature
- Add newsletter database table migration
- Create newsletter controller with subscribe/unsubscribe endpoints
- Add newsletter routes and validation
- Implement newsletter service with email validation
- Add setup documentation and migration scripts
- Include test page for newsletter functionality

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 00:07:44 +01:00
3e08a647a5 feat: add updatedAt field to user profile endpoints
- Add updated_at to SELECT query in getProfile
- Add updatedAt to response in getProfile
- Auto-update updated_at timestamp in updateProfile
- Add updated_at to RETURNING clause in updateProfile
- Include isVerified, createdAt, updatedAt in updateProfile response

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 17:53:31 +01:00
a76cf4e887 chore: remove SonarQube stages from Jenkins pipeline
- Remove SonarQube Analysis stage
- Remove Quality Gate stage
- Keep configuration files for future use (sonar-project.properties, .sonarignore)

The SonarQube integration requires additional Jenkins plugin configuration.
Configuration files are preserved for when the plugin is properly set up.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 01:30:42 +01:00
0e1cd727c4 feat: add SonarQube integration for code quality analysis
- Add SonarQube configuration files
  - sonar-project.properties with Node.js/Express settings
  - .sonarignore to exclude test files, database, and build artifacts
  - Configure source paths (src, index.js, db.js)
  - Set up test coverage paths

- Add SonarQube npm script
  - npm run sonar command for manual analysis

- Integrate SonarQube into Jenkins pipeline
  - Add SonarQube Analysis stage with sonar-scanner-cli
  - Add Quality Gate verification stage
  - Block deployment if quality gate fails
  - 5-minute timeout for quality gate check

This enables continuous code quality monitoring and ensures
code meets quality standards before deployment.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 01:24:59 +01:00
86ccc3ef4f feat: add getUserById endpoint for admin user details
Added GET /api/admin/users/:id endpoint to retrieve detailed user
information including contact info, personal data, and ticket statistics.
This enables the admin interface to display comprehensive user details
when clicking the "Détails" button.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 15:07:28 +01:00
e72923ec86 fix: transform pending tickets data to match frontend expectations
Updated the getPendingTickets endpoint to return nested objects for user
and prize data instead of flat SQL columns. Frontend expects structure like
ticket.user.firstName and ticket.prize.name, which now displays correctly
in the employee verification interface instead of showing N/A.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 14:30:44 +01:00
e3794e1ba8 fix: respect Docker environment variables over .env file
Changed dotenv.config({ override: true }) to { override: false }
This ensures environment variables from docker-compose.yml take precedence
over the embedded .env file, allowing proper DB configuration in containers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 22:00:39 +01:00
ddc4c09323 fix: update test to use correct route (/) instead of /health 2025-11-18 16:59:43 +01:00
f9dd22909c fix: convert test to ES6 modules and export app
- Convert test/app.test.js from CommonJS to ES6 import/export
- Export app from index.js for testing
- Only start server if NODE_ENV !== 'test'
- Fixes 'require is not defined' error in tests
2025-11-18 16:53:46 +01:00
51d8b0cc36 fix: resolve ESLint errors and Jest configuration
- Remove extensionsToTreatAsEsm from jest.config.js (not needed with type:module)
- Add Jest globals to ESLint config (describe, it, expect, etc.)
- Fix unnecessary escape characters in debug-token-403.js
- Change no-useless-escape from error to warning
2025-11-18 16:49:19 +01:00
c92d2c32e9 fix: simplify Jenkins triggers to use only pollSCM + add setup docs 2025-11-18 16:08:28 +01:00
c0ad39dbe9 fix: Jenkinsfile syntax (remove special characters) 2025-11-18 16:05:17 +01:00
359fee23b0 fix: add missing global variables to ESLint config
Add fetch and timer functions (setTimeout, setInterval, etc.) as
global variables in ESLint configuration to fix no-undef errors
in scripts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 15:50:37 +01:00
9330c68e5c fix: improve CI/CD quality checks and fix test/lint configuration
Backend fixes:
- Add eslint.config.js with proper ES6 module configuration
- Add jest.config.js to support ES modules
- Update package.json with @eslint/js dependency
- Configure npm test script with NODE_OPTIONS for ES modules
- Update Jenkinsfile to block deployments on failed lint/tests

This ensures:
1. ESLint works correctly with ES6 modules
2. Jest can run tests with ES6 imports
3. Deployments are blocked if quality checks fail

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 15:40:04 +01:00
caff01fc4b feat: add automatic deployment triggers to Jenkinsfile
Configure Jenkins pipeline to trigger automatically on git push:
- Add pollSCM trigger (checks every minute)
- Add Generic Webhook trigger for Gitea integration
- Add comprehensive webhook setup documentation

This enables CI/CD automation where the pipeline starts
automatically when code is pushed to the repository.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 15:23:32 +01:00
25c7a0b304 dev 2025-11-17 23:47:54 +01:00
67316ef0b1 Fix Jenkinsfile syntax (clean comments) 2025-11-04 19:00:33 +01:00
67c75963fb Fix Jenkinsfile syntax (clean comments) 2025-11-04 18:56:34 +01:00
4e855dc060 Fix Jenkinsfile syntax (clean comments) 2025-11-04 18:55:08 +01:00
31b70e9849 Fix Jenkinsfile syntax (clean comments) 2025-11-04 15:50:33 +01:00
db83f0d06f Fix Jenkinsfile syntax (clean comments) 2025-11-04 15:46:54 +01:00
91802b178b Fix Jenkinsfile syntax (clean comments) 2025-11-04 15:38:00 +01:00
cf4809be39 Fix Jenkinsfile syntax (clean comments) 2025-11-04 15:32:21 +01:00
77ed26c527 Fix Jenkinsfile syntax (clean comments) 2025-11-04 15:29:35 +01:00
5cedb52e4c Merge branch 'main' of https://gitea.wk-archi-o24a-15m-g3.fr/wkadmin/the-tip-top-backend into dev 2025-11-04 15:28:47 +01:00
bb0aa2fa44 Fix Jenkinsfile syntax (clean comments) 2025-11-04 15:28:17 +01:00
303307092f Fix Jenkinsfile syntax (clean comments) 2025-11-04 15:17:49 +01:00
7ec762cb3d Fix Jenkinsfile syntax (clean comments) 2025-11-04 15:11:50 +01:00
90f7d3bfd6 Fix Jenkinsfile syntax (clean comments) 2025-11-04 14:44:21 +01:00
6bd916f687 Fix Jenkinsfile syntax (clean comments) 2025-11-04 14:43:41 +01:00
100b12a2fa Fix Jenkinsfile syntax (clean comments) 2025-11-04 14:20:37 +01:00
ade619232e Fix Jenkinsfile syntax (clean comments) 2025-11-04 14:14:09 +01:00
daec16f002 Fix Jenkinsfile syntax (clean comments) 2025-11-04 14:12:28 +01:00
e55f1283b8 Fix Jenkinsfile syntax (clean comments) 2025-11-04 14:10:40 +01:00
de17e5a004 Fix Jenkinsfile syntax (clean comments) 2025-11-04 14:10:14 +01:00
3ddf94cce2 Fix Jenkinsfile syntax (clean comments) 2025-11-04 14:01:54 +01:00
e97a6c47e9 Fix Jenkinsfile syntax (clean comments) 2025-11-04 13:31:28 +01:00
f84866c2d8 Fix Jenkinsfile syntax (clean comments) 2025-11-04 02:53:05 +01:00