Implement site structure synchronization between WordPress and IGNY8 backend
- Added a new API endpoint in the `IntegrationViewSet` to update the WordPress site structure, including post types and taxonomies. - Implemented a function to retrieve the site structure and sync it to the IGNY8 backend after establishing a connection. - Scheduled a daily cron job to keep the site structure updated. - Enhanced the WordPress plugin to trigger synchronization upon successful API connection. - Updated relevant files to support the new synchronization feature, improving integration capabilities.
This commit is contained in:
289
WORKSPACE-SETUP.md
Normal file
289
WORKSPACE-SETUP.md
Normal file
@@ -0,0 +1,289 @@
|
||||
# 🗂️ Workspace Setup Guide
|
||||
|
||||
## Current Setup
|
||||
|
||||
Your git repository is located at:
|
||||
```
|
||||
/data/app/igny8
|
||||
```
|
||||
|
||||
Git remote:
|
||||
```
|
||||
https://git.igny8.com/salman/igny8.git
|
||||
```
|
||||
|
||||
Current branch: `main`
|
||||
|
||||
---
|
||||
|
||||
## ✅ Recommended Cursor Workspace Configuration
|
||||
|
||||
### Option 1: Single Workspace (Recommended)
|
||||
|
||||
In Cursor, open the workspace folder:
|
||||
```
|
||||
/data/app/igny8
|
||||
```
|
||||
|
||||
This gives you direct access to:
|
||||
- ✅ Backend code (`backend/`)
|
||||
- ✅ Frontend code (`frontend/`)
|
||||
- ✅ WordPress Plugin (`igny8-wp-plugin/`)
|
||||
- ✅ All documentation
|
||||
- ✅ Git integration (all commits visible)
|
||||
|
||||
### Option 2: Multi-Root Workspace (Advanced)
|
||||
|
||||
If you want separate workspaces for frontend and backend:
|
||||
|
||||
**Workspace A: Backend**
|
||||
```
|
||||
/data/app/igny8/backend
|
||||
```
|
||||
|
||||
**Workspace B: Plugin**
|
||||
```
|
||||
/data/app/igny8/igny8-wp-plugin
|
||||
```
|
||||
|
||||
**Workspace C: Frontend**
|
||||
```
|
||||
/data/app/igny8/frontend
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Quick Setup in Cursor
|
||||
|
||||
### Step 1: Close current workspace
|
||||
- Cmd/Ctrl+K, Cmd/Ctrl+W
|
||||
|
||||
### Step 2: Open folder
|
||||
- File → Open Folder
|
||||
- Navigate to: `/data/app/igny8`
|
||||
- Click "Open"
|
||||
|
||||
### Step 3: Verify setup
|
||||
- Should see folder tree with:
|
||||
- `backend/`
|
||||
- `frontend/`
|
||||
- `igny8-wp-plugin/`
|
||||
- `SYNC-FIX-*.md` files
|
||||
- `.git/` folder
|
||||
|
||||
### Step 4: Verify git
|
||||
- Open Source Control (Ctrl+Shift+G)
|
||||
- Should show: `main` branch
|
||||
- Should show git history
|
||||
|
||||
---
|
||||
|
||||
## 📂 Folder Structure
|
||||
|
||||
```
|
||||
/data/app/igny8/
|
||||
├── backend/ # Django REST API
|
||||
│ └── igny8_core/
|
||||
│ ├── modules/
|
||||
│ │ ├── integration/ # Integration views (MODIFIED ✅)
|
||||
│ │ ├── planner/
|
||||
│ │ ├── writer/
|
||||
│ │ └── ...
|
||||
│ ├── api/
|
||||
│ ├── settings.py
|
||||
│ └── ...
|
||||
│
|
||||
├── frontend/ # React app
|
||||
│ ├── src/
|
||||
│ │ ├── pages/
|
||||
│ │ ├── components/
|
||||
│ │ └── ...
|
||||
│ ├── package.json
|
||||
│ └── ...
|
||||
│
|
||||
├── igny8-wp-plugin/ # WordPress Plugin
|
||||
│ ├── admin/ # MODIFIED ✅
|
||||
│ │ ├── class-admin.php
|
||||
│ │ └── settings.php
|
||||
│ ├── includes/ # MODIFIED ✅
|
||||
│ │ ├── functions.php
|
||||
│ │ ├── class-igny8-api.php
|
||||
│ │ └── ...
|
||||
│ ├── sync/ # MODIFIED ✅
|
||||
│ │ ├── hooks.php
|
||||
│ │ ├── post-sync.php
|
||||
│ │ └── ...
|
||||
│ ├── igny8-bridge.php
|
||||
│ └── ...
|
||||
│
|
||||
├── docs/ # Documentation
|
||||
├── sites/ # Site configuration
|
||||
├── master-docs/ # Master documentation
|
||||
│
|
||||
├── .git/ # Git repository
|
||||
├── docker-compose.app.yml # Docker config
|
||||
├── .gitignore
|
||||
├── README.md
|
||||
├── CHANGELOG.md
|
||||
│
|
||||
└── SYNC-FIX-*.md # Sync fix documentation (NEW ✅)
|
||||
├── README-SYNC-FIX.md
|
||||
├── SYNC-FIX-SUMMARY.md
|
||||
├── IMPLEMENTATION-COMPLETE.md
|
||||
├── SYNC-FIX-IMPLEMENTATION.md
|
||||
├── SYNC-ARCHITECTURE-DIAGRAM.md
|
||||
├── QUICK-SYNC-TEST.md
|
||||
└── SYNC-FIX-INDEX.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔄 Git Workflow
|
||||
|
||||
### View changes
|
||||
```bash
|
||||
cd /data/app/igny8
|
||||
git status # See modified files
|
||||
git diff # See what changed
|
||||
```
|
||||
|
||||
### Branches available
|
||||
```bash
|
||||
git branch -a # List all branches
|
||||
```
|
||||
|
||||
Current branches:
|
||||
- `main` (current)
|
||||
- `feature/phase-0-credit-system`
|
||||
- `chore-http405-error-*` (multiple)
|
||||
|
||||
### Commit changes
|
||||
```bash
|
||||
git add .
|
||||
git commit -m "Fix: WordPress plugin sync with backend"
|
||||
git push origin main
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 📝 Modified Files in Git
|
||||
|
||||
### Stage all changes:
|
||||
```bash
|
||||
cd /data/app/igny8
|
||||
git add backend/igny8_core/modules/integration/views.py
|
||||
git add igny8-wp-plugin/admin/class-admin.php
|
||||
git add igny8-wp-plugin/includes/functions.php
|
||||
git add igny8-wp-plugin/sync/hooks.php
|
||||
```
|
||||
|
||||
### View staged changes:
|
||||
```bash
|
||||
git diff --staged
|
||||
```
|
||||
|
||||
### Commit:
|
||||
```bash
|
||||
git commit -m "feat: WordPress plugin site structure sync
|
||||
|
||||
- Added update-structure endpoint to accept WP site structure
|
||||
- Plugin now sends post types and taxonomies to backend
|
||||
- Backend stores structure in SiteIntegration config
|
||||
- Frontend Content Types tab now displays data
|
||||
- Added daily cron job for periodic updates
|
||||
|
||||
Fixes: WordPress plugin sync not working
|
||||
Closes: [issue number if applicable]"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Development Environment
|
||||
|
||||
### Backend
|
||||
```bash
|
||||
cd /data/app/igny8/backend
|
||||
python manage.py runserver
|
||||
# or
|
||||
docker-compose restart backend
|
||||
```
|
||||
|
||||
### Frontend
|
||||
```bash
|
||||
cd /data/app/igny8/frontend
|
||||
npm start
|
||||
```
|
||||
|
||||
### WordPress Plugin
|
||||
```bash
|
||||
# Copy to WordPress installation
|
||||
cp -r /data/app/igny8/igny8-wp-plugin/* /path/to/wordpress/wp-content/plugins/igny8-wp-plugin/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔍 Key Files for Reference
|
||||
|
||||
### Backend Changes
|
||||
- `backend/igny8_core/modules/integration/views.py` (Lines 1-20: imports, Lines 172-221: new endpoint)
|
||||
|
||||
### Plugin Changes
|
||||
- `igny8-wp-plugin/includes/functions.php` (Lines 527-707: new functions, Lines 463-489: cron schedule)
|
||||
- `igny8-wp-plugin/admin/class-admin.php` (Lines 283-286: call sync after connection)
|
||||
- `igny8-wp-plugin/sync/hooks.php` (Line 36: register cron hook)
|
||||
|
||||
---
|
||||
|
||||
## 📚 Documentation Index
|
||||
|
||||
See `SYNC-FIX-INDEX.md` for complete documentation guide:
|
||||
|
||||
```bash
|
||||
cat /data/app/igny8/SYNC-FIX-INDEX.md
|
||||
```
|
||||
|
||||
Quick reference:
|
||||
- **Overview**: `README-SYNC-FIX.md`
|
||||
- **Testing**: `QUICK-SYNC-TEST.md`
|
||||
- **Technical**: `SYNC-FIX-IMPLEMENTATION.md`
|
||||
- **Architecture**: `SYNC-ARCHITECTURE-DIAGRAM.md`
|
||||
|
||||
---
|
||||
|
||||
## ✅ Verification Checklist
|
||||
|
||||
- [x] Git repository at `/data/app/igny8`
|
||||
- [x] Remote configured: `git.igny8.com/salman/igny8.git`
|
||||
- [x] Main branch active
|
||||
- [x] Backend folder present
|
||||
- [x] Frontend folder present
|
||||
- [x] Plugin folder present
|
||||
- [x] Documentation files created
|
||||
- [x] Modified files ready for commit
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Next Steps
|
||||
|
||||
1. **Open workspace**: File → Open Folder → `/data/app/igny8`
|
||||
2. **Review changes**: Source Control (Ctrl+Shift+G)
|
||||
3. **Test changes**: Follow `QUICK-SYNC-TEST.md`
|
||||
4. **Commit changes**: Use git commands above
|
||||
5. **Deploy**: Restart backend and update plugin
|
||||
|
||||
---
|
||||
|
||||
## 📞 Help
|
||||
|
||||
For questions about:
|
||||
- **Workspace setup**: See this file
|
||||
- **Sync fix details**: See `SYNC-FIX-INDEX.md`
|
||||
- **Testing**: See `QUICK-SYNC-TEST.md`
|
||||
- **Architecture**: See `SYNC-ARCHITECTURE-DIAGRAM.md`
|
||||
|
||||
---
|
||||
|
||||
_Setup guide created: November 22, 2025_
|
||||
_Workspace location: `/data/app/igny8`_
|
||||
_Git remote: `https://git.igny8.com/salman/igny8.git`_
|
||||
|
||||
Reference in New Issue
Block a user