117 lines
4.3 KiB
Markdown
117 lines
4.3 KiB
Markdown
# Cellar 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 up to in-person 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 managed by [Nginx](https://nginx.org/). The entire server should be backed up (at the host level) daily.
|
|
|
|
Cellar Social will also use an external service ([nostr.build](http://nostr.build/)) for media hosting to avoid inappropriate data.
|
|
|
|

|
|
|
|
Website - [frontend app](#frontend)
|
|
|
|
`API` - [API app](#api-app)
|
|
|
|
`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 used as a communication platform over Nostr
|
|
|
|
`Shopstr Marketplace` - shopstr.store is planned to be used as a Nostr marketplace
|
|
|
|
### Frontend
|
|
|
|
The frontend app (`Website`) 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 to conform to [NIP-98](https://github.com/nostr-protocol/nips/blob/master/98.md). The `API` app will be able to validate and authorize requests based on `Authorization` header.
|
|
|
|
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 includes API app and Database.
|
|
|
|
#### API App
|
|
|
|
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
|
|
|
|
[MongoDB Community Edition](https://www.mongodb.com/products/self-managed/community-edition) 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 will be backed up daily during daily server backup.
|
|
|
|
### 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. An example of JavaScript function that can be used for whitelisting can be found here.
|
|
|
|
`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 because of their excellent service and safety protections. Users can make use of their existing nostr.build subscriptions when they upload content. More info can be found [here](https://nostr.build/features/).
|