Update README and CLAUDE.md to reflect current project state
- Project structure updated: amqp.rs, lib.rs, tests/, templates/, env_* config files - Configuration section updated: BEDS_ENV-based env file selection - Status table updated: completed items marked done, next steps listed - CLAUDE.md: split current structure from planned additions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
40
README.md
40
README.md
@@ -85,13 +85,24 @@ Every node runs the same binary. Configuration determines what it does.
|
|||||||
rustybeds/
|
rustybeds/
|
||||||
├── src/
|
├── src/
|
||||||
│ ├── config/
|
│ ├── config/
|
||||||
│ │ ├── mod.rs # Loader — layered TOML, base + env override
|
│ │ ├── mod.rs # Loader — load() and load_from() for testability
|
||||||
│ │ └── structs.rs # Typed config structs (serde Deserialize)
|
│ │ └── structs.rs # Typed config structs (serde Deserialize)
|
||||||
|
│ ├── amqp.rs # RabbitMQ transport — validate(), future channel/queue ops
|
||||||
|
│ ├── lib.rs # Public API surface for integration test harness
|
||||||
│ ├── logging.rs # tracing + journald init
|
│ ├── logging.rs # tracing + journald init
|
||||||
│ └── main.rs
|
│ └── main.rs # ipl() sequence + main()
|
||||||
├── config/
|
├── config/
|
||||||
│ ├── beds.toml # Base config — checked in, no credentials
|
│ ├── beds.toml # Base config — checked in, no credentials
|
||||||
│ └── env.toml # Environment overrides — gitignored
|
│ ├── env_dev.toml # Dev overrides — gitignored
|
||||||
|
│ ├── env_qa.toml # QA overrides — gitignored
|
||||||
|
│ └── env_prod.toml # Prod overrides — gitignored
|
||||||
|
├── templates/
|
||||||
|
│ ├── example_rec.toml # Canonical self-documenting REC template
|
||||||
|
│ └── mst_logger_rec.toml # Logger collection template (msLogs)
|
||||||
|
├── tests/
|
||||||
|
│ ├── common/mod.rs # Shared test helpers — load_test_config()
|
||||||
|
│ └── fixtures/
|
||||||
|
│ └── beds_test.toml # Canonical test config fixture
|
||||||
└── Cargo.toml
|
└── Cargo.toml
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -99,7 +110,7 @@ rustybeds/
|
|||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Two-file layered TOML system. `beds.toml` contains production defaults and is checked into version control. `env.toml` overrides per-environment values and is never committed.
|
Layered TOML system. `beds.toml` holds production-safe defaults and is checked into version control. An env override file (`env_{BEDS_ENV}.toml`) is layered on top and is never committed. Set `BEDS_ENV` to `dev`, `qa`, or `prod` — defaults to `dev`.
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# beds.toml — base
|
# beds.toml — base
|
||||||
@@ -107,13 +118,13 @@ Two-file layered TOML system. `beds.toml` contains production defaults and is ch
|
|||||||
host = "prod-broker.internal"
|
host = "prod-broker.internal"
|
||||||
port = 5672
|
port = 5672
|
||||||
|
|
||||||
# env.toml — local override
|
# env_dev.toml — local override (gitignored)
|
||||||
[broker_services.app_server]
|
[broker_services.app_server]
|
||||||
host = "localhost"
|
host = "localhost"
|
||||||
pass = "your-actual-password"
|
pass = "your-dev-password"
|
||||||
```
|
```
|
||||||
|
|
||||||
The `config` crate deep-merges these at startup. Only keys present in `env.toml` are overridden — everything else inherits from base.
|
The `config` crate deep-merges these at startup. Only keys present in the env file are overridden — everything else inherits from the base.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -121,11 +132,18 @@ The `config` crate deep-merges these at startup. Only keys present in `env.toml`
|
|||||||
|
|
||||||
| Component | Status |
|
| Component | Status |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Config loading | Done |
|
| Config loading (layered TOML + env select) | Done |
|
||||||
| Structured logging (journald + console) | Done |
|
| Structured logging (journald + console mirror) | Done |
|
||||||
| Broker pool | Next |
|
| IPL sequence with env-aware error handling | Done |
|
||||||
|
| RabbitMQ reachability validation | Done |
|
||||||
|
| Unit test scaffolding + config fixture pattern | Done |
|
||||||
|
| MongoDB reachability validation | Next |
|
||||||
|
| MariaDB reachability validation | Next |
|
||||||
|
| Shared filesystem validation | Next |
|
||||||
|
| AMQP channel / queue declaration | Planned |
|
||||||
|
| Broker pool (Tokio tasks) | Planned |
|
||||||
| NamasteCore trait | Planned |
|
| NamasteCore trait | Planned |
|
||||||
| Database adapters (MySQL, MongoDB) | Planned |
|
| Database adapters (MariaDB, MongoDB) | Planned |
|
||||||
| Factory dispatch | Planned |
|
| Factory dispatch | Planned |
|
||||||
| AI database object generation | Phase 2 |
|
| AI database object generation | Phase 2 |
|
||||||
|
|
||||||
|
|||||||
52
claude.md
52
claude.md
@@ -23,32 +23,50 @@ This is not a greenfield project. The architecture is proven. The Rust rewrite e
|
|||||||
4. **Template-driven CRUD** — each data domain is a Rust struct implementing the `NamasteCore` trait. Adding a domain means adding a struct. Nothing else changes.
|
4. **Template-driven CRUD** — each data domain is a Rust struct implementing the `NamasteCore` trait. Adding a domain means adding a struct. Nothing else changes.
|
||||||
5. **Single codebase, config-driven nodes** — all service nodes run the same binary. Node role (appServer, admin, segundo, tercero) is determined entirely by startup configuration.
|
5. **Single codebase, config-driven nodes** — all service nodes run the same binary. Node role (appServer, admin, segundo, tercero) is determined entirely by startup configuration.
|
||||||
|
|
||||||
## Project Structure (Target)
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
beds/
|
rustybeds/
|
||||||
├── src/
|
├── src/
|
||||||
│ ├── core/
|
|
||||||
│ │ ├── trait.rs # NamasteCore trait definition
|
|
||||||
│ │ ├── factory.rs # Template name → adapter dispatch
|
|
||||||
│ │ └── meta.rs # Request metadata parsing
|
|
||||||
│ ├── adapters/
|
|
||||||
│ │ ├── mysql.rs # gacPDO equivalent
|
|
||||||
│ │ └── mongodb.rs # gacMongoDB equivalent
|
|
||||||
│ ├── brokers/
|
|
||||||
│ │ ├── pool.rs # Broker pool management
|
|
||||||
│ │ └── broker.rs # Individual broker task
|
|
||||||
│ ├── templates/ # Domain-specific structs (one per data domain)
|
|
||||||
│ ├── config/
|
│ ├── config/
|
||||||
│ │ └── loader.rs # TOML config loading and merging
|
│ │ ├── mod.rs # load() + load_from() — layered TOML config
|
||||||
│ └── main.rs
|
│ │ └── structs.rs # Typed config structs (serde Deserialize)
|
||||||
|
│ ├── amqp.rs # RabbitMQ transport — validate(), future channel/queue ops
|
||||||
|
│ ├── lib.rs # Public API surface for integration test harness
|
||||||
|
│ ├── logging.rs # tracing + journald + console mirror init
|
||||||
|
│ └── main.rs # ipl() sequence + main()
|
||||||
├── config/
|
├── config/
|
||||||
│ ├── beds.toml # Base production config
|
│ ├── beds.toml # Base config — checked in, no credentials
|
||||||
│ └── env.toml # Environment overrides
|
│ ├── env_dev.toml # Dev overrides — gitignored
|
||||||
|
│ ├── env_qa.toml # QA overrides — gitignored
|
||||||
|
│ └── env_prod.toml # Prod overrides — gitignored
|
||||||
|
├── templates/
|
||||||
|
│ ├── example_rec.toml # Canonical self-documenting REC template
|
||||||
|
│ └── mst_logger_rec.toml # Logger collection template (msLogs)
|
||||||
|
├── tests/
|
||||||
|
│ ├── common/mod.rs # Shared test helpers — load_test_config()
|
||||||
|
│ └── fixtures/
|
||||||
|
│ └── beds_test.toml # Canonical test config fixture
|
||||||
├── Cargo.toml
|
├── Cargo.toml
|
||||||
└── CLAUDE.md
|
└── CLAUDE.md
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Planned additions (not yet implemented)
|
||||||
|
|
||||||
|
```
|
||||||
|
src/
|
||||||
|
├── core/
|
||||||
|
│ ├── trait.rs # NamasteCore trait definition
|
||||||
|
│ ├── factory.rs # Template name → adapter dispatch
|
||||||
|
│ └── meta.rs # Request metadata parsing
|
||||||
|
├── adapters/
|
||||||
|
│ ├── mysql.rs # gacPDO equivalent
|
||||||
|
│ └── mongodb.rs # gacMongoDB equivalent
|
||||||
|
└── brokers/
|
||||||
|
├── pool.rs # Broker pool management
|
||||||
|
└── broker.rs # Individual broker task
|
||||||
|
```
|
||||||
|
|
||||||
## Key Rust Mappings from PHP
|
## Key Rust Mappings from PHP
|
||||||
|
|
||||||
| PHP | Rust |
|
| PHP | Rust |
|
||||||
|
|||||||
Reference in New Issue
Block a user