Twimba is a lightweight Twitter-style microblogging app built entirely with vanilla JavaScript.
It allows users to post tweets, like, retweet, and view replies β all without a backend.
The UI updates dynamically using DOM manipulation and a simple local dataset.
- βοΈ Post tweets in real time
- β€οΈ Like / Unlike tweets
- π Retweet / Undo Retweet
- π¬ Show / Hide replies
- β‘ Instant DOM rendering using template strings
- π Unique tweet IDs generated via
uuidv4() - π¦ In-memory data model stored in
tweetsData
The app listens for all clicks using:
document.addEventListener('click', function(e) { ... })| Attribute | Purpose |
|---|---|
data-like="uuid" |
β€οΈ Like / Unlike a tweet |
data-retweet="uuid" |
π Retweet / Undo retweet |
data-reply="uuid" |
π¬ Show / hide replies |
id="tweet-btn" |
βοΈ Post a new tweet |
After any interaction, the UI is refreshed using:
render()
The tweets are generated from tweetsData using the function:
getFeedHtml()
This builds the tweet HTML structure (likes, retweets, replies) and injects it into:
<div id="feed"></div>
-
Vanilla JavaScript
-
HTML / CSS
-
Font Awesome (icons)
-
uuid (uuidv4() for unique IDs)
π Project Structure /project βββ index.html
βββ index.css
βββ index.js β (main logic)
βββ data.js β tweet dataset
βββ images/
-
Download or clone the project
-
Open index.html in your browser
-
Start tweeting π
-
No build tools. No backend. 100% client-side.