Reorganize Models & Types #211
Labels
Cleanup
Tasks for removing clutter and improving project structure.
🌱Nice-to-Have
Enhancements, Refactors, UI tweaks, or non-critical optimizations
Milestone
The current
models.ts
file is a catch-all for various unrelated types (DocumentType
,User
,LinkDetail
, etc.), which becomes unwieldy as the project grows. To enhance maintainability, this issue focuses on splitting models into domain-focused files and following a clean, scalable structure.Tasks
Split
models.ts
into domain-specific files:authModels.ts
for authentication-related types.documentModels.ts
for document-related types.linkModels.ts
for link-related types.userModels.ts
for user data models.Create an
index.ts
in themodels/
folder to re-export models for cleaner imports.Remove logic from model files:
Create a dedicated config file for icons and mappings (e.g.,
config/fileIcons.ts
).Identify and document new models used across the application and add them to the appropriate model files.
Review and update all references across the codebase to use the new model structure.
Example Directory Structure
Guidelines
✅ Keep models purely for data structure definitions.
✅ Use a barrel file
index.ts
for centralized imports.✅ Move any icon or file-related mappings into the
config/
folder.Benefits
✅ Easier to find, update, and manage types.
✅ Cleaner imports with centralized re-exports.
✅ Prevents large, cluttered “mega files.”
✅ Scalable as the project grows.
The text was updated successfully, but these errors were encountered: