Table of Contents
Blueberry IDP Repository Structure Analysis and Recommendations
Executive Summary
This document provides a comprehensive analysis of the Blueberry IDP repository structure and actionable recommendations for improvement. The repository shows good internal organization within major components but lacks cohesion at the root level, with mixed concerns and inconsistent conventions.
Current Structure Analysis
1. Overall Directory Organization
Current State:
- Mixed concerns at root level (frontend tooling, backend code, infrastructure)
- Multiple configuration files scattered at root
- Temporary directories (tmp/
, credentials/
) at root level
- Two separate Makefiles (Makefile
and Makefile.app
)
Issues Identified:
- No clear separation between different configuration types
- Frontend tooling (npm/tailwind) mixed with backend at root
- Inconsistent file naming conventions
2. Python Package Structure (blueberry/)
Areas for Improvement:
- Missing utils/
or common/
module for shared utilities
- Templates and static files within Python package (deployment consideration)
- Some overlap between infrastructure/
and services/
responsibilities
4. Testing Structure (tests/)
Current Organization:
- Missing fixtures/
directory for test data
- No e2e/
directory for end-to-end tests
5. Configuration Management
Issues:
- Configuration files scattered across root directory
- Multiple types of config mixed together
- Both .yaml
and .yml
extensions used
- No environment-specific config structure
Recommended Improvements
1. Root Directory Reorganization
blueberry/
├── config/ # All configuration files
│ ├── app_config.yaml
│ ├── repos.yaml
│ └── .env.example
├── scripts/ # All scripts and utilities
│ ├── setup.sh
│ └── deploy.sh
├── frontend/ # Frontend assets and tooling
│ ├── package.json
│ ├── tailwind.config.js
│ └── static/
├── deployment/ # Deployment artifacts
│ ├── charts/ # Helm charts
│ ├── argocd-apps/ # ArgoCD applications
│ └── docker/ # Dockerfiles
└── infrastructure/ # IaC code
└── terraform/ # Current blueberry-terraform/
2. Configuration Consolidation
Create a structured configuration directory:
config/
├── base/ # Base configuration
│ ├── app.yaml
│ └── repos.yaml
├── dev/ # Development overrides
│ └── app.yaml
├── prod/ # Production overrides
│ └── app.yaml
└── .env.example # Environment variable template
3. Python Package Improvements
blueberry/
├── common/ # Shared utilities and helpers
│ ├── __init__.py
│ ├── exceptions.py
│ └── utils.py
├── api/ # API endpoints
├── core/ # Core business logic
├── services/ # External service integrations
├── models/ # Data models
├── stores/ # Data access layer
└── web/ # Web-specific resources
├── templates/
└── static/
4. Standardization Actions
- File Extensions: Replace all
.yml
with.yaml
for consistency - Naming Conventions:
- Python: Use underscores (snake_case)
- Terraform: Consider migrating to underscores for consistency
- Kubernetes/Helm: Use hyphens (kebab-case)
- Missing Files: Add standard files
CONTRIBUTING.md
CHANGELOG.md
.gitignore
entries for temporary directories
5. Documentation Structure
docs/
├── architecture/ # System design and architecture
│ ├── overview.md
│ └── decisions/ # Architecture Decision Records (ADRs)
├── api/ # API documentation
│ ├── openapi.yaml
│ └── endpoints.md
├── deployment/ # Deployment guides
│ ├── helm.md
│ └── argocd.md
├── development/ # Developer guides
│ ├── setup.md
│ ├── contributing.md
│ └── testing.md
└── operations/ # Operations runbooks
├── monitoring.md
└── troubleshooting.md
6. Makefile Consolidation
- Merge
Makefile.app
into mainMakefile
- Use target namespaces for clarity:
```makefile
# Application targets
app.install:
app.test:
app.run:
# Terraform targets
tf.plan:
tf.apply:
# Docker targets
docker.build:
docker.push:
```
7. Frontend Separation
Move all frontend-related files to a dedicated directory:
frontend/
├── package.json
├── package-lock.json
├── tailwind.config.js
├── postcss.config.js
├── node_modules/
└── src/
├── css/
└── js/
Implementation Priority
Phase 1: Quick Wins (1-2 days)
- Create
config/
directory and move configuration files - Standardize file extensions to
.yaml
- Add
.gitignore
for temporary directories - Create
scripts/
directory and move scripts - Add README.md to major directories
Phase 2: Structural Changes (3-5 days)
- Reorganize root directory structure
- Separate frontend assets
- Consolidate Makefiles
- Add missing standard files
- Improve test structure
Phase 3: Documentation & Standards (1 week)
- Reorganize documentation
- Create contribution guidelines
- Document naming conventions
- Add API documentation
- Create ADRs for major decisions
Benefits of These Changes
- Improved Developer Experience: Clear structure makes it easier for new developers to understand the codebase
- Better Separation of Concerns: Frontend, backend, and infrastructure clearly separated
- Consistent Conventions: Standardized naming and file extensions reduce cognitive load
- Easier Deployment: Deployment artifacts isolated from application code
- Better Maintainability: Logical organization makes finding and updating code easier
Notes
- The current Makefile has been updated with an
import-wif
target for Workload Identity Federation - Project ID is
development-454916
for Google Cloud resources - Consider using tools like
pre-commit
to enforce standards automatically