25 Commits

Author SHA1 Message Date
Mathis HERRIOT
2f9d2d1df1
feat: add @nestjs/swagger and swagger-ui-express dependencies for API documentation 2025-05-16 19:09:29 +02:00
Mathis HERRIOT
63f28be75d
fix(backend): correct start:prod script path to dist/src/main 2025-05-16 19:07:30 +02:00
Mathis HERRIOT
52d74a754c
feat(tests): add utility functions for testing with NestJS
Add test utilities to facilitate creating test apps, test users, generating tokens, and cleaning up test data in the backend codebase.
2025-05-16 19:07:09 +02:00
Mathis HERRIOT
077f3b6a87
docs: add e2e testing documentation 2025-05-16 19:05:55 +02:00
Mathis HERRIOT
542c27bb51
feat: integrate WebSocketsModule in projects and groups modules
fix: ensure HttpCode annotations for specific endpoints in users and groups controllers
refactor: enhance person handling logic in groups service for better e2e test support
fix: improve CORS configuration for handling additional origins
feat: add @Public decorator to app controller's root endpoint
refactor: modify projects controller to return JSON responses for check-access endpoint
2025-05-16 19:05:28 +02:00
Mathis HERRIOT
10d4e940ed
test: add comprehensive e2e tests for users, groups, auth, and projects APIs 2025-05-16 19:04:50 +02:00
b3a95378f1 feat: enhance CORS configuration for development and production environments
- Updated backend CORS setup to differentiate between development (open origins) and production (restricted origins).
- Implemented support for additional allowed origins via environment variables.
- Adjusted `WebSocketGateway` CORS settings to align with the new configuration.
- Updated `PROJECT_STATUS.md` to reflect progress on CORS-related security tasks.
2025-05-16 18:10:42 +02:00
2851fb3dfa test: add WebSocket event emission tests for services and improve coverage
- Added unit tests for WebSocket event emissions in `GroupsService` and `ProjectsService` (create, update, delete, and collaborator actions).
- Added new test files for `WebSocketsGateway` and `WebSocketsService` to ensure correct event handling and gateway connections.
- Improved test structure and coverage for real-time functionalities.
2025-05-16 16:42:33 +02:00
2697c7ebdd feat: add WebSocket module for real-time functionalities
- Implemented `WebSocketsGateway` for handling Socket.IO connections, events, and rooms.
- Added `WebSocketsService` to act as a facade for emitting WebSocket events (projects, groups, notifications).
- Registered `WebSocketsModule` and integrated it into `AppModule`.
- Enabled real-time updates in `ProjectsService` and `GroupsService` with relevant WebSocket events (create, update, delete, collaborator/group actions).
2025-05-16 16:42:15 +02:00
a56e774892 test: remove redundant JwtAuthGuard mock in unit test file 2025-05-16 14:44:28 +02:00
2de57e6e6f feat: export projectCollaborators in schema index 2025-05-15 20:57:45 +02:00
92c44bce6f feat: add project collaborators relations
Defined `projectCollaborators` relations in the database schema. Updated `usersRelations` and `projectsRelations` to include `projectCollaborations` and `collaborators` respectively. Added `projectCollaboratorsRelations` to establish relationships with `projects` and `users`.
2025-05-15 20:57:32 +02:00
0154f9c0aa feat: add project collaborators schema
Introduced `projectCollaborators` schema to define project-user relationships. Includes indices and a unique constraint for `projectId` and `userId`. Added corresponding type definitions for select and insert operations.
2025-05-15 20:57:13 +02:00
c16c8d51d2 feat: add collaborator management to projects module
Added endpoints to manage collaborators in `ProjectsController`:
- Add collaborator
- Remove collaborator
- Get project collaborators

Updated `ProjectsService` with corresponding methods and enhanced `checkUserAccess` to validate user access as owner or collaborator. Included unit tests for new functionality in controllers and services.
2025-05-15 20:56:43 +02:00
576d063e52 test: add unit tests for users module
Added comprehensive unit tests for `UsersController` and `UsersService`, covering CRUD operations, GDPR consent updates, data export, and exception handling. Mocked `JwtAuthGuard` and database operations for all tests.
2025-05-15 20:48:42 +02:00
269ba622f8 test: add unit tests for persons and projects modules
Added comprehensive unit tests for `PersonsController`, `PersonsService`, `ProjectsController`, and `ProjectsService`. Covered CRUD operations, exception handling, group/project associations, and user access validation. Mocked `JwtAuthGuard` for all tests.
2025-05-15 20:31:07 +02:00
50583f9ccc test: add unit tests for tags module and global auth guard
Added comprehensive unit tests for `TagsService` and `TagsController`, covering CRUD operations, exception handling, and associations with projects and persons. Mocked `JwtAuthGuard` globally for testing purposes.
2025-05-15 19:48:44 +02:00
7eae25d5de test: add comprehensive unit tests for groups and auth modules
Added unit tests for `GroupsService`, `GroupsController`, `AuthService`, `AuthController`, and `JwtAuthGuard` to ensure functionality and coverage. Includes tests for entity operations, exception handling, and integration scenarios.
2025-05-15 19:29:12 +02:00
e64d706274 feat: implement global JWT auth guard with public route support
Introduced `JwtAuthGuard` as a global authentication mechanism using `APP_GUARD`. Added support for public routes via a `Public` decorator with metadata. Updated `AuthController`
2025-05-15 19:09:52 +02:00
76ef9a3380 feat: add db:update script to streamline database updates
Introduced a new `db:update` script combining migration generation and execution. Updated `db:generate` and `db:push` commands for consistency with DrizzleKit updates.
2025-05-15 18:09:49 +02:00
d15bf3fe90 fix: update migrations output path in Drizzle configuration 2025-05-15 18:09:29 +02:00
63458333ca feat: add tags module with CRUD operations and DTOs
Introduced a new `TagsModule` with support for creating, updating, and managing tags. Implemented DTOs (`CreateTagDto`, `UpdateTagDto`) for validation and structure. Added `TagsService` and `TagsController` with APIs for tags-to-project and tags-to-person associations.
2025-05-15 18:09:12 +02:00
0249d62951 fix: update migrations folder path in database service 2025-05-15 18:08:41 +02:00
9515c32016 docs: add migration system documentation and generated initial migrations
Added `README.md` to document the database migration system, including generation and usage instructions. Updated `generate-migrations.ts` to fix directory structure and streamline commands. Included initial migration files for schema setup using DrizzleORM.
2025-05-15 18:08:30 +02:00
9f99b80784 feat: implement authentication and database modules with relations and group management
Added new authentication strategies (JWT and GitHub OAuth), guards, and controllers. Implemented database module, schema with relations, and group management features, including CRD operations and person-to-group associations. Integrated validation and CORS configuration.
2025-05-15 17:09:36 +02:00