This commit fixes a TypeError that occurred because the contactRoutes
module was being initialized before the contactController module.
The fix involves:
- Swapping the initialization order in server.js so the contactController is
initialized before contactRoutes.
- Modifying contactRoutes.js to accept the initialized contactController
as a dependency, rather than requiring it on its own.
This commit refactors the entire codebase from a monolithic structure to a
modular one. Key changes include:
- Extracting core components (e.g., user authentication, data processing,
API handlers) into their own distinct modules.
- Implementing a new directory structure to support a modular design.
- Updating all internal references and import paths to reflect the new
architecture.
The new structure improves maintainability, scalability, and allows for
easier independent development of each module in the future.