161 Commits

Author SHA1 Message Date
9c9caa409d
Add Docker build target and new dependencies.
Enhanced `project.json` to include a Docker build target configuration using `@nx-tools/nx-container`. Additionally, updated `package.json` and `pnpm-lock.yaml` files with new dependencies for project functionality and maintenance.
2024-10-25 14:44:34 +02:00
bcf2f28a6b
Add useCallbackRef hook and update imports
Implemented a custom `useCallbackRef` hook to optimize callback refs. Updated import paths for consistency and replaced `Cross2Icon` with `CrossIcon` in FileUploader component.
2024-10-25 14:44:22 +02:00
b512732a14
Add Dockerfile for frontend and backend apps
Introduced Dockerfiles for both frontend and backend applications to set up production environments. The frontend Dockerfile configures Next.js and the backend Dockerfile configures a Nest.js setup, both using node:lts-alpine base images. This update streamlines dependencies installation and container runtime configurations.
2024-10-25 09:35:50 +02:00
3cd94e5999
Add new dependencies to package.json
Added several new dependencies including `@hookform/resolvers`, `@tanstack/react-query`, `cors`, `react-dropzone`, `react-hook-form`, and `zod`. This update ensures the latest libraries and utilities are available for development. Corresponding updates were made to the `pnpm-lock.yaml` file to maintain integrity and compatibility.
2024-10-24 16:14:55 +02:00
d5370220a4
Improve code consistency and formatting
Standardize import order and formatting across DTOs and controllers. Ensure `HttpCode` usage aligns with correct HTTP status codes. Add CORS setup to `main.ts` for local development support.
2024-10-24 16:14:40 +02:00
bfe49f65ec
Refactor frontend components and API interactions
Removed redundant API endpoint and added reusable hooks. Implemented various UI component updates including loading spinner, file upload form, and machine selector. Improved state management in page and layout components and introduced new request handling functionalities.
2024-10-24 16:14:20 +02:00
ee127f431c
Add @tanstack/react-table dependency
Included @tanstack/react-table version ^8.20.5 in package.json to enhance table handling capabilities. Updated pnpm-lock.yaml to reflect the new dependencies and their respective versions.
2024-10-21 14:51:58 +02:00
13c77bfc32
Add files table and refactor sub-page components
Introduced a files table component for managing file data in the UI. Refactored sub-page components into a separate module for better code organization and maintainability. Adjusted text and links for consistency with language and configuration standards.
2024-10-21 14:51:49 +02:00
2d6815efb6
Update HTTP status code and import statements
Changed HTTP status code from FOUND to OK in files.controller.ts for better clarity. Added ApiResponse and IMachinesTable imports to machines.controller.ts to enhance API documentation and type checking.
2024-10-21 14:51:13 +02:00
30706118a8
Improve file handling in saveFile method
Added comments to clarify the buffer management in the file save process. This enhances code readability and maintenance.
2024-10-17 16:46:38 +02:00
b028fa653a
Add SWC configuration file for TypeScript support
This commit introduces a .swrc file to define SWC configuration. It specifies the use of TypeScript syntax and targets ES2021, along with support for decorator metadata and legacy decorators. Additionally, the module type is set to CommonJS and source maps are enabled.
2024-10-17 16:46:15 +02:00
1d550e29b1
Add @nestjs/cli to devDependencies
This commit adds the @nestjs/cli package, version ^10.4.5, to the devDependencies in the `package.json` file. Updates related dependency information in the pnpm-lock.yaml file to reflect this addition.
2024-10-17 16:46:03 +02:00
d9f0acac58
Enhance file upload endpoint in FilesController
Added detailed Swagger annotations including headers, body schema, and operation summary to improve API documentation for the file upload endpoint. These updates provide clear information about the expected input parameters for better usability and integration.
2024-10-17 14:56:06 +02:00
4547a22f5c
Add Swagger metadata to DTOs and controllers
Enhanced API documentation by adding Swagger decorators like @ApiProperty, @ApiTags, and @ApiBearerAuth to DTOs and controllers. This will improve clarity and usability of the API for developers using Swagger.
2024-10-17 14:21:23 +02:00
1020d6283d
Refactor code to improve readability and consistency
Reformatted import statements and function parameters for better readability. Improved alignment and punctuation to enhance code consistency and maintainability.
2024-10-17 12:26:51 +02:00
0330358139
Add missing semicolons for consistency
This commit adds missing semicolons to type definitions in schema.ts for consistent code style and better readability. No functional changes were made to the existing code logic.
2024-10-17 12:25:11 +02:00
38634132ba
Add search method to Files Service
Implemented a method to search for files in the database by limit, offset, and search term. This method enhances the service by providing a way to paginate and filter file results.
2024-10-17 12:21:58 +02:00
7b4792b612
Fix data type in pagination schema
Updated the `data` property in the pagination schema from a single object to an array of objects to accurately represent paginated data. This change ensures that the schema aligns with the actual data structure used in the application.
2024-10-17 12:21:21 +02:00
989ec71e2e
Fix data type in pagination schema
Updated the `data` property in the pagination schema from a single object to an array of objects to accurately represent paginated data. This change ensures that the schema aligns with the actual data structure used in the application.
2024-10-17 12:21:14 +02:00
2f0c2f8b7c
Add IWithCount interface to schema.ts
Introduced a new interface IWithCount to handle paginated data responses. It includes properties for count, limit, currentOffset, and a generic data type. This change will aid in standardizing pagination across the application.
2024-10-17 12:15:58 +02:00
8b5a4640c1
Introduce type exports in database schema
Improved the readability and usability of the database schema by introducing type exports for each table. The exported types (IFileTable, IFileGroupTable, IFilesTypesTable, IMachinesTable, IFilesForMachinesTable, IFilesTypeForMachine) will allow the schemas to be more easily referenced and utilized in other parts of the codebase.
2024-10-17 12:12:26 +02:00
92bb6bf367
Add SubHomePage component and minor styling updates
Introduced the SubHomePage component to enhance modularity of the home page. Adjusted styling to include margins and a dark mode class for the body element.
2024-10-17 12:04:28 +02:00
4d6962afb5
Update Next.js to version 14.2.15
Upgraded Next.js dependency from version 14.2.3 to 14.2.15 in package.json and pnpm-lock.yaml. This ensures improved stability and integrates the latest features and fixes in the Next.js framework.
**2 vulnerabilities found in dependency**
2024-10-17 12:04:17 +02:00
09ec8d683f
Upgrade dependencies to latest versions for security and fixes
Updated multiple dependencies in `package.json` and `pnpm-lock.yaml` to their latest versions. This includes key packages such as `@nestjs`, `express`, `typescript`, and others for enhanced stability, security, and performance improvements.
2024-10-17 12:01:07 +02:00
4f40ef371c
Change default port from 3000 to 3333
Updated the main application file to change the default port used when the environment variable PORT is not set from 3000 to 3333. This ensures the backend operates on a different port to avoid conflicts with other services running on port 3000.
2024-10-17 10:26:59 +02:00
ed1defb1da
Add NewFileModal component and implement resizable panels
Introduce a new NewFileModal component for adding files with a dialog box. Adjust page layout to use resizable panels to improve flexibility and user experience. Modify CSS variables for better dark mode color scheme.
2024-10-17 10:26:51 +02:00
3c31223293
Refactor code to use consistent tab spacing
Replaced mixed spaces and tabs with consistent tab spacing across multiple files for better code readability and maintenance. Adjusted import statements and string literals formatting to maintain coherence.
2024-10-15 16:51:12 +02:00
6f9d25a58b
Refactor and log changes in storage and file services
Convert array of machine IDs to sets for uniqueness in methods. Add console logs for debugging and update error handling to improve clarity. Refactor the files controller for better readability.
2024-10-15 16:50:33 +02:00
ff649ebdbf
Add Swagger integration and console logging for debugging
Integrated Swagger module in the backend for API documentation. Added console logs for better traceability and debugging in service and controller methods.
2024-10-15 15:15:55 +02:00
6f0f209e00
Delete associated machine file entries before removing main file
Added a step to delete file associations from `FilesForMachinesTable` before deleting the main file from `FilesTable`. This ensures proper cleanup of related entries in the database.
2024-10-15 14:24:00 +02:00
18a5999334
Implement file type removal functionality
Add logic to remove file types by ID, ensuring they are not in use by any files or machines. Handle errors appropriately, throwing specific exceptions for cases where the file type cannot be deleted or an internal error occurs.
2024-10-15 14:09:15 +02:00
877e13043d
Implement getAllFilesTypes in files controller
Added return statement to getTypes endpoint in files controller, utilizing the newly updated getAllFilesTypes method from the files service. Also fixed minor formatting issues.
2024-10-15 13:51:53 +02:00
6bb9510356
Add retrieval method for all file types in files service
Implemented the `getAllFilesTypes` method to retrieve all file types from the database. This method uses the database connection to select and return an array of file types, completing the previously marked TODO item.
2024-10-15 13:49:45 +02:00
a5f54e165b
Implement file type creation endpoint
Completed the `newType` method in `files.controller.ts` to call `filesService.createFileType` with the provided name and mime type. This enables the creation of new file types through the backend API.
2024-10-15 13:47:51 +02:00
b29b188912
Add createFileType method and DTO validations
Introduced createFileType method to handle file type creation, including format validation and error handling for database operations. Updated CreateFileTypeDto with length constraints on name and mime properties.
2024-10-15 13:47:11 +02:00
c7e1a949a2
Update file inclusion pattern in biome.json
Changed the file inclusion pattern to ensure only TypeScript files in src directories are included. This helps in focusing solely on source files and avoids unintended files from being processed.
2024-10-15 13:47:02 +02:00
16487e5985
Refactor test URL and add new npm script
Updated the axios GET request in the backend test to use double quotes for consistency. Added a new 'fix' script in package.json for Biome to automatically fix and write unsafe changes. Changed var to let in global-setup.ts for better variable handling.
2024-10-15 11:29:56 +02:00
8ee5410c91
Refactor files controller imports and rearrange decorators
Reorganized import statements for cleaner structure and added a missing import for CreateFileTypeDto. Adjusted the placement of UseGuards decorators to maintain consistency across methods.
2024-10-15 11:27:47 +02:00
e7830095b3
Add CreateFileTypeDto class to files.dto.ts
Introduced a new DTO class named CreateFileTypeDto in files.dto.ts for future implementations. The class currently has no properties defined, marked with a TODO comment for subsequent development.
2024-10-15 11:23:13 +02:00
055c48dbf9
Add endpoints for file types management
Introduced new endpoints to handle file types: fetching all types, adding a new type, and deleting a type. These additions include necessary guards and parameter parsing for robust API functionality.
2024-10-15 11:23:04 +02:00
1c78912f99
Add missing semicolons and format code for consistency
Updated the controllers and services by adding missing semicolons to ensure code consistency and prevent potential runtime errors. Reformatted the import statements to enhance readability and maintain a uniform style across the codebase.
2024-10-14 15:16:13 +02:00
04cc2daf43
Improve groups.controller with service integration
This commit adds service method calls for managing groups in the controller. It includes integration for fetching groups by name, creating a new group, deleting a group, and finding files for a group. These changes enhance the functionality and efficiency of the groups controller.
2024-10-14 14:52:52 +02:00
fc2f437556
Implement group deletion and add group files retrieval
Added logic to delete a group and update the associated files to have a null group reference. Also implemented a method to retrieve files associated with a group using pagination and search functionality.
2024-10-14 14:43:50 +02:00
1fc9185afc
Refactor storage and file deletion logic
Adjusted the indentation and formatting across several files for better readability. Enhanced the file deletion logic to handle cases where a file is found in the database but not in storage, and to delete only from the database when there are multiple references.
2024-10-14 13:56:43 +02:00
8686f0c27b
Add file deletion method in storage service
Implemented a new method to delete files from the storage by checksum and extension. This method logs the deletion process and throws a NotFoundException if the file cannot be found. Updated dependencies to include 'rm' from 'node:fs/promises'.
2024-10-14 12:10:52 +02:00
79b2dec9e9
Add file deletion endpoint with admin guard
Introduced the deleteFile method in files.service.ts to handle file deletion, considering duplicates. Also updated files.controller.ts to create a new DELETE endpoint protected by the AdminGuard to ensure only admins can delete files.
2024-10-14 12:04:12 +02:00
3e6b2dc2bc
Add TODO comment for future file deletion implementation
A TODO comment was added to the files.service.ts to indicate the need for a file deletion feature. This serves as a placeholder for future development to ensure the feature is addressed.
2024-10-14 11:58:30 +02:00
04a37d19b7
Add file saving functionality and update group ID handling
Implemented the save method to store files and associate them with machines, including handling optional group associations. Modified the database schema to allow null as a default for group_id and added logic to update group ID after file insertion.
2024-10-14 11:53:54 +02:00
30c9c28e3d
Refactor MIME type check for machine-specific validation
Updated the MIME type validation function to handle machine-specific MIME type sets. This ensures that a MIME type must be acceptable across all associated machines. Enhanced clarity and structure by using a map to maintain MIME types for each machine.
2024-10-14 11:21:50 +02:00
2ca13714a4
Refactor file and group handling logic
Allow groupId to be optional and added methods for group operations. Updated file insertion to handle optional groupId and adjusted group verification logic accordingly. Added method stubs for creating, deleting, and finding files within groups.
2024-10-11 11:00:37 +02:00