@@ -22,12 +22,20 @@ Before you begin, ensure you have the following installed:
2222 cd thinkredtech.github.io
2323 ```
2424
25- 2 . ** Install Dependencies**
25+ 2 . ** Install All Dependencies (Monorepo) **
2626
2727 ``` bash
28+ # Single command installs ALL workspace dependencies
2829 npm install
2930 ```
3031
32+ This automatically:
33+ - Installs root dependencies
34+ - Installs frontend dependencies
35+ - Installs backend dependencies
36+ - Sets up workspace linking
37+ - Copies documentation for development
38+
31393 . ** Environment Configuration**
3240
3341 Copy the environment example file:
@@ -51,15 +59,105 @@ Before you begin, ensure you have the following installed:
5159
5260 The website will be available at ` http://localhost:5173 `
5361
62+ ## Monorepo Workspace Configuration
63+
64+ ### ✅ ** Automatic Dependency Installation**
65+
66+ This project uses ** npm workspaces** for automatic dependency management across all packages. Here's how it works:
67+
68+ #### 🎯 ** Single Command Installation**
69+
70+ ``` bash
71+ # At the root - installs ALL workspace dependencies automatically
72+ npm install
73+ ```
74+
75+ This single command:
76+ - ✅ Installs root dependencies
77+ - ✅ Installs frontend workspace dependencies
78+ - ✅ Installs backend workspace dependencies
79+ - ✅ Creates proper workspace links
80+ - ✅ Automatically copies documentation for development
81+ - ✅ Maintains dependency version consistency
82+
83+ #### 🏗️ ** Workspace Structure**
84+
85+ ``` json
86+ {
87+ "workspaces" : [
88+ " frontend" ,
89+ " backend"
90+ ]
91+ }
92+ ```
93+
94+ #### 🚀 ** Available Installation Commands**
95+
96+ | Command | Description |
97+ | ---------| -------------|
98+ | ` npm install ` | Install all workspace dependencies (recommended) |
99+ | ` npm run task install ` | Task runner version with detailed output |
100+ | ` npm run install:clean ` | Clean install (removes node_modules first) |
101+
102+ #### 🔄 ** Automatic Hooks**
103+
104+ - ** postinstall** : Automatically copies documentation files for development
105+ - ** workspace linking** : npm automatically links shared dependencies
106+ - ** version consistency** : Overrides ensure consistent package versions
107+
108+ #### 📁 ** Installation Result**
109+
110+ After ` npm install ` at root:
111+ ```
112+ thinkred-monorepo/
113+ ├── node_modules/ # Root dependencies + workspace symlinks
114+ ├── frontend/
115+ │ └── node_modules/ # Frontend-specific dependencies
116+ └── backend/
117+ └── node_modules/ # Backend-specific dependencies (minimal)
118+ ```
119+
120+ #### 🎁 ** Benefits**
121+
122+ 1 . ** Developer Experience** : Single command installs everything
123+ 2 . ** CI/CD Simplification** : One installation step for all environments
124+ 3 . ** Dependency Consistency** : Shared packages use same versions
125+ 4 . ** Performance** : npm optimizes shared dependencies
126+ 5 . ** Maintainability** : No manual workspace management needed
127+
128+ #### ✅ ** Verification**
129+
130+ To verify the workspace setup is working:
131+
132+ ``` bash
133+ # Check workspace structure
134+ npm ls --workspaces
135+
136+ # Verify all dependencies are installed
137+ ls frontend/node_modules backend/node_modules
138+
139+ # Test development server (should work immediately)
140+ npm run dev
141+ ```
142+
143+ #### 🔧 ** Technical Details**
144+
145+ - ** npm workspaces** handle dependency resolution automatically
146+ - ** Hoisting** : Shared dependencies are installed at root level when possible
147+ - ** Isolation** : Workspace-specific dependencies remain in their respective directories
148+ - ** Linking** : npm creates symlinks for cross-workspace dependencies
149+
54150## Frontend Setup
55151
56152### Development Environment
57153
58- 1 . ** Install Frontend Dependencies**
154+ The frontend dependencies are automatically installed when you run ` npm install ` at the root level (see Monorepo Workspace Configuration above).
155+
156+ 1 . ** Verify Frontend Setup**
59157
60158 ``` bash
61- cd frontend
62- npm install
159+ # Check that frontend dependencies were installed
160+ ls frontend/node_modules
63161 ```
64162
651632 . ** Available Scripts**
@@ -76,11 +174,14 @@ Before you begin, ensure you have the following installed:
76174 - Tailwind CSS with live reload
77175 - ESLint and Prettier integration
78176 - Automated testing setup
177+ - Automatic documentation sync for ` /docs ` route
79178
80179## Backend Setup
81180
82181### Google Apps Script Configuration
83182
183+ The backend dependencies are automatically installed when you run ` npm install ` at the root level (see Monorepo Workspace Configuration above).
184+
841851 . ** Install Google Apps Script CLI**
85186
86187 ``` bash
0 commit comments