92 Commits

Author SHA1 Message Date
Mathis HERRIOT
7048c2731e fix(media): correct route param handling in media controller
All checks were successful
Backend Tests / test (push) Successful in 1m48s
Lint / lint (backend) (push) Successful in 1m7s
Lint / lint (documentation) (push) Successful in 1m7s
Lint / lint (frontend) (push) Successful in 1m8s
Backend Tests / test (pull_request) Successful in 1m10s
Lint / lint (backend) (pull_request) Successful in 1m8s
Lint / lint (documentation) (pull_request) Successful in 1m7s
Lint / lint (frontend) (pull_request) Successful in 1m9s
Adjust `@Get` decorator route pattern to properly handle file keys with special characters.
2026-01-14 23:51:24 +01:00
Mathis HERRIOT
38adbb6e77 feat(media): add public URL generation for media files and improve S3 integration
Introduce `getPublicUrl` in `S3Service` for generating public URLs. Replace custom file URL generation logic across services with the new method. Add media controller for file streaming and update related tests. Adjust frontend to display user roles instead of email in the sidebar. Update environment schema to include optional `API_URL`. Fix help page contact email.
2026-01-14 23:13:28 +01:00
Mathis HERRIOT
4ca15b578d refactor(modules): mark DatabaseModule and CryptoModule as global and remove redundant imports
Some checks failed
Backend Tests / test (push) Has been cancelled
Lint / lint (push) Has been cancelled
Optimize module imports by marking `DatabaseModule` and `CryptoModule` as global. Remove explicit imports from other modules to reduce duplication and improve maintainability. Update environment variable limits for image and GIF sizes in production.
2026-01-14 22:50:30 +01:00
Mathis HERRIOT
db17994bb5 fix(test): update transformIgnorePatterns to include .pnpm and uuid dependencies
All checks were successful
Backend Tests / test (push) Successful in 9m42s
Lint / lint (push) Successful in 9m37s
2026-01-14 22:19:47 +01:00
Mathis HERRIOT
f57e028178 refactor(reports): add as const to test data in reports.service.spec.ts 2026-01-14 22:19:27 +01:00
Mathis HERRIOT
2fedaca502 refactor(app): reorder imports in app.module.ts for consistency and readability 2026-01-14 22:00:16 +01:00
Mathis HERRIOT
a6837ff7fb refactor(auth): reorder imports in optional-auth.guard.ts for consistency and readability 2026-01-14 22:00:10 +01:00
Mathis HERRIOT
74b61004e7 refactor(auth): rename id to uuid in AuthStatus and mock uuid in tests 2026-01-14 21:59:51 +01:00
Mathis HERRIOT
14f8b8b63d refactor(contents): reorder imports and improve code formatting
Standardize import order in `contents.controller.ts` and related files for better code readability. Adjust SQL formatting in repository methods for consistency.
2026-01-14 21:58:52 +01:00
Mathis HERRIOT
50a186da1d refactor(core): standardize and reorder imports across admin services and modules
Optimize the structure and readability of import statements in `admin` services, modules, and controllers. Ensure consistency and logical grouping for improved maintainability.
2026-01-14 21:58:41 +01:00
Mathis HERRIOT
3908989b39 feat(users): enhance user schema and extend service dependencies
Add `email` and `status` fields to user schema for better data handling. Update `UsersService` with new service dependencies (`RbacService`, `MediaService`, `S3Service`, `ConfigService`) for enhanced functionality. Mock dependencies in tests for improved coverage. Adjust user model with optional and extended fields for flexibility. Streamline and update import statements.
2026-01-14 21:58:28 +01:00
Mathis HERRIOT
65f8860cc0 feat(auth): add optional authentication guard and extend AuthModule providers
Some checks failed
Backend Tests / test (push) Failing after 5m0s
Lint / lint (push) Failing after 5m2s
Introduce `OptionalAuthGuard` to allow conditional authentication for routes. Update `AuthModule` to include `AuthGuard`, `OptionalAuthGuard`, and `RolesGuard` in providers and exports for broader reuse.

feat(app): integrate `AdminModule` into app module

Add `AdminModule` to the app's main module to enable administration functionalities.

feat(users): enhance user profiles with bio and avatar fields

Extend `UpdateUserDto` to include optional `bio` and `avatarUrl` fields for better user customization.

