As the complexity of our application has increased, the index.ts and dataProcessing.ts files have become somewhat unwieldy. This PR addresses this issue by reorganizing and modularizing various API and middleware functions based on their specific concerns. Additionally, it introduces and implements new TypeScript settings to help streamline the code.
Changes to index.ts involve:
Moving env var type validation and parsing to config.ts.
Anything to do with auth strategy validation to middleware.ts and post-login redirection process to loginController.ts.
For dataProcessing.ts:
Splitting the file up into filterData.ts, transformData.ts, types.ts, and helpers.ts, focused on distinct aspects.
Within these, a number of the functions have been renamed to better reflect their purpose.
Lastly, per the stronger TypeScript config, removal of some redundant imports and types (like in authMiddleware.ts), which were remnants of past work and no longer needed.
As the complexity of our application has increased, the
index.ts
anddataProcessing.ts
files have become somewhat unwieldy. This PR addresses this issue by reorganizing and modularizing various API and middleware functions based on their specific concerns. Additionally, it introduces and implements new TypeScript settings to help streamline the code.Changes to
index.ts
involve:config.ts
.middleware.ts
and post-login redirection process tologinController.ts
.For
dataProcessing.ts
:filterData.ts
,transformData.ts
,types.ts
, andhelpers.ts
, focused on distinct aspects.Lastly, per the stronger TypeScript config, removal of some redundant imports and types (like in
authMiddleware.ts
), which were remnants of past work and no longer needed.