feat: complete monorepo structure with frontend and shared resources

- Add complete backend/ directory with full Django application
- Add frontend/ directory with Vite + TypeScript setup ready for Next.js
- Add comprehensive shared/ directory with:
  - Complete documentation and memory-bank archives
  - Media files and avatars (letters, park/ride images)
  - Deployment scripts and automation tools
  - Shared types and utilities
- Add architecture/ directory with migration guides
- Configure pnpm workspace for monorepo development
- Update .gitignore to exclude .django_tailwind_cli/ build artifacts
- Preserve all historical documentation in shared/docs/memory-bank/
- Set up proper structure for full-stack development with shared resources
This commit is contained in:
pacnpal
2025-08-23 18:40:07 -04:00
parent b0e0678590
commit d504d41de2
762 changed files with 142636 additions and 0 deletions

View File

@@ -0,0 +1,201 @@
# Development Workflow
## Git Workflow
### Branch Strategy
1. Main Branches
- `main` - Production code
- `develop` - Integration branch
2. Feature Branches
- Format: `feature/description`
- Branch from: `develop`
- Merge to: `develop`
3. Bugfix Branches
- Format: `bugfix/description`
- Branch from: `develop`
- Merge to: `develop`
4. Hotfix Branches
- Format: `hotfix/description`
- Branch from: `main`
- Merge to: `main` and `develop`
### Commit Guidelines
1. Format
```
type(scope): description
[optional body]
[optional footer]
```
2. Types
- feat: New feature
- fix: Bug fix
- docs: Documentation
- style: Formatting
- refactor: Code restructure
- test: Testing
- chore: Maintenance
3. Rules
- Present tense verbs
- Concise descriptions
- Reference issues
- Document breaking changes
## Development Process
### 1. Feature Development
1. Planning
- Technical specification
- Component design
- Database impact
- Test strategy
2. Implementation
- Create feature branch
- Write tests first
- Implement feature
- Update documentation
3. Review
- Self-review checklist
- Peer code review
- Update per feedback
- Final verification
### 2. Testing Requirements
#### Unit Tests
```python
# Required for all new code
class TestFeature(TestCase):
def setUp(self):
# Setup test data
def test_functionality(self):
# Test core functionality
def test_edge_cases(self):
# Test edge cases
```
#### Integration Tests
- API endpoints
- User workflows
- System integration
- Error handling
#### Coverage Requirements
- Minimum 80% coverage
- Critical paths 100%
- Edge case handling
- Error scenarios
### 3. Code Quality
#### Linting
- Python: flake8
- JavaScript: eslint
- CSS: stylelint
- Templates: djlint
#### Type Checking
- Python: mypy
- JavaScript: TypeScript
#### Documentation
- Code comments
- Docstrings
- README updates
- API documentation
## Deployment Process
### 1. Pre-deployment
- Version bump
- Changelog update
- Documentation review
- Test verification
### 2. Staging Deployment
- Database migrations
- Static file collection
- Smoke tests
- Performance check
### 3. Production Deployment
- Backup database
- Apply migrations
- Update static files
- Health checks
### 4. Post-deployment
- Monitor errors
- Performance metrics
- User feedback
- Rollback plan
## Review Process
### 1. Code Review
- Style compliance
- Test coverage
- Documentation
- Performance impact
### 2. Architecture Review
- Design patterns
- Scalability
- Security
- Maintainability
### 3. Security Review
- Authentication
- Authorization
- Data protection
- Input validation
## Quality Assurance
### 1. Testing Strategy
- Unit testing
- Integration testing
- End-to-end testing
- Performance testing
### 2. Performance Standards
- Page load times
- Database queries
- API response times
- Resource usage
### 3. Security Standards
- Authentication
- Authorization
- Data encryption
- Input validation
## Monitoring and Maintenance
### 1. Error Tracking
- Exception monitoring
- Log analysis
- User reports
- Performance alerts
### 2. Performance Monitoring
- Response times
- Resource usage
- Database performance
- Cache effectiveness
### 3. User Feedback
- Bug reports
- Feature requests
- Performance issues
- UX feedback

View File

@@ -0,0 +1,39 @@
## Model Migration Protocol for History Tracking
### Implementation Steps
1. **Base Model Setup**
```python
# core/models.py
import pghistory
class HistoricalModel(models.Model):
class Meta:
abstract = True
@pghistory.track(pghistory.Snapshot())
def save(self, *args, **kwargs):
return super().save(*args, **kwargs)
```
2. **Concrete Model Implementation**
```python
# parks/models.py
class Park(HistoricalModel):
@pghistory.track(
pghistory.Snapshot('park.create'),
pghistory.AfterUpdate('park.update'),
pghistory.BeforeDelete('park.delete')
)
class Meta:
# Existing model fields and configuration
```
3. **Migration Generation**
```bash
./manage.py makemigrations --name add_pghistory_tracking
```
### Quality Assurance
1. Verify historical events table creation
2. Test event triggering for CRUD operations
3. Validate context metadata capture

View File

@@ -0,0 +1,31 @@
## Updated Moderation Workflow with django-pghistory
### Submission Lifecycle
1. **Change Proposal**
- Creates `pending` pghistory event with metadata:
```python
pghistory.track(
pghistory.Snapshot('submission.pending'),
status='pending'
)
```
2. **Approval Process**
- Merges event into main history:
```python
event.pgh_label = 'approved_change'
event.pgh_context['approver'] = request.user
```
3. **Rejection Handling**
- Preserves event with rejection context:
```python
event.pgh_label = 'rejected_change'
event.pgh_context['reason'] = rejection_reason
```
### Moderation Admin Integration
```python
# moderation/admin.py
@admin.register(pghistory.models.Event)
class HistoryAdmin(admin.ModelAdmin):
list_display = ('pgh_label', 'pgh_created_at', 'content_object')
readonly_fields = ('pgh_data', 'pgh_context')