Skip to content

Commit 065ce62

Browse files
committed
feat(workflow): integrate docs copying and streamline monorepo dependencies
BREAKING CHANGE: Removed copy-docs-for-dev.sh script, integrated into task runner - Add automated docs copying via task runner preTask system - Streamline workspace dependency management using npm workspaces - Remove redundant install scripts and upgrade dependencies - Consolidate documentation structure and remove outdated files
1 parent 61f9b6a commit 065ce62

File tree

12 files changed

+2883
-591
lines changed

12 files changed

+2883
-591
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ frontend/dist/
1919
**/frontend/dist/
2020
frontend/hostinger-deploy/
2121

22+
# Generated documentation copies for development
23+
frontend/public/docs/
24+
!frontend/public/docs/developer/
25+
!frontend/public/docs/operations/
26+
2227
# Generated documentation reports and artifacts
2328
reports/documentation/*.log
2429
reports/documentation/*.html

.markdownlint-cli2.jsonc

Whitespace-only changes.

QA_ACHIEVEMENT_REPORT.md

Lines changed: 0 additions & 155 deletions
This file was deleted.

TASKS.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

docs/developer/setup/installation.md

Lines changed: 105 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
3139
3. **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

65163
2. **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+
84185
1. **Install Google Apps Script CLI**
85186

86187
```bash

docs/developer/setup/troubleshooting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ git reset --hard origin/main
10671067

10681068
# 3. Fresh installation
10691069
rm -rf node_modules package-lock.json frontend/node_modules frontend/package-lock.json
1070-
npm run install:all
1070+
npm install
10711071

10721072
# 4. Reset environment
10731073
rm .env .deployment-config.json
@@ -1108,7 +1108,7 @@ Before asking for help, check these:
11081108
- [ ] Did you read the error message carefully?
11091109
- [ ] Did you try turning it off and on again?
11101110
- [ ] Are you on the latest version of Node.js?
1111-
- [ ] Did you run `npm run install:all`?
1111+
- [ ] Did you run `npm install` at the root to install all workspace dependencies?
11121112
- [ ] Are your environment variables configured?
11131113
- [ ] Did you check the browser console for errors?
11141114
- [ ] Did you try the common fixes above?
@@ -1166,7 +1166,7 @@ When reporting issues, include:
11661166
```bash
11671167
# Daily routine
11681168
git pull origin main # Stay updated
1169-
npm run install:all # Keep dependencies fresh
1169+
npm install # Keep dependencies fresh (workspace-aware)
11701170
npm run lint # Check code quality
11711171
npm test # Run tests
11721172
npm run type-check # Check TypeScript

0 commit comments

Comments
 (0)