System Architecture & API Reference · v0.1
Inside the Cargo workspace.
How Neopress structures its Rust crates, AST layout transpiler, embedded SQLite WAL persistence, and WordPress REST API v2 endpoints today — and what is still being refactored.
Plate III
Broadsheet Grid
Cargo Virtual Workspace
Project layout
Every change is built and tested across 302 workspace tests on Linux, Windows, and macOS with zero Clippy warnings allowed. Note: the
domain / ports / application hexagonal layering in neopress-server is only partly applied in v0.1; many handlers still talk to the SQLite adapter directly.| Path | Responsibility in v0.1 |
|---|---|
| crates/neopress-server | The CMS binary: Axum HTTP routes, admin & public SSR templates, WordPress REST API v2 & Neopress v1 routes, JSON bundle & streaming WXR importers, MCP server, Lettre SMTP email, and Rusqlite WAL storage. |
| crates/neopress-ast | The canonical NeopressLayout / NeopressNode / StyleProperties JSON model, server-side HTML/CSS compiler, and the Elementor, Divi, and Gutenberg AST converters. |
| crates/generated_slugify | Rust ports of WordPress core functions (wpautop, shortcode parser, sanitize_title / remove_accents, font helpers) verified against output from the original PHP. |
| crates/neopress-transpiler | Tooling and Golden Master differential verification harness for PHP-to-Rust ports. |
| neopress-migrator.php | Companion WordPress plugin (packaged as neopress-migrator.zip) that exports a full site bundle for import. |
| fixtures/ | Test fixtures, including four sample WordPress sites (Theme Unit Test data, Gutenberg, Elementor starter, and ACF custom theme). |
REST API & System Endpoints
WordPress REST API v2 & Neopress v1
Authenticated write endpoints accept session cookies +
X-WP-Nonce, WordPress 5.6+ Application Passwords (HTTP Basic), or HS256 Bearer JWT tokens (/wp-json/jwt-auth/v1/token).| Endpoint | Description |
|---|---|
| GET / POST /wp-json/wp/v2/posts | List, search, filter, or create posts (supports ISO 8601 future scheduled dates). |
| GET / PUT / DELETE /wp-json/wp/v2/posts/{id} | Retrieve, update, or trash a post by ID (same pattern for /wp/v2/pages). |
| GET / POST /wp-json/wp/v2/media | Multipart upload with automatic WebP, thumbnail, medium, and large crops + on-the-fly resizing. |
| GET /wp-json/wp/v2/categories & /tags | List and manage taxonomy terms. |
| GET / PUT / DELETE /wp-json/wp/v2/comments | Public comment listing and admin moderation (approve, pending, spam, trash). |
| GET / POST /wp-json/wp/v2/users/{id}/application-passwords | Manage WordPress-compatible Application Passwords for headless clients and MCP. |
| GET / POST /wp-json/neopress/v1/layout/{id} | Read or save canonical NeopressLayout AST JSON and pre-render SSR HTML into post_content. |
| POST /wp-json/neopress/v1/import & /import-wxr | Atomic JSON migration bundle import and 500 MB streaming WXR XML ingestion. |
| POST /wp-json/neopress/v1/forms/{id}/submit | Declarative form submission with honeypot anti-spam, SQLite storage, and SMTP alerts. |
| GET /feed/, /sitemap.xml, /robots.txt | RSS 2.0 syndication feeds (global, category, tag), dynamic XML sitemap, and crawler rules. |