Commit Graph

24 Commits

Author SHA1 Message Date
florian.berthold 7546c3a9dc Improve cross-entity search with weighted ranking, prefix matching, and richer results
Backend: Use ts_rank_cd with A/D weights so name matches rank above description
matches. Switch to 'simple' text search config with :* prefix suffix for partial
word matching (e.g. "toma" finds "Tomate"). Include bilingual DE/EN fields in
search vectors. Cultivar search JOINs species so "tomato" finds tomato cultivars.
Return extra metadata: plant_layer, food_uses, species_name, is_organic, snippet.

Frontend: Show colored entity type badges (Familie/Art/Sorte). Display localized
common names, plant layer tags, food uses for species, species link + organic
badge for cultivars, and truncated description snippets. Add DE/EN i18n keys for
search result type labels.
2026-03-17 21:26:02 +01:00
florian.berthold 00e26b3a84 Add companion planting section to species detail page and redesign home page
Species detail now shows a "Companion Plants" card (left column, after
Ecology) with beneficial/antagonistic sub-lists. Each entry links to
the companion species and shows the mechanism.

Home page gains stats cards, quick-filter buttons, and a hero section.
Species list supports URL query params for quick-filter links.
New /api/v1/stats endpoint provides database counts.

i18n keys added for DE/EN: card.companion_plants, companions.beneficial_for,
companions.antagonistic_for, stat.*, filter.*, home.*.
2026-03-16 11:18:10 +01:00
florian.berthold 0ef902cc91 Add scraper and enrichment scripts to tools/ directory 2026-03-16 11:10:18 +01:00
florian.berthold 83ab8c4cf9 Add OpenAPI/Swagger docs at /api/docs
Full OpenAPI 3.0.3 spec with all 30+ endpoints, schemas, and query params.
Swagger UI served from unpkg CDN at /api/docs, raw spec at /api/openapi.yaml.
2026-03-16 03:15:56 +01:00
florian.berthold e79e1d1736 Add dedicated Companion Planting page
Backend: new GET /api/v1/companions endpoint returning all companion
relationships with joined species names, slugs and images. Adds
CompanionWithNames model and list_all DB query.

Frontend: new /companions route with search bar, beneficial (green)
and antagonistic (red) sections, species thumbnails, mechanism text,
source links, and species detail links. Full DE/EN i18n support.
2026-03-16 03:15:41 +01:00
florian.berthold e3b1d5ff6d Add bilingual native_range and wildlife_value fields (DE/EN) to species
Migration 011 adds native_range_de, native_range_en, wildlife_value_de,
wildlife_value_en columns. Backend INSERT/UPDATE queries updated ($64→$68).
Frontend species and cultivar detail pages use pick_desc() for language selection.
2026-03-15 21:57:23 +01:00
florian.berthold b24038cb57 Add German translations for species enum values (plant_layer, drought_tolerance, pollination_type, succession_stage, native_status) 2026-03-15 21:50:41 +01:00
florian.berthold aa36c846d7 Add full DE/EN UI label translations across all pages
Add t() translation function to i18n.rs with ~200 key/value pairs
covering navigation, card headers, field labels, buttons, filters,
planting calendar rows, and general UI text in both German and English.

Updated all 11 source files to use t(&lang, "key") instead of
hardcoded English strings: app.rs (sidebar nav), all 7 page files
(species, cultivars, families, suppliers, home, search, sources),
and all 3 component files (planting_calendar, table_controls,
plant_card). Boolean values (Yes/No/Annual) are also translated.
2026-03-15 17:20:51 +01:00
florian.berthold 896b364b09 Add bilingual uses fields (food/medicinal/other _de/_en) to species
Backend: add 6 new columns to Species and CreateSpecies structs, update
INSERT/UPDATE queries, add migration 010.
Frontend: add fields to Species type, use pick_desc() for language-aware
display in species detail and cultivar species-info card.
2026-03-15 17:09:25 +01:00
florian.berthold 5a37190fd3 Move cultivar image into right column card (same as species) 2026-03-15 16:36:25 +01:00
florian.berthold cd129e3de5 Add custom index.html with CSS link — permanent fix for missing stylesheet 2026-03-15 16:31:44 +01:00
florian.berthold 2f909b98d5 Add species-level data fallback on cultivar detail page
When cultivar fields are empty, show species-level data as fallback with
italic styling and a "~ species" indicator. Applied to: frost tolerance
(from USDA zone), light requirement (inferred from plant layer), and
climate card (drought tolerance, USDA hardiness zone). Includes a footer
note explaining estimated values.
2026-03-15 16:12:06 +01:00
florian.berthold a7f64e763f Move species image into right column detail card with attribution 2026-03-15 15:24:18 +01:00
florian.berthold 5155d930b7 Move species image to right of header (flex layout) 2026-03-15 15:21:35 +01:00
florian.berthold 1cba5a9eaf Add image serving with CC license attribution
- S3 image proxy at /img/{path} with cache headers
- Species images displayed on species + cultivar detail pages
- Full CC attribution below each image: author, license, Wikimedia Commons link
- Image struct updated with source_url and license fields
2026-03-15 15:13:06 +01:00
florian.berthold 170aa84a0f Add 52-week planting calendar with month fallback
Add indoor_sowing_weeks, direct_sowing_weeks, transplanting_weeks,
glasshouse_weeks, harvesting_weeks (integer[]) to backend Cultivar and
CreateCultivar structs with INSERT/UPDATE SQL bindings.