feat(categories): add functionality to count all categories

Implement `countAll` method in `CategoriesRepository` to fetch the total number of categories using raw SQL counting.
2026-01-14 21:45:32 +01:00
Mathis HERRIOT
6ce58d1639 feat(admin): implement admin statistics API and service
Add admin statistics endpoint to provide user, content, and category stats. Introduce `AdminModule` with controller, service, and repository integration for data aggregation. Include frontend service to consume the stats API.
2026-01-14 21:44:14 +01:00
Mathis HERRIOT
47d6fcb6a0 feat(media): add image resizing support for processImage
Extend the `processImage` method to support optional resizing with `width` and `height` parameters. Update processing pipeline to handle resizing while maintaining existing format processing for `webp` and `avif`.
2026-01-14 21:44:00 +01:00
Mathis HERRIOT
d7c2a965a0 feat(contents): enhance user-specific data handling and admin content management
Integrate user-specific fields (`isLiked`, `favoritesCount`) in content APIs and improve `ContentCard` through reactive updates. Add admin-only content deletion support. Refactor services and repository to enrich responses with additional data (author details, tags).
2026-01-14 21:43:44 +01:00
Mathis HERRIOT
026aebaee3 feat(database): add migration snapshot 0006_snapshot.json for schema updates
Capture extensive database schema changes, including new tables and updated relationships for better data management and integrity.
2026-01-14 21:43:10 +01:00
Mathis HERRIOT
a30113e8e2 feat(users): add avatar and bio support, improve user profile handling
Introduce `avatarUrl` and `bio` fields in the user schema. Update repository, service, and controller to handle avatar uploads, processing, and bio updates. Add S3 integration for avatar storage and enhance user data handling for private and public profiles.
2026-01-14 21:42:46 +01:00
Mathis HERRIOT
975e29dea1 refactor: format imports, fix indentation, and improve readability across files
Some checks failed
Backend Tests / test (push) Has been cancelled
Lint / lint (push) Has been cancelled
Apply consistent import ordering and indentation in frontend and backend files. Ensure better maintainability and adherence to code style standards.
2026-01-14 21:06:38 +01:00
Mathis HERRIOT
a4ce48a91c feat(database): update passwordHash length and add migration snapshot
Some checks failed
Lint / lint (push) Has been cancelled
Backend Tests / test (push) Has been cancelled
Increase `passwordHash` field length to 100 in the `users` schema to accommodate larger hashes. Add migration snapshot `0005_snapshot.json` to capture database state changes.
2026-01-14 20:51:24 +01:00
Mathis HERRIOT
5671ba60a6 feat(dto): enforce field length constraints across DTOs
Add `@MaxLength` validations to limit string field lengths in multiple DTOs, ensuring consistent data validation and integrity. Integrate `CreateApiKeyDto` in the API keys controller for improved type safety.
2026-01-14 20:41:45 +01:00
Mathis HERRIOT
5f2672021e feat(middleware): add crawler detection middleware for suspicious requests
Introduce `CrawlerDetectionMiddleware` to identify and log potential crawlers or bots accessing suspicious paths or using bot-like user agents. Middleware applied globally to all routes in `AppModule`.
2026-01-14 20:41:25 +01:00
5665fcd98f Exclude .migrations from file includes in biome.json configuration
All checks were successful
Backend Tests / test (push) Successful in 9m40s
Lint / lint (push) Successful in 9m42s
2026-01-14 20:20:14 +01:00
dbfd14b57a Update user schema: modify password_hash to varchar(95)
Some checks failed
Backend Tests / test (push) Has been cancelled
Lint / lint (push) Has been cancelled
2026-01-14 20:12:32 +01:00
Mathis HERRIOT
03e5915fcc feat(deps): update and expand development dependencies
Some checks failed
Backend Tests / test (push) Successful in 9m42s
Lint / lint (push) Failing after 5m2s
Update various `@types` packages, NestJS, TypeScript, and Jest dependencies. Add new packages such as AWS SDK clients and utility libraries to enhance testing, type definitions, and AWS integrations.
2026-01-14 16:54:17 +01:00
Mathis HERRIOT
37a23390d5 refactor: enhance module exports and imports across services
Refactor multiple modules to improve dependency management by adding missing imports (e.g., `AuthModule`, `CryptoModule`) and ensuring essential services and repositories are exported. Update Dockerfile for better build and runtime efficiency, improve CORS handling, and enhance validation with updates to DTOs. Include package.json refinements for dependency organization.
2026-01-14 16:36:59 +01:00
Mathis HERRIOT
5b6e0143b6 feat: add comprehensive database migration snapshot
Introduce a detailed database schema migration snapshot, including tables such as `users`, `categories`, `contents`, `tags`, `favorites`, `roles`, `permissions`, and more. Adds relationships, indexes, unique constraints, and primary keys to ensure optimal structure and query efficiency.
2026-01-14 13:52:53 +01:00
Mathis HERRIOT
0c045e8d3c refactor: remove unused tests, mocks, and outdated e2e configurations
Deleted unused e2e tests, mocks (`cuid2`, `jose`, `ml-kem`, `sha3`), and their associated jest configurations. Simplified services by ensuring proper dependency imports, resolving circular references, and improving TypeScript type usage for enhanced maintainability and testability. Upgraded Dockerfile base image to match new development standards.
2026-01-14 13:51:32 +01:00
Mathis HERRIOT
9e37272bff feat: add initial database schema with migrations
Introduce foundational database schema with tables for `users`, `categories`, `contents`, `tags`, and `favorites`. Add foreign key relationships, constraints, and indexes for efficient querying.
2026-01-14 13:04:27 +01:00
Mathis HERRIOT
514bd354bf feat: add modular services and repositories for improved code organization
Introduce repository pattern across multiple services, including `favorites`, `tags`, `sessions`, `reports`, `auth`, and more. Decouple crypto functionalities into modular services like `HashingService`, `JwtService`, and `EncryptionService`. Improve testability and maintainability by simplifying dependencies and consolidating utility logic.
2026-01-14 12:11:39 +01:00
Mathis HERRIOT
5a22ad7480 feat: add logging and caching enhancements across core services
Integrate `Logger` for consistent logging in services like `reports`, `categories`, `users`, `contents`, and more. Introduce caching capabilities with `CacheInterceptor` and manual cache clearing logic for categories, users, and contents. Add request throttling to critical auth endpoints for enhanced rate limiting.
2026-01-10 16:31:06 +01:00
Mathis HERRIOT
9654553940 feat: add PGP encryption utilities with automatic decryption support
Some checks failed
Lint / lint (push) Has been cancelled
Backend Tests / test (push) Successful in 9m39s
Introduce modular PGP encryption utilities (`pgpEncrypted` type) for seamless handling of sensitive data in Postgres. Added utility `withAutomaticPgpDecrypt` to enable automatic decryption for selective columns, simplifying schema definitions.
2026-01-08 17:15:34 +01:00
Mathis HERRIOT
a5a8626f5d chore: add TODO comment in contents service test regarding TS2774 warning 2026-01-08 17:15:25 +01:00
Mathis HERRIOT
64adc80062 refactor: remove PGP encryption usage for user email and secrets
Eliminated PGP encryption for `email` and `twoFactorSecret` fields in `users` schema to simplify handling of sensitive data.
Since abstraction in schemas.
2026-01-08 17:15:14 +01:00
Mathis HERRIOT
702868dec2 feat: add PGP encryption utilities and apply automatic decryption to user schema
Introduced centralized PGP encryption utilities and updated the `users` schema to enable automatic decryption for sensitive fields like `email` and `twoFactorSecret`.
2026-01-08 17:13:43 +01:00
Mathis HERRIOT
399bdab86c test: add comprehensive unit tests for core services
Added unit tests for the `api-keys`, `auth`, `categories`, `contents`, `favorites`, `media`, and `purge` services to improve test coverage and ensure core functionality integrity.
2026-01-08 16:22:23 +01:00
Mathis HERRIOT
cc2823db7d refactor: organize imports and enhance formatting across backend files
Some checks failed
Backend Tests / test (push) Successful in 9m38s
Lint / lint (push) Failing after 4m59s
Optimized import order, applied consistent formatting, and improved readability in various modules, including `contents`, `media`, and `auth` services.
2026-01-08 15:33:55 +01:00
Mathis HERRIOT
8b51b84d44 feat: add Dockerfile for backend service
Introduced a multi-stage Dockerfile for the backend, enabling streamlined builds and optimized runtime image with Node.js 22.
2026-01-08 15:29:37 +01:00
Mathis HERRIOT
0af6f6b52a feat: update dependencies and scripts in package.json
Added new dependencies for caching, security, media processing, and validation. Updated scripts and included the `dist` folder for build output. Refined devDependencies to support new features and typings.
2026-01-08 15:28:38 +01:00
Mathis HERRIOT
382e39ebd0 feat: update biome.json with JavaScript parser configuration and linter rule adjustments
Added support for `unsafeParameterDecoratorsEnabled` in JavaScript parser configuration. Modified linter rules to include a `correctness` section disabling `useHookAtTopLevel`. Simplified domain-specific linter configurations.
2026-01-08 15:28:28 +01:00
Mathis HERRIOT
65b7cba6b1 feat: enhance bootstrap with Sentry, security middleware, and global configurations
Integrated Sentry for error monitoring and profiling. Added security improvements using Helmet and CORS. Implemented global validation pipes and exception filters for consistent request handling. Dynamically configured app PORT and logging for startup information.
2026-01-08 15:28:16 +01:00
Mathis HERRIOT
f7d85108e1 feat: add HealthController with database connection check
Introduced a HealthController to verify application status. Includes an endpoint to check database connectivity and returns health status with a timestamp.
2026-01-08 15:27:48 +01:00
Mathis HERRIOT
d5775a821e feat: integrate multiple modules, caching, throttling, and scheduling into AppModule
Enhanced AppModule by adding support for caching (Redis), scheduling, throttling, and multiple feature modules including AuthModule, CategoriesModule, ContentsModule, FavoritesModule, ReportsModule, TagsModule, and more. Improved environment validation and health check controller setup.
2026-01-08 15:27:36 +01:00
Mathis HERRIOT
add7cab7df feat: implement UsersModule with service, controller, and DTOs
Added UsersModule to manage user-related operations. Includes UsersService for CRUD operations, consent updates, and 2FA handling. Implemented UsersController with endpoints for public profiles, account management, and admin user listing. Integrated with CryptoService and database schemas.
2026-01-08 15:27:20 +01:00
Mathis HERRIOT
da5f18bf92 feat: implement TagsModule with service, controller, and endpoints
Added TagsModule to manage tags, including a TagsService for querying and sorting by popularity or recency. Created TagsController with endpoint to retrieve paginated and searchable tag data. Integrated with database and relevant schemas.
2026-01-08 15:27:11 +01:00
Mathis HERRIOT
a0836c8392 feat: add SessionsModule with service for session management
Implemented SessionsModule and SessionsService to manage user sessions. Includes methods for session creation, refresh token rotation, and session revocation. Integrated with database and CryptoService for secure token handling.
2026-01-08 15:27:02 +01:00
Mathis HERRIOT
9963046e41 feat: add method to generate presigned S3 upload URLs
Implemented a `getUploadUrl` method in S3 service to generate presigned URLs for uploading files. Includes support for custom bucket names and expiry times, with error handling and logging.
2026-01-08 15:26:50 +01:00
Mathis HERRIOT
dde1bf522f feat: implement ReportsModule with service, controller, and endpoints
Added ReportsModule to manage user reports. Includes service methods for creating, retrieving, and updating report statuses, as well as controller endpoints for handling these operations. Integrated with authentication, role-based access control, and database logic.
2026-01-08 15:26:39 +01:00
Mathis HERRIOT
dd875fe1ea feat: add MediaModule with service for virus scanning and media processing
Introduced MediaModule with MediaService to handle antivirus scanning using ClamAV and media file processing for images (webp/avif) and videos (webm/av1). Includes media-related interfaces and module exports for broader application integration.
2026-01-08 15:26:25 +01:00
Mathis HERRIOT
92ea36545a feat: add FavoritesModule with service, controller, and CRUD endpoints
Implemented FavoritesModule to manage user favorites. Includes service methods for adding, removing, and listing favorites, along with appropriate database integrations and API endpoints.
2026-01-08 15:26:05 +01:00
Mathis HERRIOT
912394477b feat: add categories and favorites schemas with integrations
Added `categories` and `favorites` database schemas with full type inference support. Integrated categories into `content` schema with new properties (`categoryId`, `slug`, `views`, and `usageCount`). Updated `tags` schema to include `userId` with reference to `users`. Exported new schemas in index for broader usage.
2026-01-08 15:25:51 +01:00