3.8 KiB
3.8 KiB
Database Schema: preferably using Cassandra: A distributed NoSQL database
- 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)
- 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)
- 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
- Sake:
sake_id
(unique identifier, designation, polish rate, starter, yeast, EAN/UPC, sku ) *` countryregion
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)
- Spirits:
spirit_id
(unique identifier EAN/UPC, sku) *` countryregion
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)
- Coffee:
coffee_id
(unique identifier) *` countryregion
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
- 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)
- 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:
- 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
- Article Page:
- Display article title and content
- Display author information (public key, profile picture)
- Allow users to create new comments
- 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
- 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:
- Use a Nostr client library to connect to the Nostr network and retrieve events.
- Use the
pubkey
field to authenticate users and authorize actions (e.g., creating new reviews or comments). - Use the
created_at
field to display events in chronological order. - Use the
kind
field to determine the type of event and render it accordingly (e.g., review, article, comment).cellar.social