fast-clean-architecture 1.0.0__tar.gz → 1.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/.gitignore +3 -3
- fast_clean_architecture-1.1.2/.pre-commit-config.yaml +105 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/PKG-INFO +131 -64
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/README.md +126 -53
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2/docs}/CHANGELOG.md +60 -2
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2/docs}/CONTRIBUTING.md +63 -1
- fast_clean_architecture-1.1.2/docs/DEPENDENCY_INJECTION_GUIDE.md +311 -0
- fast_clean_architecture-1.1.2/docs/ENHANCED_TYPE_SAFETY.md +353 -0
- {fast_clean_architecture-1.0.0/examples → fast_clean_architecture-1.1.2/docs}/getting-started.md +34 -6
- fast_clean_architecture-1.1.2/docs/template_validation_guide.md +408 -0
- fast_clean_architecture-1.0.0/examples/components-spec.yaml → fast_clean_architecture-1.1.2/examples/components_spec.yaml +1 -1
- fast_clean_architecture-1.1.2/examples/error_handling_examples.py +283 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/__init__.py +5 -6
- fast_clean_architecture-1.1.2/fast_clean_architecture/analytics.py +260 -0
- fast_clean_architecture-1.1.2/fast_clean_architecture/cli.py +997 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/config.py +47 -23
- fast_clean_architecture-1.1.2/fast_clean_architecture/error_tracking.py +201 -0
- fast_clean_architecture-1.1.2/fast_clean_architecture/exceptions.py +483 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/generators/__init__.py +11 -1
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/generators/component_generator.py +407 -103
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/generators/config_updater.py +186 -38
- fast_clean_architecture-1.1.2/fast_clean_architecture/generators/generator_factory.py +223 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/generators/package_generator.py +9 -7
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/generators/template_validator.py +109 -9
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/generators/validation_config.py +5 -3
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/generators/validation_metrics.py +10 -6
- fast_clean_architecture-1.1.2/fast_clean_architecture/health.py +169 -0
- fast_clean_architecture-1.1.2/fast_clean_architecture/logging_config.py +52 -0
- fast_clean_architecture-1.1.2/fast_clean_architecture/metrics.py +108 -0
- fast_clean_architecture-1.1.2/fast_clean_architecture/protocols.py +406 -0
- fast_clean_architecture-1.1.2/fast_clean_architecture/templates/external.py.j2 +138 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/utils.py +50 -31
- fast_clean_architecture-1.1.2/fast_clean_architecture/validation.py +302 -0
- fast_clean_architecture-1.1.2/fca_config.yaml +260 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/poetry.lock +211 -120
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/pyproject.toml +49 -16
- fast_clean_architecture-1.1.2/requirements-dev.txt +650 -0
- fast_clean_architecture-1.1.2/requirements.txt +275 -0
- fast_clean_architecture-1.1.2/systems/__init__.py +3 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/conftest.py +3 -3
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_cli.py +3 -2
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_component_generator.py +7 -3
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_config.py +8 -7
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_cross_platform_compatibility.py +9 -7
- fast_clean_architecture-1.1.2/tests/test_enhanced_type_safety.py +400 -0
- fast_clean_architecture-1.1.2/tests/test_generator_factory.py +321 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_integration.py +13 -11
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_security.py +24 -13
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_symlink_security.py +3 -3
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_utils.py +12 -11
- fast_clean_architecture-1.1.2/update-requirements.sh +38 -0
- fast_clean_architecture-1.0.0/fast_clean_architecture/cli.py +0 -480
- fast_clean_architecture-1.0.0/fast_clean_architecture/exceptions.py +0 -63
- fast_clean_architecture-1.0.0/fast_clean_architecture/templates/external.py.j2 +0 -61
- fast_clean_architecture-1.0.0/test_security_enhancements.py +0 -149
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/LICENSE +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2/docs}/CODE_OF_CONDUCT.md +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2/docs}/TEMPLATE_VALIDATION_REFACTOR.md +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/__init__.py +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/__init__.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/api.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/command.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/entity.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/infrastructure_repository.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/model.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/query.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/repository.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/schemas.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/service.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/fast_clean_architecture/templates/value_object.py.j2 +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/__init__.py +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_template_security.py +0 -0
- {fast_clean_architecture-1.0.0 → fast_clean_architecture-1.1.2}/tests/test_template_validation.py +0 -0
@@ -224,7 +224,7 @@ $RECYCLE.BIN/
|
|
224
224
|
# Project-specific
|
225
225
|
# Configuration backups
|
226
226
|
*.backup.*
|
227
|
-
|
227
|
+
fca_config.yaml.backup.*
|
228
228
|
|
229
229
|
# Generated systems directory (if not tracking)
|
230
230
|
# systems/
|
@@ -410,7 +410,7 @@ override.toml
|
|
410
410
|
# systems/
|
411
411
|
|
412
412
|
# Configuration file backups (already covered above but being explicit)
|
413
|
-
|
413
|
+
fca_config.yaml.backup*
|
414
414
|
|
415
415
|
# Any local test configurations
|
416
416
|
test-config.yaml
|
@@ -946,12 +946,12 @@ fastlane/readme.md
|
|
946
946
|
# Temporary files created by R markdown
|
947
947
|
*.utf8.md
|
948
948
|
*.knit.md
|
949
|
+
*_prompt.md
|
949
950
|
|
950
951
|
# R Environment Variables
|
951
952
|
.Renviron
|
952
953
|
|
953
954
|
# pkgdown site
|
954
|
-
docs/
|
955
955
|
|
956
956
|
# translation temp files
|
957
957
|
po/*~
|
@@ -0,0 +1,105 @@
|
|
1
|
+
repos:
|
2
|
+
# Dependency Management (Current)
|
3
|
+
- repo: local
|
4
|
+
hooks:
|
5
|
+
- id: export-requirements
|
6
|
+
name: Export requirements.txt
|
7
|
+
entry: poetry export -f requirements.txt --output requirements.txt
|
8
|
+
language: system
|
9
|
+
files: pyproject.toml
|
10
|
+
pass_filenames: false
|
11
|
+
stages: [commit]
|
12
|
+
- id: export-dev-requirements
|
13
|
+
name: Export dev requirements.txt
|
14
|
+
entry: poetry export -f requirements.txt --output requirements-dev.txt --extras dev
|
15
|
+
language: system
|
16
|
+
files: pyproject.toml
|
17
|
+
pass_filenames: false
|
18
|
+
stages: [commit]
|
19
|
+
|
20
|
+
# Code Formatting
|
21
|
+
- repo: https://github.com/psf/black
|
22
|
+
rev: 23.12.1
|
23
|
+
hooks:
|
24
|
+
- id: black
|
25
|
+
name: Format code with Black
|
26
|
+
language_version: python3
|
27
|
+
types: [python]
|
28
|
+
|
29
|
+
- repo: https://github.com/pycqa/isort
|
30
|
+
rev: 5.13.2
|
31
|
+
hooks:
|
32
|
+
- id: isort
|
33
|
+
name: Sort imports with isort
|
34
|
+
args: ["--profile", "black"]
|
35
|
+
types: [python]
|
36
|
+
|
37
|
+
# Code Quality & Linting
|
38
|
+
- repo: https://github.com/pycqa/flake8
|
39
|
+
rev: 7.0.0
|
40
|
+
hooks:
|
41
|
+
- id: flake8
|
42
|
+
name: Lint with flake8
|
43
|
+
args: ["--max-line-length=88", "--extend-ignore=E203,W503"]
|
44
|
+
types: [python]
|
45
|
+
|
46
|
+
# Type Checking
|
47
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
48
|
+
rev: v1.8.0
|
49
|
+
hooks:
|
50
|
+
- id: mypy
|
51
|
+
name: Type check with mypy
|
52
|
+
additional_dependencies: [types-all]
|
53
|
+
args: ["--ignore-missing-imports"]
|
54
|
+
types: [python]
|
55
|
+
|
56
|
+
# Security Scanning
|
57
|
+
- repo: https://github.com/pycqa/bandit
|
58
|
+
rev: 1.7.5
|
59
|
+
hooks:
|
60
|
+
- id: bandit
|
61
|
+
name: Security scan with bandit
|
62
|
+
args: ["-r", "fast_clean_architecture"]
|
63
|
+
types: [python]
|
64
|
+
|
65
|
+
# General Code Quality
|
66
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
67
|
+
rev: v4.5.0
|
68
|
+
hooks:
|
69
|
+
- id: trailing-whitespace
|
70
|
+
name: Remove trailing whitespace
|
71
|
+
- id: end-of-file-fixer
|
72
|
+
name: Fix end of files
|
73
|
+
- id: check-yaml
|
74
|
+
name: Check YAML syntax
|
75
|
+
- id: check-toml
|
76
|
+
name: Check TOML syntax
|
77
|
+
- id: check-json
|
78
|
+
name: Check JSON syntax
|
79
|
+
- id: check-merge-conflict
|
80
|
+
name: Check for merge conflicts
|
81
|
+
- id: check-added-large-files
|
82
|
+
name: Check for large files
|
83
|
+
args: ['--maxkb=500']
|
84
|
+
- id: debug-statements
|
85
|
+
name: Check for debug statements
|
86
|
+
types: [python]
|
87
|
+
|
88
|
+
# Documentation
|
89
|
+
- repo: https://github.com/pycqa/pydocstyle
|
90
|
+
rev: 6.3.0
|
91
|
+
hooks:
|
92
|
+
- id: pydocstyle
|
93
|
+
name: Check docstring style
|
94
|
+
args: ["--convention=google"]
|
95
|
+
types: [python]
|
96
|
+
|
97
|
+
# Dependency Security
|
98
|
+
- repo: local
|
99
|
+
hooks:
|
100
|
+
- id: safety-check
|
101
|
+
name: Check dependencies for security vulnerabilities
|
102
|
+
entry: poetry run safety check
|
103
|
+
language: system
|
104
|
+
pass_filenames: false
|
105
|
+
stages: [commit]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fast-clean-architecture
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.1.2
|
4
4
|
Summary: CLI tool for scaffolding clean architecture in FastAPI projects
|
5
5
|
Project-URL: Homepage, https://github.com/alden-technologies/fast-clean-architecture
|
6
6
|
Project-URL: Repository, https://github.com/alden-technologies/fast-clean-architecture
|
@@ -17,33 +17,27 @@ Classifier: Intended Audience :: Developers
|
|
17
17
|
Classifier: License :: OSI Approved :: MIT License
|
18
18
|
Classifier: Operating System :: OS Independent
|
19
19
|
Classifier: Programming Language :: Python :: 3
|
20
|
-
Classifier: Programming Language :: Python :: 3.8
|
21
20
|
Classifier: Programming Language :: Python :: 3.9
|
22
21
|
Classifier: Programming Language :: Python :: 3.10
|
23
22
|
Classifier: Programming Language :: Python :: 3.11
|
24
23
|
Classifier: Programming Language :: Python :: 3.12
|
25
24
|
Classifier: Topic :: Software Development :: Code Generators
|
26
25
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
27
|
-
Requires-Python: >=3.
|
26
|
+
Requires-Python: >=3.9
|
28
27
|
Requires-Dist: jinja2<4.0.0,>=3.1.0
|
29
28
|
Requires-Dist: pathlib-mate<2.0.0,>=1.0.0
|
29
|
+
Requires-Dist: portalocker<3.0.0,>=2.0.0
|
30
|
+
Requires-Dist: psutil>=5.9.0
|
30
31
|
Requires-Dist: pydantic<3.0.0,>=2.0.0
|
31
32
|
Requires-Dist: pyyaml<7.0.0,>=6.0
|
32
33
|
Requires-Dist: rich<14.0.0,>=13.0.0
|
34
|
+
Requires-Dist: structlog<24.0.0,>=23.0.0
|
33
35
|
Requires-Dist: typer[all]<1.0.0,>=0.9.0
|
34
|
-
Provides-Extra: dev
|
35
|
-
Requires-Dist: bandit<2.0.0,>=1.7.0; extra == 'dev'
|
36
|
-
Requires-Dist: black<24.0.0,>=23.0.0; extra == 'dev'
|
37
|
-
Requires-Dist: isort<6.0.0,>=5.0.0; extra == 'dev'
|
38
|
-
Requires-Dist: mypy<2.0.0,>=1.0.0; extra == 'dev'
|
39
|
-
Requires-Dist: pytest-cov<5.0.0,>=4.0.0; extra == 'dev'
|
40
|
-
Requires-Dist: pytest<8.0.0,>=7.0.0; extra == 'dev'
|
41
|
-
Requires-Dist: safety<3.0.0,>=2.0.0; extra == 'dev'
|
42
36
|
Description-Content-Type: text/markdown
|
43
37
|
|
44
38
|
# Fast Clean Architecture
|
45
39
|
|
46
|
-
[](https://www.python.org/downloads/)
|
47
41
|
[](https://opensource.org/licenses/MIT)
|
48
42
|
[](https://github.com/psf/black)
|
49
43
|
|
@@ -56,7 +50,10 @@ A powerful CLI tool for scaffolding clean architecture in FastAPI projects. Gene
|
|
56
50
|
- **Code Generation**: Automated scaffolding for entities, repositories, services, and more
|
57
51
|
- **Template System**: Customizable Jinja2 templates for code generation
|
58
52
|
- **Type Safety**: Full type hints and Pydantic validation
|
59
|
-
- **Modern Python**: Built for Python 3.
|
53
|
+
- **Modern Python**: Built for Python 3.9+ with async/await support
|
54
|
+
- **Analytics & Monitoring**: Built-in usage analytics, error tracking, and health monitoring
|
55
|
+
- **Security Features**: Template validation, input sanitization, and secure file operations
|
56
|
+
- **Batch Operations**: Create multiple components from YAML specifications
|
60
57
|
- **CLI Interface**: Intuitive command-line interface with rich output
|
61
58
|
- **Configuration Management**: YAML-based project configuration with versioning
|
62
59
|
|
@@ -74,37 +71,7 @@ pip install fast-clean-architecture
|
|
74
71
|
poetry add fast-clean-architecture
|
75
72
|
```
|
76
73
|
|
77
|
-
|
78
|
-
|
79
|
-
#### Using pip
|
80
|
-
```bash
|
81
|
-
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
82
|
-
cd fast-clean-architecture
|
83
|
-
pip install -e .
|
84
|
-
```
|
85
|
-
|
86
|
-
#### Using Poetry
|
87
|
-
```bash
|
88
|
-
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
89
|
-
cd fast-clean-architecture
|
90
|
-
poetry install
|
91
|
-
```
|
92
|
-
|
93
|
-
### Development Installation
|
94
|
-
|
95
|
-
#### Using pip
|
96
|
-
```bash
|
97
|
-
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
98
|
-
cd fast-clean-architecture
|
99
|
-
pip install -e ".[dev]"
|
100
|
-
```
|
101
|
-
|
102
|
-
#### Using Poetry
|
103
|
-
```bash
|
104
|
-
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
105
|
-
cd fast-clean-architecture
|
106
|
-
poetry install --with dev
|
107
|
-
```
|
74
|
+
**Note**: This project uses Poetry for dependency management. The `requirements.txt` and `requirements-dev.txt` files are provided for convenience and compatibility with pip-based workflows.
|
108
75
|
|
109
76
|
## 🏗️ Architecture Overview
|
110
77
|
|
@@ -130,14 +97,14 @@ Fast Clean Architecture follows the clean architecture pattern with these layers
|
|
130
97
|
│ └── 📁 presentation/ # API layer
|
131
98
|
│ ├── 📁 api/ # FastAPI routers
|
132
99
|
│ └── 📁 schemas/ # Pydantic schemas
|
133
|
-
└── 📄
|
100
|
+
└── 📄 fca_config.yaml # Project configuration
|
134
101
|
```
|
135
102
|
|
136
103
|
## 📋 Prerequisites
|
137
104
|
|
138
105
|
**Important**: This tool is designed to scaffold clean architecture components for FastAPI projects. You should have:
|
139
106
|
|
140
|
-
- **Python 3.
|
107
|
+
- **Python 3.9+** installed on your system
|
141
108
|
- **Basic understanding of FastAPI** and web API development
|
142
109
|
- **Familiarity with clean architecture principles** (recommended but not required)
|
143
110
|
- **A new or existing directory** where you want to create your FastAPI project structure
|
@@ -306,24 +273,52 @@ Your API will be available at `http://localhost:8000` with automatic documentati
|
|
306
273
|
| **Presentation** | `api` | FastAPI routers and endpoints |
|
307
274
|
| | `schemas` | Pydantic request/response schemas |
|
308
275
|
|
309
|
-
### CLI
|
276
|
+
### CLI Commands
|
277
|
+
|
278
|
+
#### Core Commands
|
279
|
+
```bash
|
280
|
+
# Project initialization
|
281
|
+
fca-scaffold init # Initialize new project
|
282
|
+
fca-scaffold create-system-context # Create system (bounded context)
|
283
|
+
fca-scaffold create-module # Create module within system
|
284
|
+
fca-scaffold create-component # Create individual components
|
285
|
+
```
|
286
|
+
|
287
|
+
#### Batch Operations
|
288
|
+
```bash
|
289
|
+
# Create multiple components from YAML specification
|
290
|
+
fca-scaffold batch-create components_spec.yaml
|
291
|
+
fca-scaffold batch-create my-spec.yaml --dry-run # Preview only
|
292
|
+
```
|
310
293
|
|
294
|
+
#### Project Management
|
311
295
|
```bash
|
312
|
-
#
|
313
|
-
fca-scaffold
|
314
|
-
fca-scaffold
|
315
|
-
fca-scaffold
|
316
|
-
fca-scaffold
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
296
|
+
# Project status and configuration
|
297
|
+
fca-scaffold status # Show project overview
|
298
|
+
fca-scaffold config show # Display configuration
|
299
|
+
fca-scaffold config validate # Validate configuration
|
300
|
+
fca-scaffold system-status # Show system health and analytics
|
301
|
+
```
|
302
|
+
|
303
|
+
#### Help and Information
|
304
|
+
```bash
|
305
|
+
# Get help and version info
|
306
|
+
fca-scaffold version # Show version information
|
307
|
+
fca-scaffold --help # General help
|
308
|
+
```
|
309
|
+
|
310
|
+
#### Global Options
|
311
|
+
```bash
|
312
|
+
# Available for most commands
|
313
|
+
--dry-run # Preview changes without writing files
|
314
|
+
--force # Overwrite existing files
|
315
|
+
--verbose # Detailed output
|
316
|
+
--config # Specify custom config file
|
322
317
|
```
|
323
318
|
|
324
319
|
### Configuration File
|
325
320
|
|
326
|
-
The `
|
321
|
+
The `fca_config.yaml` file tracks your project structure:
|
327
322
|
|
328
323
|
```yaml
|
329
324
|
project:
|
@@ -352,6 +347,71 @@ project:
|
|
352
347
|
api: ["user"]
|
353
348
|
```
|
354
349
|
|
350
|
+
## 📊 Batch Component Creation
|
351
|
+
|
352
|
+
### YAML Specification Format
|
353
|
+
|
354
|
+
Create multiple components efficiently using YAML specifications:
|
355
|
+
|
356
|
+
```yaml
|
357
|
+
# components_spec.yaml
|
358
|
+
systems:
|
359
|
+
- name: admin
|
360
|
+
description: "Admin management system"
|
361
|
+
modules:
|
362
|
+
- name: authentication
|
363
|
+
description: "Admin authentication module"
|
364
|
+
components:
|
365
|
+
domain:
|
366
|
+
entities: [AdminUser, AdminRole]
|
367
|
+
value_objects: [AdminEmail, AdminPassword]
|
368
|
+
repositories: [AdminUserRepository]
|
369
|
+
application:
|
370
|
+
services: [AdminAuthService]
|
371
|
+
commands: [CreateAdminUser, UpdateAdminUser]
|
372
|
+
queries: [GetAdminUser, ListAdminUsers]
|
373
|
+
infrastructure:
|
374
|
+
repositories: [AdminUserRepository]
|
375
|
+
models: [AdminUserModel]
|
376
|
+
external: [AdminEmailService]
|
377
|
+
presentation:
|
378
|
+
api: [AdminAuthRouter]
|
379
|
+
schemas: [AdminUserSchema, AdminAuthSchema]
|
380
|
+
```
|
381
|
+
|
382
|
+
### Usage
|
383
|
+
|
384
|
+
```bash
|
385
|
+
# Create all components from specification
|
386
|
+
fca-scaffold batch-create components_spec.yaml
|
387
|
+
|
388
|
+
# Preview what would be created
|
389
|
+
fca-scaffold batch-create components_spec.yaml --dry-run
|
390
|
+
|
391
|
+
# Force overwrite existing files
|
392
|
+
fca-scaffold batch-create components_spec.yaml --force
|
393
|
+
```
|
394
|
+
|
395
|
+
## 📊 System Monitoring
|
396
|
+
|
397
|
+
### Health and Analytics
|
398
|
+
|
399
|
+
Fast Clean Architecture includes built-in monitoring capabilities:
|
400
|
+
|
401
|
+
```bash
|
402
|
+
# View system health and usage analytics
|
403
|
+
fca-scaffold system-status
|
404
|
+
|
405
|
+
# Detailed system information
|
406
|
+
fca-scaffold system-status --verbose
|
407
|
+
```
|
408
|
+
|
409
|
+
**Features:**
|
410
|
+
- **Usage Analytics**: Track command usage and component creation patterns
|
411
|
+
- **Error Tracking**: Monitor and log errors with detailed context
|
412
|
+
- **Health Monitoring**: System resource usage and performance metrics
|
413
|
+
- **Security Monitoring**: Template validation and input sanitization tracking
|
414
|
+
|
355
415
|
## 🎨 Customization
|
356
416
|
|
357
417
|
### Custom Templates
|
@@ -423,9 +483,7 @@ pytest -v
|
|
423
483
|
```bash
|
424
484
|
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
425
485
|
cd fast-clean-architecture
|
426
|
-
|
427
|
-
source venv/bin/activate # On Windows: venv\Scripts\activate
|
428
|
-
pip install -e ".[dev]"
|
486
|
+
poetry install --with dev
|
429
487
|
```
|
430
488
|
|
431
489
|
### Code Quality
|
@@ -447,11 +505,20 @@ bandit -r fast_clean_architecture
|
|
447
505
|
safety check
|
448
506
|
```
|
449
507
|
|
508
|
+
### Security Updates
|
509
|
+
|
510
|
+
This project maintains up-to-date dependencies with security patches:
|
511
|
+
|
512
|
+
- **Black 24.3.0+**: Fixes CVE-2024-21503 (ReDoS vulnerability)
|
513
|
+
- **Pip 25.0+**: Fixes PVE-2025-75180 (malicious wheel execution)
|
514
|
+
- **Setuptools 78.1.1+**: Fixes CVE-2025-47273 (path traversal vulnerability)
|
515
|
+
|
516
|
+
All dependencies are pinned with SHA256 hashes for supply chain security.
|
517
|
+
|
450
518
|
### Pre-commit Hooks
|
451
519
|
|
452
520
|
```bash
|
453
|
-
|
454
|
-
pre-commit install
|
521
|
+
poetry run pre-commit install
|
455
522
|
```
|
456
523
|
|
457
524
|
## 📖 Examples
|
@@ -538,4 +605,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
538
605
|
|
539
606
|
---
|
540
607
|
|
541
|
-
**Made with ❤️ by [Alden Technologies](https://aldentechnologies.com)**
|
608
|
+
**Made with ❤️ by [Adegbenga Agoro](https://www.adegbengaagoro.co), [Founder of Alden Technologies](https://www.aldentechnologies.com)**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Fast Clean Architecture
|
2
2
|
|
3
|
-
[](https://www.python.org/downloads/)
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
5
5
|
[](https://github.com/psf/black)
|
6
6
|
|
@@ -13,7 +13,10 @@ A powerful CLI tool for scaffolding clean architecture in FastAPI projects. Gene
|
|
13
13
|
- **Code Generation**: Automated scaffolding for entities, repositories, services, and more
|
14
14
|
- **Template System**: Customizable Jinja2 templates for code generation
|
15
15
|
- **Type Safety**: Full type hints and Pydantic validation
|
16
|
-
- **Modern Python**: Built for Python 3.
|
16
|
+
- **Modern Python**: Built for Python 3.9+ with async/await support
|
17
|
+
- **Analytics & Monitoring**: Built-in usage analytics, error tracking, and health monitoring
|
18
|
+
- **Security Features**: Template validation, input sanitization, and secure file operations
|
19
|
+
- **Batch Operations**: Create multiple components from YAML specifications
|
17
20
|
- **CLI Interface**: Intuitive command-line interface with rich output
|
18
21
|
- **Configuration Management**: YAML-based project configuration with versioning
|
19
22
|
|
@@ -31,37 +34,7 @@ pip install fast-clean-architecture
|
|
31
34
|
poetry add fast-clean-architecture
|
32
35
|
```
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
#### Using pip
|
37
|
-
```bash
|
38
|
-
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
39
|
-
cd fast-clean-architecture
|
40
|
-
pip install -e .
|
41
|
-
```
|
42
|
-
|
43
|
-
#### Using Poetry
|
44
|
-
```bash
|
45
|
-
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
46
|
-
cd fast-clean-architecture
|
47
|
-
poetry install
|
48
|
-
```
|
49
|
-
|
50
|
-
### Development Installation
|
51
|
-
|
52
|
-
#### Using pip
|
53
|
-
```bash
|
54
|
-
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
55
|
-
cd fast-clean-architecture
|
56
|
-
pip install -e ".[dev]"
|
57
|
-
```
|
58
|
-
|
59
|
-
#### Using Poetry
|
60
|
-
```bash
|
61
|
-
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
62
|
-
cd fast-clean-architecture
|
63
|
-
poetry install --with dev
|
64
|
-
```
|
37
|
+
**Note**: This project uses Poetry for dependency management. The `requirements.txt` and `requirements-dev.txt` files are provided for convenience and compatibility with pip-based workflows.
|
65
38
|
|
66
39
|
## 🏗️ Architecture Overview
|
67
40
|
|
@@ -87,14 +60,14 @@ Fast Clean Architecture follows the clean architecture pattern with these layers
|
|
87
60
|
│ └── 📁 presentation/ # API layer
|
88
61
|
│ ├── 📁 api/ # FastAPI routers
|
89
62
|
│ └── 📁 schemas/ # Pydantic schemas
|
90
|
-
└── 📄
|
63
|
+
└── 📄 fca_config.yaml # Project configuration
|
91
64
|
```
|
92
65
|
|
93
66
|
## 📋 Prerequisites
|
94
67
|
|
95
68
|
**Important**: This tool is designed to scaffold clean architecture components for FastAPI projects. You should have:
|
96
69
|
|
97
|
-
- **Python 3.
|
70
|
+
- **Python 3.9+** installed on your system
|
98
71
|
- **Basic understanding of FastAPI** and web API development
|
99
72
|
- **Familiarity with clean architecture principles** (recommended but not required)
|
100
73
|
- **A new or existing directory** where you want to create your FastAPI project structure
|
@@ -263,24 +236,52 @@ Your API will be available at `http://localhost:8000` with automatic documentati
|
|
263
236
|
| **Presentation** | `api` | FastAPI routers and endpoints |
|
264
237
|
| | `schemas` | Pydantic request/response schemas |
|
265
238
|
|
266
|
-
### CLI
|
239
|
+
### CLI Commands
|
240
|
+
|
241
|
+
#### Core Commands
|
242
|
+
```bash
|
243
|
+
# Project initialization
|
244
|
+
fca-scaffold init # Initialize new project
|
245
|
+
fca-scaffold create-system-context # Create system (bounded context)
|
246
|
+
fca-scaffold create-module # Create module within system
|
247
|
+
fca-scaffold create-component # Create individual components
|
248
|
+
```
|
249
|
+
|
250
|
+
#### Batch Operations
|
251
|
+
```bash
|
252
|
+
# Create multiple components from YAML specification
|
253
|
+
fca-scaffold batch-create components_spec.yaml
|
254
|
+
fca-scaffold batch-create my-spec.yaml --dry-run # Preview only
|
255
|
+
```
|
267
256
|
|
257
|
+
#### Project Management
|
268
258
|
```bash
|
269
|
-
#
|
270
|
-
fca-scaffold
|
271
|
-
fca-scaffold
|
272
|
-
fca-scaffold
|
273
|
-
fca-scaffold
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
259
|
+
# Project status and configuration
|
260
|
+
fca-scaffold status # Show project overview
|
261
|
+
fca-scaffold config show # Display configuration
|
262
|
+
fca-scaffold config validate # Validate configuration
|
263
|
+
fca-scaffold system-status # Show system health and analytics
|
264
|
+
```
|
265
|
+
|
266
|
+
#### Help and Information
|
267
|
+
```bash
|
268
|
+
# Get help and version info
|
269
|
+
fca-scaffold version # Show version information
|
270
|
+
fca-scaffold --help # General help
|
271
|
+
```
|
272
|
+
|
273
|
+
#### Global Options
|
274
|
+
```bash
|
275
|
+
# Available for most commands
|
276
|
+
--dry-run # Preview changes without writing files
|
277
|
+
--force # Overwrite existing files
|
278
|
+
--verbose # Detailed output
|
279
|
+
--config # Specify custom config file
|
279
280
|
```
|
280
281
|
|
281
282
|
### Configuration File
|
282
283
|
|
283
|
-
The `
|
284
|
+
The `fca_config.yaml` file tracks your project structure:
|
284
285
|
|
285
286
|
```yaml
|
286
287
|
project:
|
@@ -309,6 +310,71 @@ project:
|
|
309
310
|
api: ["user"]
|
310
311
|
```
|
311
312
|
|
313
|
+
## 📊 Batch Component Creation
|
314
|
+
|
315
|
+
### YAML Specification Format
|
316
|
+
|
317
|
+
Create multiple components efficiently using YAML specifications:
|
318
|
+
|
319
|
+
```yaml
|
320
|
+
# components_spec.yaml
|
321
|
+
systems:
|
322
|
+
- name: admin
|
323
|
+
description: "Admin management system"
|
324
|
+
modules:
|
325
|
+
- name: authentication
|
326
|
+
description: "Admin authentication module"
|
327
|
+
components:
|
328
|
+
domain:
|
329
|
+
entities: [AdminUser, AdminRole]
|
330
|
+
value_objects: [AdminEmail, AdminPassword]
|
331
|
+
repositories: [AdminUserRepository]
|
332
|
+
application:
|
333
|
+
services: [AdminAuthService]
|
334
|
+
commands: [CreateAdminUser, UpdateAdminUser]
|
335
|
+
queries: [GetAdminUser, ListAdminUsers]
|
336
|
+
infrastructure:
|
337
|
+
repositories: [AdminUserRepository]
|
338
|
+
models: [AdminUserModel]
|
339
|
+
external: [AdminEmailService]
|
340
|
+
presentation:
|
341
|
+
api: [AdminAuthRouter]
|
342
|
+
schemas: [AdminUserSchema, AdminAuthSchema]
|
343
|
+
```
|
344
|
+
|
345
|
+
### Usage
|
346
|
+
|
347
|
+
```bash
|
348
|
+
# Create all components from specification
|
349
|
+
fca-scaffold batch-create components_spec.yaml
|
350
|
+
|
351
|
+
# Preview what would be created
|
352
|
+
fca-scaffold batch-create components_spec.yaml --dry-run
|
353
|
+
|
354
|
+
# Force overwrite existing files
|
355
|
+
fca-scaffold batch-create components_spec.yaml --force
|
356
|
+
```
|
357
|
+
|
358
|
+
## 📊 System Monitoring
|
359
|
+
|
360
|
+
### Health and Analytics
|
361
|
+
|
362
|
+
Fast Clean Architecture includes built-in monitoring capabilities:
|
363
|
+
|
364
|
+
```bash
|
365
|
+
# View system health and usage analytics
|
366
|
+
fca-scaffold system-status
|
367
|
+
|
368
|
+
# Detailed system information
|
369
|
+
fca-scaffold system-status --verbose
|
370
|
+
```
|
371
|
+
|
372
|
+
**Features:**
|
373
|
+
- **Usage Analytics**: Track command usage and component creation patterns
|
374
|
+
- **Error Tracking**: Monitor and log errors with detailed context
|
375
|
+
- **Health Monitoring**: System resource usage and performance metrics
|
376
|
+
- **Security Monitoring**: Template validation and input sanitization tracking
|
377
|
+
|
312
378
|
## 🎨 Customization
|
313
379
|
|
314
380
|
### Custom Templates
|
@@ -380,9 +446,7 @@ pytest -v
|
|
380
446
|
```bash
|
381
447
|
git clone https://github.com/alden-technologies/fast-clean-architecture.git
|
382
448
|
cd fast-clean-architecture
|
383
|
-
|
384
|
-
source venv/bin/activate # On Windows: venv\Scripts\activate
|
385
|
-
pip install -e ".[dev]"
|
449
|
+
poetry install --with dev
|
386
450
|
```
|
387
451
|
|
388
452
|
### Code Quality
|
@@ -404,11 +468,20 @@ bandit -r fast_clean_architecture
|
|
404
468
|
safety check
|
405
469
|
```
|
406
470
|
|
471
|
+
### Security Updates
|
472
|
+
|
473
|
+
This project maintains up-to-date dependencies with security patches:
|
474
|
+
|
475
|
+
- **Black 24.3.0+**: Fixes CVE-2024-21503 (ReDoS vulnerability)
|
476
|
+
- **Pip 25.0+**: Fixes PVE-2025-75180 (malicious wheel execution)
|
477
|
+
- **Setuptools 78.1.1+**: Fixes CVE-2025-47273 (path traversal vulnerability)
|
478
|
+
|
479
|
+
All dependencies are pinned with SHA256 hashes for supply chain security.
|
480
|
+
|
407
481
|
### Pre-commit Hooks
|
408
482
|
|
409
483
|
```bash
|
410
|
-
|
411
|
-
pre-commit install
|
484
|
+
poetry run pre-commit install
|
412
485
|
```
|
413
486
|
|
414
487
|
## 📖 Examples
|
@@ -495,4 +568,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
495
568
|
|
496
569
|
---
|
497
570
|
|
498
|
-
**Made with ❤️ by [Alden Technologies](https://aldentechnologies.com)**
|
571
|
+
**Made with ❤️ by [Adegbenga Agoro](https://www.adegbengaagoro.co), [Founder of Alden Technologies](https://www.aldentechnologies.com)**
|