Skip to content

Commit e3021c1

Browse files
committed
docs: update README
1 parent 732a7a7 commit e3021c1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@ print(captured)
7272
# }
7373
```
7474

75+
## Architecture
76+
77+
This project uses a multi-crate Rust workspace structure to maintain clean separation of concerns:
78+
79+
### Crate Structure
80+
81+
- **`djc-html-transformer`**: Pure Rust library for HTML transformation
82+
- **`djc-template-parser`**: Pure Rust library for Django template parsing
83+
- **`djc-core`**: Python bindings that combine all other libraries
84+
85+
### Design Philosophy
86+
87+
To make sense of the code and keep it clean, the Python API and Rust logic are defined separately:
88+
89+
1. Each crate (AKA Rust package) has `lib.rs` (which is like Python's `__init__.py`). These files do not define the main logic, but only the public API of the crate. So the API that's to be used by other crates.
90+
2. The `djc-core` crate imports other crates
91+
3. And it is only this `djc-core` where we define the Python API using PyO3.
92+
7593
## Development
7694

7795
1. Setup python env

0 commit comments

Comments
 (0)