56 Commits

Author SHA1 Message Date
6b8ea9cd00
Refactor file service return type to StreamableFile
Updated the FilesService.get() method to return a StreamableFile directly with appropriate headers instead of a custom object. Adjusted the FilesController to reflect this change and ensure the file names are formatted by replacing spaces with underscores.
2024-10-03 09:51:26 +02:00
56df921a9b
Refactor MIME type check in storage service
Replace loop-based MIME type check with Set.prototype.has for improved readability and performance. This change eliminates the need for an explicit loop, making the code more concise and efficient.
2024-09-30 14:38:58 +02:00
fcb39250ca
Add new fields to schema
Introduce 'extension' and 'isDocumentation' fields to the database schema. These additions enhance file metadata and facilitate improved data management.
2024-09-30 14:34:59 +02:00
541dcda6a9
Add StorageModule and DbModule to FilesModule
This commit updates the FilesModule to import both StorageModule and DbModule. This enhances the functionality of the FilesModule by integrating database and storage services.
2024-09-30 14:34:48 +02:00
dc2e87615c
Switch file read to streamable and update method signatures
Replaced Buffer with StreamableFile for more efficient file handling by streaming the content instead of reading it into memory. Additionally, updated the method signatures and parameters to improve clarity and align with the new changes.
2024-09-30 14:33:57 +02:00
040dada16c
Add ts-mockito library to project
Included ts-mockito version 2.6.1 to both package.json and pnpm-lock.yaml files. This addition will aid in creating mock objects in unit tests, enhancing the project's test capabilities.
2024-09-30 14:33:39 +02:00
310a806c87
Remove file service tests and update get method parameter
Removed the `files.service.spec.ts` test file as it is no longer required. Updated the `get` method parameter in `files.service.ts` to use `fileId` instead of `checksum`, and adjusted the related logic for consistency.
2024-09-30 14:33:18 +02:00
4d7ae970bc
Add get method to FilesService
Implemented a method to fetch a file and its information based on checksum. Integrated database and storage services to retrieve and prepare file stream and metadata. Also handles scenarios where the file is not found or multiple entries exist for the same checksum.
2024-09-30 14:20:37 +02:00
ddf9ef4860
Add method to read file from storage
Introduced a new `read` method in `storage.service.ts` to fetch files from storage based on checksum, extension, and type. This method handles potential exceptions by throwing a `NotFoundException` if the file is not found.
2024-09-30 11:30:14 +02:00
e788f4945e
Add detailed processing and validation for new files
Enhanced the "new" method to include detailed documentation and parameters for file processing and validation. Introduced allowed MIME types as a parameter and logging for clearer file management.
2024-09-30 11:10:36 +02:00
fd8ad47cf7
Standardize code formatting for consistency
Update all NestJS imports to use double quotes instead of single quotes across multiple files. Adjusted indentation in various files to ensure uniform code style. These changes improve code readability and maintainability.
2024-09-30 08:46:45 +02:00
2aa132e511
Fix case and add TODO in storage service
Corrected the case for 'MIMEs' in comments for consistency. Added a TODO comment to clarify required file formats in the checkConditions function.
2024-09-26 14:56:52 +02:00
6523e34328
Add NotepadTextDashed icon to Documentation button
Updated the Documentation button to include a NotepadTextDashed icon from lucide-react. This change improves visual consistency and enhances user experience by aligning with the icon usage pattern established in the Accueil button.
2024-09-26 14:56:39 +02:00
cb6bd9f409
Remove Machine module and related files
Deleted MachineController, MachineModule, and associated tests to streamline the codebase. This simplifies the project structure by removing unused or redundant components.
2024-09-26 14:56:18 +02:00
f4393301a2
Refactor StorageService to include MIME type and size checks
Reorganized StorageService to incorporate MIME type validation and adjustable file size limits, enhancing file validation. Introduced new methods for checksum calculation and file information generation, and updated the StorageModule to import the DbModule for database interactions.
2024-09-24 12:29:11 +02:00
d42aaeda05
Add checksum field and unique constraint on type_name
Added a new 'checksum' field with a length of 64 characters to ensure data integrity. Additionally, enforced uniqueness on the 'type_name' to prevent duplicate entries.
2024-09-24 12:28:53 +02:00
bdadf51e54
Refactor layout and navigation on HomePage
Updated tsconfig.json to include paths for better imports. Modified layout.tsx and Header.tsx for improved styles. Refactored HomePage to use new state management and simplified components for better readability and navigation.
2024-09-23 16:17:31 +02:00
3e49047f0e
Rename modules to match naming conventions
Updated `MachineModule` to `MachinesModule` and `AuthorModule` to `AuthorsModule` for consistency with pluralized naming. Adjusted import paths accordingly to reflect these changes.
2024-09-23 14:17:37 +02:00
0b66f9d3a3
Rename MachineService to MachinesService and add Machines module
Renamed MachineService to MachinesService across the codebase for consistency. Added MachinesController, MachinesModule, and associated tests to enhance modularity and structure.
2024-09-23 14:17:25 +02:00
a9cd71995d
Add new dependencies and update existing ones
Added dependencies include @nestjs/throttler, argon2, express, helmet, and jose. Updated existing dependencies in package.json and pnpm-lock.yaml to their latest versions for compatibility and security improvements.
2024-09-23 14:17:08 +02:00
a6b0768ecc
Add new dependencies and update existing ones
Added dependencies include @nestjs/throttler, argon2, express, helmet, and jose. Updated existing dependencies in package.json and pnpm-lock.yaml to their latest versions for compatibility and security improvements.
2024-09-23 12:18:25 +02:00
27e21f2289
Update dependencies in package.json and pnpm-lock.yaml
Updated multiple dependencies to their latest versions in both package.json and pnpm-lock.yaml. This ensures compatibility and incorporates the latest features and security fixes.
2024-09-23 12:10:29 +02:00
91b87237b2
Add newline at end of tsconfig.base.json
This change ensures the file ends with a newline character, conforming to standard formatting practices. It helps in maintaining consistency and prevents potential issues with some text editors and version control systems.
2024-09-23 12:09:14 +02:00
b336c41bdd
Add MachineModule and AuthorModule to AppModule
This commit adds MachineModule and AuthorModule to the imports array in the AppModule. This inclusion ensures that the functionalities provided by these modules are available throughout the application.
2024-09-23 12:09:06 +02:00
515091645e
Add Machine module with controller, service, and tests
Implemented the MachineModule along with its corresponding MachineController and MachineService classes. Added unit tests for both the controller and service to ensure they are correctly instantiated and defined.
2024-09-23 12:08:54 +02:00
44b783561b
Add Author module with controller and service
This commit introduces a new Author module in the backend application. It includes the AuthorController with basic endpoints and the AuthorService for handling author-related logic. Basic test files for both the controller and the service are also added.
2024-09-23 12:08:38 +02:00
1881a7e6c4
Add CRUD endpoints for GroupsController
Implemented GET, POST, and DELETE endpoints in GroupsController to manage groups and associated files with pagination and optional search functionality. Created an ISearchQuery interface to standardize query parameters across methods.
2024-09-23 12:08:21 +02:00
6a759bd693
Add Files, Groups, and Admin modules to backend
This commit introduces the Files, Groups, and Admin modules, along with their respective services and controllers. Each module includes basic setup with injectable services, controllers, and initial test specs to ensure they are defined properly. This groundwork prepares the backend for further development and feature implementation.
2024-09-10 09:57:42 +02:00
dba8837f57
Add new modules to app.module.ts
Integrated FilesModule, AdminModule, and GroupsModule into app.module.ts to extend functionality. This addition enhances organizational capabilities and improves system modularity.
2024-09-10 09:57:01 +02:00
f2a45ce271
Add groupId column and FilesGroupTable schema
Added the `groupId` column to the existing table to link with the new `FilesGroupTable`. The `FilesGroupTable` includes a unique identifier and a unique group name to manage file groups effectively.
2024-09-02 15:50:48 +02:00
d4a224614e
Add security and performance enhancements, remove unused code
Deleted unused spec files for app controller and service to clean up the codebase. Added helmet middleware for security and integrated ThrottlerModule for rate limiting and ConfigModule for configuration management. Updated app.service to modify response structure.
2024-09-02 14:58:28 +02:00
be121ef7ca
Enable new schema for file types and machines
Removed the deprecated `firstName` and `lastName` fields and introduced `email` and `uploader` fields. Added `FilesTypesTable`, `MachinesTable`, and `FilesTypeForMachine` for managing file types and machine associations. Updated the `fileType` field to reference `FilesTypesTable`.
2024-09-02 14:58:04 +02:00
b4c4151550
Add credential management service and module
Introduced `CredentialsService` for handling password hashing, verification, and JWT token operations. Added `CredentialsModule` to register `CredentialsService` and integrate it with the ConfigModule.
2024-09-02 14:57:36 +02:00
c0a61cde3b
Add authentication module with user and admin guards
Implemented the `AuthModule` with necessary controllers and services to handle user authentication and authorization. Added `UserGuard` and `AdminGuard` to secure endpoints based on user roles.
2024-09-02 14:57:13 +02:00
46f8a61c9e
Ajoute des composants UI et des packages Radix
Ajout des nouveaux composants UI : Alert, Badge, Form, Sheet, Tabs et Input dans le répertoire frontend. Mise à jour du fichier package.json avec des nouvelles dépendances Radix UI et des autres bibliothèques nécessaires. Ajout d'une configuration pour TailwindCSS dans components.json.
2024-08-23 13:23:57 +02:00
25fc0127b2
Ajoute des composants UI et des packages Radix
Ajout des nouveaux composants UI : Alert, Badge, Form, Sheet, Tabs et Input dans le répertoire frontend. Mise à jour du fichier package.json avec des nouvelles dépendances Radix UI et des autres bibliothèques nécessaires. Ajout d'une configuration pour TailwindCSS dans components.json.
2024-08-22 15:24:18 +02:00
53c7938304
Corrige la déclaration de la méthode getChecksum
Ajoute la spécification de retour pour la méthode getChecksum dans StorageService. Cela améliore la clarté et la sécurité du code en explicitant le type de retour attendu.
2024-08-21 16:23:28 +02:00
f0a950f16a
Ajoute la dépendance "file-type" à package.json
Ajout de "file-type" à la liste des dépendances dans package.json pour permettre la détection du type de fichier. Les modifications dans pnpm-lock.yaml incluent également des dépendances supplémentaires et leurs résolutions associées.
2024-08-21 16:07:07 +02:00
a911d2d9d5
Ajoute des fonctions de gestion de fichiers dans StorageService
Ajout des fonctions privées pour sauvegarder, vérifier, et récupérer des fichiers dans le service de stockage. Plusieurs exceptions gérées pour les erreurs courantes telles que la taille et le type de fichier.
2024-08-21 16:06:46 +02:00
c0960519ae
Modifie le type de paramètre de initializeClients
Change le type du paramètre dbConfig de `any` à `object` pour renforcer le typage et éviter les erreurs potentielles. Cela améliore la robustesse et la maintenabilité du code.
2024-08-21 15:16:58 +02:00
948acaa680
Ajoute docker-compose.yml pour le service de base de données
Cette configuration ajoute un fichier docker-compose.yml pour définir un service PostgreSQL. Cela inclut les paramètres nécessaires tels que les variables d'environnement et les volumes. Cela simplifie le déploiement et le développement en configurant automatiquement le conteneur PostgreSQL.
2024-08-21 15:12:19 +02:00
527ca39c17
Ajoute le module de stockage
Création du fichier StorageService avec l'annotation @Injectable et déclaration de StorageModule avec le StorageService comme fournisseur. Cela prépare le backend à gérer les fonctionnalités de stockage.
2024-08-21 15:12:09 +02:00
425e44eb2d
Ajoute des dépendances supplémentaires à pnpm-lock.yaml
Ajout des dépendances liées à NestJS, Drizzle, Esbuild et PostgreSQL. Cela inclut les versions spécifiées pour chaque package, garantissant la compatibilité et les mises à jour nécessaires pour le projet.
2024-08-21 15:11:51 +02:00
76933ca39f
Refactor DB initialization code
Sépare la configuration de la base de données et l'initialisation des clients en deux méthodes distinctes. Cela améliore la lisibilité et facilite la gestion future des configurations et des clients.
2024-08-21 15:08:31 +02:00
419aa197a1
Ajoute des nouvelles dépendances
Ajout des bibliothèques @nestjs/config, drizzle-kit, drizzle-orm, drizzle-zod et postgres dans package.json. Cela permettra une meilleure configuration de l'application et des interactions avec la base de données.
2024-08-21 14:33:15 +02:00
516c55821a
Corrige les indentations dans schema.ts
Cette modification standardise les indentations afin d'améliorer la lisibilité et la cohérence du code. Aucune fonctionnalité n'a été modifiée, ces changements sont purement esthétiques.
2024-08-21 14:32:30 +02:00
e03fa60723
Réorganise les importations dans db.module.ts
Réajustement de l'ordre des importations dans db.module.ts pour améliorer la lisibilité et le respect des conventions de code. Aucun changement fonctionnel n'a été introduit.
2024-08-21 14:32:03 +02:00
8b34220762
Ajoute .env au fichier .gitignore
Cela empêche le commit accidentel des fichiers de configuration sensibles. Les variables d'environnement définies dans .env ne seront plus suivies par Git, ce qui améliore la sécurité du dépôt.
2024-08-21 14:31:15 +02:00
1b2440e451
Ajouter .env.example au projet
Ajout d'un fichier .env.example pour stocker les variables d'environnement nécessaires à la configuration de la base de données PostgreSQL et autres paramètres. Cela facilitera l'intégration et la configuration locale pour les développeurs.
2024-08-21 14:30:28 +02:00
9fd5bf5bab
Ajoute le fichier de configuration pour Drizzle
Ajoute un nouveau fichier drizzle.config.ts pour définir la configuration de Drizzle. Le fichier inclut les informations de connexion à la base de données PostgreSQL à partir des variables d'environnement.
2024-08-21 14:30:03 +02:00