feat: schema

This commit is contained in:
b 2025-03-19 09:20:51 +00:00
parent f5f046ad8d
commit fde49f298f
2 changed files with 113 additions and 0 deletions

4
meetings/20250319.md Normal file

@ -0,0 +1,4 @@
- reviewed tasting menu.
- when creating tasting notes, they shouldn't be saved immediately, but rather saved as a draft
- need option to skip to comments

109
schema.md Normal file

@ -0,0 +1,109 @@
**Database Schema:** preferably using Cassandra: A distributed NoSQL database
1. **Events** (Nostr protocol's core data structure):
* `id` (unique identifier)
* `pubkey` (public key of the event creator)
* `created_at` (timestamp)
* `kind` (event type, e.g., review, article, comment)
* `tags` (array of keywords or hashtags)
* `content` (text content of the event)
2. **Wine Reviews**:
* `id` (foreign key referencing the Events table)
* `wine_id` (unique identifier for the wine)
* `rating` (numerical rating, e.g., 1-100)
* `review_text` (text content of the review)
* `tasting_notes` (array of tasting notes, e.g., flavors, aromas)
3. **Wines**:
* `wine_id` (unique identifier, type/style/characteristic, EAN/UPC, sku)
* `type` (white, amber, rose, red)
* `style` (bubbles+fizz, table, dessert, fortified, vermouth)
* `characteristic` (light aromatic, textural, fruit forward, structural & savoury, powerful)
* `country`
* `region` (appellation, village, sub-region, vineyard)
* `name` (label)
* `producer`
* `varietal` (if more than one, listl as blend)
* `vintage` (year, nv, mv)
* `alcohol`
* `standard drinks` (Australia)
* `viticulture` (biodynamic, organic, conventional)
* `sulfites` (parts per million)
* `filtration`
* `vegan`
* `kosher`
* `closure` (cork, crown-seal, screwcap)
* `price` (NIP-89, NIP-99)
* `image` (optional image URL)cellar.social
4. **Sake**:
* `sake_id` (unique identifier, designation, polish rate, starter, yeast, EAN/UPC, sku )
*` country
* `region`
* `name` (label)
* `producer`
* `designation`(table, pure, blended, mirin: new/true/salt)
*` polish rate` (%)
*` starter` (koji)
*` yeast strain`
*` alcohol`
* `standard drinks` (Australia)
* `vintage` (year, nv, mv)
* `price` (NIP-89, NIP-99)
* `image` (optional image URL)
5. **Spirits**:
* `spirit_id` (unique identifier EAN/UPC, sku)
*` country
* `region`
* `name` (label)
* `producer`
* `type`(white, dark, liqueurs)
*` variant`(vodka, rum, liqueur cream, etc)
*` flavouring/ingredients`
*` alcohol`
* `standard drinks` (Australia)
* `vintage` (year, VS/VSOP/XO, age statement)
* `price` (NIP-89, NIP-99)
* `image` (optional image URL)
6. **Coffee**:
* `coffee_id` (unique identifier)
*` country
* `region`
* `origin`
* `variety`
*` processing` (type: de-caff/honey/semi-dry/swiss water/sundried/washed)
* `producer` (roaster)
* `roast`
* `price` (g/kg/ton, NIP-89, NIP-99))
* `image` (optional image URL)cellar.social
7. **Articles**:
* `id` (foreign key referencing the Events table)
* `title`
* `content` (text content of the article)
* `author` (public key of the author)
* `tags` (array of keywords or hashtags)
8. **Comments**:
* `id` (foreign key referencing the Events table)
* `parent_event_id` (foreign key referencing the Events table)
* `content` (text content of the comment)
**Frontend Schema:**
1. **Review Page**:
* Display details (name, producer, region, varietal, vintage)
* Display review text and rating
* Display tasting notes
* Allow users to create new reviews and comments
2. **Article Page**:
* Display article title and content
* Display author information (public key, profile picture)
* Allow users to create new comments
3. **Wine List Page**:
* Display a list of wines with basic information (name, producer, region)
* Allow users to filter by region, varietal, or vintage
* Allow users to create new wine reviews
4. **Tag Page**:
* Display a list of events (reviews, articles, comments) associated with a particular tag
* Allow users to create new events with the same tag
**Nostr Protocol Integration:**
1. Use a Nostr client library to connect to the Nostr network and retrieve events.
2. Use the `pubkey` field to authenticate users and authorize actions (e.g., creating new reviews
or comments).
3. Use the `created_at` field to display events in chronological order.
4. Use the `kind` field to determine the type of event and render it accordingly (e.g., review,
article, comment).cellar.social