# Development Workflow Comprehensive guide to daily development processes, Git workflow, and team collaboration for the ThrillWiki monorepo. ## Overview This document outlines the development workflow for the ThrillWiki Django + Vue.js monorepo. Following these practices ensures consistent code quality, smooth collaboration, and reliable deployments. ## ๐Ÿ—๏ธ Project Structure ``` thrillwiki-monorepo/ โ”œโ”€โ”€ backend/ # Django REST API โ”œโ”€โ”€ frontend/ # Vue.js SPA โ”œโ”€โ”€ shared/ # Shared resources and scripts โ”œโ”€โ”€ architecture/ # Architecture documentation โ””โ”€โ”€ profiles/ # Development profiles ``` ## ๐Ÿš€ Daily Development Workflow ### 1. Environment Setup #### First Time Setup ```bash # Clone the repository git clone cd thrillwiki-monorepo # Run the automated setup script ./shared/scripts/dev/setup-dev.sh # Or set up manually cd backend && uv sync && cd .. pnpm install ``` #### Daily Setup ```bash # Start all development servers ./shared/scripts/dev/start-all.sh # Or start individually pnpm run dev:backend # Django on :8000 pnpm run dev:frontend # Vue.js on :5174 ``` ### 2. Development Process #### Feature Development 1. **Create a feature branch** ```bash git checkout -b feature/your-feature-name ``` 2. **Make your changes** - Follow the coding standards for your language - Write tests for new functionality - Update documentation as needed 3. **Test your changes** ```bash # Backend tests cd backend && uv run manage.py test # Frontend tests cd frontend && pnpm test:unit cd frontend && pnpm test:e2e # Full test suite pnpm run test ``` 4. **Code quality checks** ```bash # Backend cd backend && uv run black . && uv run flake8 . # Frontend cd frontend && pnpm lint && pnpm type-check ``` #### Bug Fixes 1. **Create a bug fix branch** ```bash git checkout -b bugfix/issue-description ``` 2. **Reproduce the issue** - Add test cases that reproduce the bug - Verify the fix resolves the issue 3. **Implement the fix** - Keep changes minimal and focused - Ensure no regressions ### 3. Code Review Process #### Before Submitting - [ ] All tests pass - [ ] Code follows style guidelines - [ ] Documentation updated - [ ] No linting errors - [ ] TypeScript types correct (frontend) - [ ] Database migrations created (backend) #### Pull Request Process 1. **Create Pull Request** - Use descriptive title - Fill out PR template - Link related issues - Add screenshots for UI changes 2. **Code Review** - At least one approval required - Address all review comments - Rebase and resolve conflicts 3. **Merge Process** - Use "Squash and merge" for feature branches - Use "Rebase and merge" for maintenance branches - Delete branch after merge ## ๐Ÿ”„ Git Workflow ### Branch Naming Convention ``` feature/feature-name # New features bugfix/issue-description # Bug fixes hotfix/critical-issue # Critical production fixes refactor/component-name # Code refactoring docs/update-documentation # Documentation updates test/add-test-coverage # Test improvements ``` ### Commit Message Format ``` type(scope): description [optional body] [optional footer] ``` **Types:** - `feat` - New feature - `fix` - Bug fix - `docs` - Documentation - `style` - Code style changes - `refactor` - Code refactoring - `test` - Adding tests - `chore` - Maintenance tasks **Examples:** ``` feat: add park search functionality fix: resolve ride detail page crash docs: update API documentation refactor: simplify park service layer ``` ### Git Workflow #### Feature Development ```bash # Start from main git checkout main git pull origin main # Create feature branch git checkout -b feature/new-park-search # Make changes and commit git add . git commit -m "feat: implement park search with filters" # Push and create PR git push origin feature/new-park-search ``` #### Handling Conflicts ```bash # Update your branch with latest main git fetch origin git rebase origin/main # Resolve conflicts if any # Test your changes # Force push if needed git push --force-with-lease origin feature/new-park-search ``` ## ๐Ÿงช Testing Strategy ### Backend Testing #### Unit Tests ```bash cd backend # Run all tests uv run manage.py test # Run specific app tests uv run manage.py test apps.parks # Run with coverage uv run coverage run manage.py test uv run coverage report ``` #### Test Structure ``` backend/tests/ โ”œโ”€โ”€ test_models.py # Model tests โ”œโ”€โ”€ test_views.py # View tests โ”œโ”€โ”€ test_serializers.py # Serializer tests โ””โ”€โ”€ test_services.py # Service layer tests ``` ### Frontend Testing #### Unit Tests (Vitest) ```bash cd frontend # Run unit tests pnpm test:unit # Run with coverage pnpm test:unit --coverage # Watch mode for development pnpm test:unit --watch ``` #### End-to-End Tests (Playwright) ```bash cd frontend # Run E2E tests pnpm test:e2e # Run specific test pnpm test:e2e tests/park-search.spec.ts # Debug mode pnpm test:e2e --debug ``` #### Test Structure ``` frontend/src/__tests__/ โ”œโ”€โ”€ components/ # Component tests โ”œโ”€โ”€ views/ # Page tests โ”œโ”€โ”€ services/ # Service tests โ””โ”€โ”€ stores/ # Store tests ``` ### Test Coverage Requirements - **Backend:** Minimum 80% coverage - **Frontend:** Minimum 70% coverage - **Critical paths:** 90%+ coverage ## ๐Ÿ”ง Code Quality ### Backend Standards #### Python Code Style ```bash cd backend # Format code uv run black . # Check style uv run flake8 . # Sort imports uv run isort . ``` #### Django Best Practices - Use Django REST Framework best practices - Implement proper error handling - Add database indexes for performance - Use select_related and prefetch_related for optimization ### Frontend Standards #### Vue.js Best Practices ```bash cd frontend # Lint code pnpm lint # Type checking pnpm type-check # Format code pnpm format ``` #### Code Organization - Use Composition API with `