A 3-repository architecture that decouples backend and frontend:
mtav-stack/ # Orchestrator repository
├── api/ # Backend submodule (Django REST API)
├── spa/ # Frontend submodule (React SPA)
├── mtav # Unified development script
├── docker-compose.yml # Service orchestration
├── README.md # Overview
└── ARCHITECTURE.md # Detailed architecture guide
✅ api/ - Git repo initialized (commit: 1a9d097) ✅ spa/ - Git repo initialized (commit: 0bf0dbb) ✅ mtav-stack/ - Git repo initialized with submodules (commit: 7882451)
cd /home/x/Development/Repos/MTAV/mtav/mtav-stack
# Start everything
./mtav upThis will:
- Create
.envfrom.env.example - Build Docker images for backend and frontend
- Start all services (db, redis, backend, frontend, celery, mailhog)
- Run database migrations
- Install dependencies
Once running:
- Frontend SPA: http://localhost:3000
- Backend API: http://localhost:8000/api
- API Docs: http://localhost:8000/api/docs/
- Admin Panel: http://localhost:8000/admin
- MailHog: http://localhost:8025
# Start
./mtav up
# View logs
./mtav logs
# Run backend command
./mtav backend migrate
./mtav backend createsuperuser
# Run frontend command
./mtav frontend install
./mtav frontend build
# Shell access
./mtav shell backend
./mtav shell frontend
# Run tests
./mtav test # All tests
./mtav test-backend # Django tests
./mtav test-frontend # React tests
# Stop
./mtav down# 1. Remove Django submodule
git submodule deinit api
git rm api
# 2. Create/clone your Rails API (implementing same REST contract)
# 3. Add as submodule
git submodule add [your-rails-api-url] api
# 4. Update docker-compose.yml if needed
# 5. Rebuild
./mtav rebuild backend
# 6. Done! Frontend works unchanged
./mtav up# 1. Remove React submodule
git submodule deinit spa
git rm spa
# 2. Create/clone your Vue SPA (consuming same REST API)
# 3. Add as submodule
git submodule add [your-vue-spa-url] spa
# 4. Rebuild
./mtav rebuild frontend
# 5. Done! Backend works unchanged
./mtav upcd api/
# Make changes
# Run tests: pytest
# Commit and push
git add .
git commit -m "Add feature"
git push
# Update orchestrator reference
cd ..
git add api
git commit -m "Update api submodule to latest"
git pushcd spa/
# Make changes
# Run tests: npm test
# Commit and push
git add .
git commit -m "Add component"
git push
# Update orchestrator reference
cd ..
git add spa
git commit -m "Update spa submodule to latest"
git pushCreate alternative backends that implement the same REST contract:
-
Rails API
rails new mtav-rails-api --api # Implement same endpoints: /api/auth/*, /api/families/, etc. # Same JWT authentication # Same project scoping logic
-
Laravel API (without Inertia)
laravel new mtav-laravel-api # Install Laravel Sanctum for JWT # Implement same REST endpoints
-
FastAPI
# Python alternative to Django # Implement same contract
Then swap: git submodule deinit api && git submodule add [new-api] api
Create alternative frontends that consume the same API:
-
Vue SPA
npm create vue@latest mtav-vue-spa # Install axios for API calls # Implement same pages/features # Point to same API: http://localhost:8000
-
Svelte SPA
npm create svelte@latest mtav-svelte-spa # Same approach
Then swap: git submodule deinit spa && git submodule add [new-spa] spa
- Main README:
README.md- Overview and quick start - Architecture Guide:
ARCHITECTURE.md- Detailed explanation of multi-repo pattern - Backend README:
api/README.md- Django API specifics - Frontend README:
spa/README.md- React SPA specifics
# 1. Start everything
./mtav up
# 2. Create superuser
./mtav backend createsuperuser
# 3. Open frontend
open http://localhost:3000
# 4. Login with superuser credentials
# 5. Verify API works
curl http://localhost:8000/api/projects/
# 6. Check tests
./mtav testgit submodule update --init --recursivechmod +x mtav./mtav down
./mtav fresh # Nuclear option: rebuild everythingCheck .env has: VITE_API_URL=http://localhost:8000
-
Week 1: Understand current Django + React setup
- Explore
api/code - Explore
spa/code - Run tests, make small changes
- Explore
-
Week 2: Try swapping frontend
- Create Vue version of one page
- Consume same API endpoints
- Compare React vs Vue
-
Week 3: Try swapping backend
- Create Rails version of one endpoint
- Implement same response format
- Compare Django vs Rails
-
Week 4: Mix and match
- Try Rails + React
- Try Django + Vue
- Understand the power of REST contracts
When ready to push to GitHub:
# 1. Create 3 repos on GitHub:
# - yourusername/mtav-api
# - yourusername/mtav-spa
# - yourusername/mtav-stack
# 2. Push backend
cd api/
git remote add origin https://github.com/yourusername/mtav-api.git
git push -u origin main
# 3. Push frontend
cd ../spa/
git remote add origin https://github.com/yourusername/mtav-spa.git
git push -u origin main
# 4. Update orchestrator .gitmodules
cd ..
# Edit .gitmodules to use GitHub URLs instead of ./api and ./spa
# 5. Push orchestrator
git add .gitmodules
git commit -m "Update submodule URLs for GitHub"
git remote add origin https://github.com/yourusername/mtav-stack.git
git push -u origin mainYou now have a fully decoupled Django + React application that:
✅ Works exactly like the Laravel/Inertia version (from user perspective)
✅ Can swap backend independently (Django → Rails → Laravel → FastAPI)
✅ Can swap frontend independently (React → Vue → Svelte → Angular)
✅ Has unified development experience via ./mtav script
✅ Uses Docker for portability
✅ Has comprehensive tests
✅ Is properly structured with 3 git repositories
Perfect for learning multiple frameworks while maintaining the same familiar domain model!