Wave is a decentralized, portable and ownable link hub that allows you to manage and share all your important links from one central location. With Wave, you have full control over your online identity and content, Effortlessly share your creations across Instagram, Facebook, X(Formerly Twitter), YouTube, and more—all with one simple link.
-
Deploy a WeaveDB instance using the web console by following the instructions in the WeaveDB Deployment Docs.
-
Create a collection in deployed WeaveDB instance by following the instructions in the WeaveDB Collection Docs.
{
"type": "object",
"required": ["name", "username"],
"properties": {
"name": {
"type": "string"
},
"bio": {
"type": "string"
},
"username": {
"type": "string"
},
"avatar": {
"type": "string"
},
"links": {
"type": "object",
"required": [],
"properties": {
"facebook": {
"type": "string"
},
"youtube": {
"type": "string"
},
"github": {
"type": "string"
},
"snapchat": {
"type": "string"
},
"telegram": {
"type": "string"
},
"discord": {
"type": "string"
},
"farcaster": {
"type": "string"
},
"blockchain": {
"type": "string"
},
"linkedin": {
"type": "string"
},
"x": {
"type": "string"
},
"instagram": {
"type": "string"
},
"other": {
"type": "string"
}
}
},
"owner": {
"type": "string"
}
}
}
Copy the above schema and create a new schema in the collection by following the instructions in the WeaveDB Schema SetupDocs.
{
"let create": {
"resource.newData.createdAt": {
"var": "request.block.timestamp"
},
"resource.newData.owner": {
"var": "request.auth.signer"
}
},
"let update": {
"resource.newData.updatedAt": {
"var": "request.block.timestamp"
}
},
"allow create": {
"and": [
{
"==": [
{ "var": "request.auth.signer" },
{ "var": "resource.newData.owner" }
]
},
{
"==": [
{ "var": "request.block.timestamp" },
{ "var": "resource.newData.createdAt" }
]
},
{
"==": [
{ "var": "request.block.timestamp" },
{ "var": "resource.newData.updatedAt" }
]
}
]
},
"allow update": {
"and": [
{
"==": [{ "var": "request.auth.signer" }, { "var": "resource.setter" }]
},
{
"==": [
{ "var": "resource.data.username" },
{ "var": "resource.newData.username" }
]
},
{
"==": [
{ "var": "request.block.timestamp" },
{ "var": "resource.newData.updatedAt" }
]
}
]
},
"allow delete": {
"==": [{ "var": "request.auth.signer" }, { "var": "resource.setter" }]
}
}
- Here, we are allowing
createdAt
andupdatedAt
fields to be set automatically when a new record is created or updated. We are also assigning theowner
field to the signer of the transaction. - The create operation is allowed only if the signer is the
owner
of the record and thecreatedAt
andupdatedAt
fields are equal to the current block timestamp. - The update operation is allowed only if the signer is the setter of the record and the username field is not changed.
- The delete operation is allowed only if the signer is the setter of the record.
Copy the above ACL and create a new ACL in the collection by following the instructions in the WeaveDB ACL Setup Docs using web console.
Copy the
.env.example
file to.env
and fill in the required fields.
npm install
npm run dev
Open http://localhost:3000 with your browser to see the result.
- Weave DB - A decentralized NoSQL database system that uses the Arweave network as its underlying storage layer. It is designed to offer a scalable, secure, and fast solution for data storage.
- Next.js - Next.js is a flexible React framework that gives you building blocks to create fast, full-stack web applications.
- Ant Design - An enterprise-class UI design language and React UI library with a set of high-quality React components, one of best React UI library for enterprises.
This is experimental software and subject to change over time.
This is a proof of concept and is not ready for production use. It is not audited and has not been tested for security. Use at your own risk. I do not give any warranties and will not be liable for any loss incurred through any use of this codebase.
This project is licensed under the MIT License - see the LICENSE.md file for details.