Create a Solana dApp from scratch

What are we building?

Episode 1
1 week ago
3 min read

Before we dive into this series, let's start by having a quick overview of what we are trying to achieve. I'll also list a few prerequisites that should help following the series but, no worries, nothing too drastic — we are building "from scratch" after all.

A decentralised Twitter

By the end of this series, we'll have a fully functional Twitter-like application where anyone can use their wallet to connect and start publishing tweets.

Note that I've already deployed this project on devnet so you can have a little play around.

Demo on Solana devnet

Screenshot of the Twitter Solana dApp

Here's a quick overview of the features it will have:

  • It will be able to integrate with any of the wallets in this list.
  • Users will connect their wallet to log in to the application.
  • Logged in users will be able to send tweets up to 280 characters.
  • They will also be able to add an optional "topic" field to help search for tweets.
  • Users will be able to read tweets without needing the be logged in.
  • Users will be able to view all tweets (from everyone) or filter their search by author or topics.

Regarding the implementation:

  • Tweets will be stored as their own Solana account, therefore, making them public on the blockchain.
  • When sending new tweets, users will pay for the transaction and the storage required to hold their tweet on the blockchain.
  • We'll use the Anchor framework to improve our developer's experience.
  • We'll make RPC calls to the Solana blockchain — via Anchor's JavaScript library — to fetch and filter tweets on the blockchain.

Don't worry if not all of the points above make sense to you yet, we will go through them in this series.

Additionally, once we've implemented all of these features, we'll likely build on top of them as additional follow-up articles. For instance, we could allow users to edit their tweets or even delete them so they can get their rent-exempt money back — again, we'll explain what "Rent" is and how it works in Solana in this series.

Are you excited? I'm excited! Alright, let's go through a few prerequisites and get started.

Prerequisites

There aren't many prerequisites for this series as we're going to build everything from scratch. However, some acquired knowledge might make your journey smoother and therefore is worth mentioning.

  • Some programming experience. It might go without saying but we're going to create an application from scratch and if you've got no or very little programming experience, then you might want to start with a simpler tutorial before embarking on this journey.
  • High-level blockchain knowledge. Whilst I'm going to try my best to explain all Solana concepts that we come across, having some high-level knowledge on how blockchains work will greatly help. If you're still very new to the world of web 3, you might benefit from reading "My journey into web 3".
  • Rust experience not required. Solana programs are written in Rust. Whilst Rust has some pretty unique features, if you've got some programming experience, you should be able to understand what Rust code does without much problem. I'll be sure to briefly explain some of its quirks when we go through them and provide links to additional documentation if you're interested.
  • JavaScript. On top of building our Solana program, we will build a JavaScript client that interacts with it. More precisely, we will build a Vue 3 Single-Page Application (SPA) for our frontend. Now, this course isn't about building a frontend app so I'll go through the frontend scaffolding very quickly but having some JavaScript / Vue 3 knowledge will be a valuable asset for you to have.

Conclusion

Demo... check! Prerequisites... check! In the next episode, we'll make sure our local machine has everything it needs to start working with Solana and its most popular framework: Anchor.

One last important note: the project we are building is open source and already available on GitHub. So, if you can't wait to have a look around the code, here's the link.

View Solana Twitter on GitHub

Alright, LFG! 🔥

Discussions

Author avatar
Andrii
4 days ago

Wow, these are amazing articles, that explain how to work with anchor! Thank you for your work!

💖 0

Discussion

What are we building?
Author avatar
Andrii
4 days ago

Wow, these are amazing articles, that explain how to work with anchor! Thank you for your work!

💖 0

Would you like to chime in?

You must be a member to add a reply to a discussion.

Fortunately, it only takes two click to become one. See you on the other side! 🌸

Become a Member

Would you like to chime in?

You must be a member to start a new discussion.

Fortunately, it only takes two click to become one. See you on the other side! 🌸

Become a Member