Vertical Packs
SWS core stays strictly industry-agnostic under MIT OR Apache-2.0. Domain schemas, templates, third-party integrations, and compliance linters live in modular packs under packs/*.
How the Pack Architecture Works
- One-way dependency rule: Packs may depend on SWS core crates (
sws-ir,sws-compiler,sws-plugin), while core crates never depend on any vertical pack. - Clean plugin ABI: Packs register IR transformers, domain validators, semantic HTML/JSON-LD renderers, and post-compile advisory linters via
sws-plugin. - Independent release tracks: Core releases publish on
v*tags; vertical packs can publish independently (for example,pack-hospitality-v*). - Flexible licensing: Core engine crates are always dual-licensed
MIT OR Apache-2.0, while individual vertical packs may be open-source or commercially licensed.
First Vertical Pack: packs/hospitality
packs/hospitality is the reference commercial vertical pack built for independent restaurants, pubs, and hospitality venues.
Module Map (M1–M10)
| ID | Module | Key Capabilities |
|---|---|---|
| M1 | Core Shell & NAP | Consistent Name/Address/Phone, hours, LocalBusiness JSON-LD |
| M2 | Semantic Menus | Accessible HTML menus + Menu / MenuSection / MenuItem JSON-LD (never PDF-only) |
| M3 | Private Events Inquiry | Structured inquiry form to POST /api/inquire stored in D1 |
| M4 | Contact | General contact form backed by Turnstile + D1 |
| M5 | Newsletter + Consent | CAN-SPAM explicit unchecked opt-in stored with UTC consent timestamp |
| M6 | Events Calendar | Scheduled events schema and Event JSON-LD |
| M7 | Visit | Regular hours, holiday overrides, directions, and venue accessibility details |
| M8 | About / Story | Editorial story sections with optimized responsive media |
| M9 | SEO & Discovery | sitemap.xml, robots.txt, and NAP consistency checks |
| M10 | Security & A11y Gate | Dual security headers, /api/health, axe-core and Lighthouse CI gates |
Pluggable Hospitality Integrations
Hospitality integrations prefer plain outbound links over heavy third-party script embeds to preserve CSP strictness, page performance, and keyboard accessibility:
- Online ordering: Optional Toast link-out (no third-party API secrets required for static link-outs).
- Seating & reservations: Configurable
walk_in_only,opentable, orresyreservation CTAs. - Turnstile: Per-venue site key with Cloudflare's dummy always-pass key reserved strictly for local development.
Advisory Virginia ABC Copy Linter
packs/hospitality includes an advisory copy linter (implemented in both Rust and Node with parity tests) covering Virginia ABC advertising guidelines (3 VAC 5-20-10 through -100 and 3 VAC 5-50-160). It flags restricted phrases such as "bottomless", "2-for-1", "two for one", "unlimited drinks", and happy-hour end times from 21:00 through 02:00.
Advisory only — not legal advice
Automated copy linting assists with catching common issues early, but a human must always review and sign off on alcohol-related copy against current local regulations before publication.
Building Your Own Pack
To create a new vertical pack for another industry (such as clinics, studios, nonprofits, or retail):
- Create a dedicated directory under
packs/<your-pack>/with its own JSON Schema and Rust crate. - Keep all domain logic host-testable under
cargo testand strictly compliant withcargo deny check. - Use 100% fictional showcase fixtures (invented street names,
555-01xxphone numbers, and.exampledomains) so public repos never contain real third-party trademarks.