Home
About
What is Tableland?
Rigs NFT
Our Vision
Open Beta
FAQs
Protocol
Limits
Deployed Contracts
Response Times
Considerations & Tradeoffs
Affecting Tableland State
Walkthroughs
Prerequisites & Repos
Quick Start
JavaScript SDK (Latest)
Upgrading SDK (v3 to v4)
JavaScript SDK (Legacy)
CLI
Validator API
REST API (Legacy)
SQL Specification
Local Development & Testing
Integrations
Choosing a Chain
Using Polygon
Using Optimism
Using Arbitrum
Deploying an NFT on Polygon
Dynamic NFT with Chainlink Automation
On-Chain Reads with Chainlink + Arbitrum
Intro to NFT Metadata
NFT Metadata Standards
Crafting NFT Metadata with SQL
Store & Edit Metadata with the CLI or SDK
Serving NFT Metadata from Smart Contracts
Tutorials
Build a Dynamic NFT in Solidity
Creating a Dynamic NFT with p5.js & Tableland
Smart Contracts
Creating Tables from Contracts
Configuring Table Write Access
Solidity to SQL Types
Using Remix
Concepts
URI Encoding
Table Queries & Joins
Table Writes & Updates
Incrementing Values Automatically
Query Optimization & Gas
Playbooks
Create a Key-Value Store Table
Create an Immutable Table
Create a Table for Immutable Files on IPFS
Learn
Use Cases
Code Examples
Security
Web3 Basics
Roadmap
Community
Twitter Clone Owned by Users
Build a user-owned Twitter where you control your own feed.
Overview
It might be much easier than you would first guess
- Build an app where a user’s identity is their .eth domain (or pub address if lacking). See withBackdrop for example.
- When a user logs into the app, it would look into a dapp table (e.g. the developer table for the dapp) for that users address and link to the user owned table. i.e. rows in dev table look like
pub address: owned tweets table, owned following table
- Owned table conforms to my schema. e.g.
id, text, reply_to, etc, etc
. - They also must own a table that conforms to a schema for following. e.g.
follow_addr, name, follow owned tweet table
. name could just be an optional nickname that you self assign people you follow if you like - When you load the app, it loads up all the followers from table in 3, it loads up all those owner's tables from 2 and compiles a tweet feed.
If said owner now wants to tweet their own, they just write to their own table.
Not the most elegant thing compared to a centralized DB, but pretty sweet you could build it so simply as a starting point. We wouldn’t recommend taking the exact configuration above to a production example, but it’s a great starting point to learn!
Result
You’d see the world from your own small view. also cool is you could load the world from other people’s pov (for example, I could embed my view of the twitter clone world into my homepage)
Technical details
- Signup
- Create a dApp that prompts users to log in using Metamask.
- When the user logs in, create two tables that will be owned by the user.
- Table 1 with schema: `post:text, parent_id:text`.
- Table 2 with schema: `following_addr: text, posts_table: text`
- The dapp should keep a developer owned (backend controlled) table for tracking:
user_addr, user_table1_id, user_table2_id
- A user doesn’t have to be in this table to use the app ^. they may be able to store similar index information, for example, in their ens domain entry.
- Give the user a landing page that displays their Table 1 content as a feed of posts. e.g. `localhost/users-eth-addr...`
- Add a `follow` button on the landing page for any user when the page doesn't match the id of the currently logged-in user. The dapp will need to know the Table 1 and Table 2 addrs of
users-eth-addr...
owner in 1. - When a user hits, follow, prompt them to insert into their own Table 2 the page's user addr plus the page's user addr's table 1 id.
- When a user goes to their own landing page on 1, do a query for the posts in Table 1, plus lookup each table in the second column of Table 2 and give an ordered list of all posts. This is their feed.
Resources
- https://ens.domains/
- https://epns.io/
- Twitter clone example app, Gila
← Previous