# rCellar Social Technical Design ## Description Cellar Social is a platform where admirers of international wine, sake, spirits and coffee can review, discuss, and order it. ## Key Features Cellar Social will provide the following capabilities: - Login using Nostr identity. - View products. - Leave product review. - Evaluate multiple properties of the product. - Provide a description. - Upload media files. - View product review. - Leave a comment. - Zap a review or a comment. - Visit the product producer page. - Leave a comment. - Zap a producer or a comment. - Order the product. - Engage with product related community. - Provide NIP-05 names. - View and sign on to events. ## Design Cellar Social consists of the backend and frontend apps supported by the database and the relay. All hosted services will be containerised and deployed to the linux ([Ubuntu](https://ubuntu.com/)) server and traffic routing will be manged by [Nginx](https://nginx.org/). The entire server should be backed up daily. Cellar Social will also use an external service ([nostr.build](http://nostr.build/)) for media hosting to avoid inappropriate data.  `Client` - [frontend app](#frontend) `API` - [backend app](#backend) `DB` - [database](#database) `APP Relay` - [relay](#relay) `Media Server` - [media server](#media-server) `NIP-05` - NIP-05 name register `Npub Whitelist` - collection of whitelisted Npubs `Nostr Communication Platform` - flotilla.social is planned to be usedas a communication platform over Nostr `Shopstr Marketplace` - shopstr.store is planned to be used as a Nostr marketplace ### Frontend The frontend app (`Client`) is a web application that users will be able to use by visiting a URL via browser (browsers list is not defined at the moment). The app will be built using the following technologies: - [TypeScript](https://www.typescriptlang.org/) - [React](https://react.dev/) - [Nostr Login](https://github.com/nostrband/nostr-login) (authentication) HTTP requests to Cellar Social API should include Nostr signatures, so the backend app will be able validate it and provide the response. Frontend app will use websocket connections to the `APP Relay` to read/write appropriate data. Frontend app should let users register [NIP-05](https://github.com/nostr-protocol/nips/blob/master/05.md) names and manage users' metadata. ### Backend The backend app (`API`) is a RESTful API that can be used via HTTP requests. It will be built using the following technologies: - [TypeScript](https://www.typescriptlang.org/) - [Node.js](https://nodejs.org/en) - [Express.js](https://expressjs.com/) HTTP requests to the backend app should include Nostr signatures, so the app will be able to validate it and provide the response. The backend app will have access to the database and will perform CRUD (create/read/update/delete) operations. The backend app will also manage Npub whitelisting that `APP Relay` will use. ### Database [Cassandra](https://cassandra.apache.org/_/index.html) will be used as a NoSQL database (`DB`) to persist business data. Only the backend app will have access to the database. The following tables are planned in the database: - Users - Coffee - Sake - Spirits - Wine - Reviews - NostrEvents Database has to be backed up daily. ### Relay [strfry](https://github.com/hoytech/strfry) (`APP Relay`) will be used for Nostr events. Npub whitelisting has to be enabled for strict relay access. `APP Relay` will be available for communication at flotilla.social (users' npubs will be taken into account). Multiple Shopstr instances will use the `APP Relay` to read and write data. Each Shopstr instance will have a dedicated subdomain at Cellar Social. ### Media Server [nostr.build](https://nostr.build/) will be used as a media server. It is used to avoid inappropriate data while media uploads.