Frontend PlantingCalendar component rewritten as a compact 52-column
Gantt-style grid grouped by month headers. Prefers week data when
available, falls back to expanding month data into week ranges.
Calendar displayed full-width on cultivar detail page with color legend.
2026-03-15 14:36:17 +01:00
florian.berthold 3ecfdfadf2 Add DE/EN language toggle with bilingual descriptions
- Language switcher in sidebar (DE/EN buttons, persists to localStorage)
- i18n module with pick_desc/pick_name helpers for language-aware fallback
- All detail/list pages use language context for names and descriptions
- Species/Cultivar types updated with description_de/description_en
- Common Name column added to species/families lists
2026-03-15 13:01:38 +01:00
florian.berthold efa05b2d44 Add bilingual description fields (description_de, description_en)
Species and Cultivar structs + SQL queries now support separate
German and English descriptions for the language toggle feature.
2026-03-15 12:56:59 +01:00
florian.berthold e9978f09f4 Add __pycache__ to gitignore 2026-03-15 12:12:47 +01:00
florian.berthold f5d8149fb8 Add wildlife display, species filtering, updated data sources
- Species struct: 13 new wildlife fields (nectar/pollen, bee/butterfly/bird counts, native status)
- Species list: filter dropdowns for plant_layer, nitrogen_fixer, drought_tolerance, native_status
- Species detail: Wildlife & Ecology card with visual nectar/pollen bars, bee counts, native badges
- Data sources page: added NaturaDB, Dreschflegel, Bingenheimer Saatgut
- API: list_species now supports filter query params
2026-03-15 01:02:30 +01:00
florian.berthold 14b63f00af Simplify species list filtering with IS NULL pattern
Replaced dynamic WHERE clause builder + macro with static SQL using
($N::type IS NULL OR column = $N) pattern. Always binds all 9 filter
params + limit/offset. Supports: family, search, plant_layer,
nitrogen_fixer, dynamic_accumulator, drought_tolerance, native_status,
min_nectar, min_bees.
2026-03-15 00:58:47 +01:00
florian.berthold 97f651572b Add 13 structured wildlife fields to Species API
nectar_value, pollen_value, wild_bee_count, wild_bee_specialist_count,
butterfly_moth_count, caterpillar_host_count, caterpillar_specialist_count,
hoverfly_count, beetle_count, bird_count, mammal_count, native_status, naturadb_tags
2026-03-15 00:55:29 +01:00
florian.berthold 42906efd90 Frontend overhaul: NetBox-style detail pages, selectable columns, data sources
- Cultivar/species detail pages rewritten with two-column card layout, attribute tables, em-dash placeholders
- Column toggle + per-page selector on all list pages (families, species, cultivars, suppliers)
- Species list: table/card view toggle with family, layer, N-fixer, uses columns
- Cultivar detail: supplier links with SKU/price/product URL, species info section
- Data sources page (/sources) with attribution for all 10 data sources
- Fixed Cultivar/Species structs with #[serde(default)] for API compatibility
- Added table_controls component (reusable column toggle + per-page selector)
- Removed max-width constraint on content area for full-width tables
- Fixed route conflicts: merged {slug}/{id} into single {ref} routes
- Removed PostgreSQL enum types (plant_layer, drought_tolerance, etc.) in favor of TEXT
- Fixed API per_page parameter support across all list endpoints
2026-03-15 00:53:06 +01:00
florian.berthold 484979ad53 Initial HerbAPI implementation
Rust/Axum REST API (herbapi-api) with PostgreSQL, S3/Garage, OIDC auth.
Dioxus 0.7 WASM frontend (herbapi-ui) with sidebar layout and botanical reference style.
9 SQL migrations covering families, species, cultivars, suppliers, companions, images, users, API tokens.
2026-03-14 00:02:29 +01:00