The following functions should not be declared as fileService methods but should be added to the FastifyInstance as an "fs" plugin be declared in the utils folder.
:warning: That plugin should be loaded first as it will be required by services
saveFile()
deleteFile()
[x] Cloudinary refacto
The following functions should not be declared as fileService methods but should be added to the FastifyInstance as a "Cloudinary" plugin. (Add it in the Server/utils folder and import it with the other external dependencies) be declared in the utils folder.
UploadAvatar()
This function should be a UserService function.
Replace generateGuid() method calls with crypto's randomUUID()
import crypto from "crypto";
crypto.randomUUID();
cloudinaryUpload()
Errors should not be ignored
cloudinaryDelete()
Errors should not be ignored
Utils
[ ] parseOptions.ts
should be refactored (It may not be needed anymore).
Roadmap
Server structure https://github.com/Cinevoraces/cinevoraces/pull/162
Rework Error handling=> https://github.com/Cinevoraces/cinevoraces/issues/168Services
Global
Rework the structure of the controllers/services. No more "_" prefix
services shouldn't be classes as it's not the fastify convention.DatabaseService
Create a class that handles database interactions https://github.com/Cinevoraces/cinevoraces/pull/163DateService https://github.com/Cinevoraces/cinevoraces/pull/164
FileService
[x] Create an HTTPClient class https://github.com/Cinevoraces/cinevoraces/pull/167
(Add it in the Server/utils folder and import it with the other external dependencies)
downloadFile()
method to that class[x] fs refacto https://github.com/Cinevoraces/cinevoraces/pull/167
The following functions should not be declared as fileService methods but should
be added to the FastifyInstance as an "fs" pluginbe declared in the utils folder.:warning:
That plugin should be loaded first as it will be required by servicessaveFile()
deleteFile()
[x] Cloudinary refacto
The following functions should not be declared as fileService methods
but should be added to the FastifyInstance as a "Cloudinary" plugin. (Add it in the Server/utils folder and import it with the other external dependencies)be declared in the utils folder.UploadAvatar()
This function should be a UserService function.
Replace
generateGuid()
method calls with crypto'srandomUUID()
cloudinaryUpload()
Errors should not be ignored
cloudinaryDelete()
Errors should not be ignored
Utils
[ ] parseOptions.ts
should be refactored (It may not be needed anymore).
Tests