<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: engmmmar6-bit</title>
    <description>The latest articles on DEV Community by engmmmar6-bit (@engmmmar6bit).</description>
    <link>https://dev.to/engmmmar6bit</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4057170%2F81275f27-02f0-4ea9-8c17-9987312b2824.png</url>
      <title>DEV Community: engmmmar6-bit</title>
      <link>https://dev.to/engmmmar6bit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/engmmmar6bit"/>
    <language>en</language>
    <item>
      <title>I Built a Real-Time Analytics Dashboard with Vanilla JS — Here's How</title>
      <dc:creator>engmmmar6-bit</dc:creator>
      <pubDate>Fri, 31 Jul 2026 20:33:33 +0000</pubDate>
      <link>https://dev.to/engmmmar6bit/i-built-a-real-time-analytics-dashboard-with-vanilla-js-heres-how-153m</link>
      <guid>https://dev.to/engmmmar6bit/i-built-a-real-time-analytics-dashboard-with-vanilla-js-heres-how-153m</guid>
      <description>&lt;p&gt;"I Built a Real-Time Analytics Dashboard with Vanilla JS — Here's How"&lt;br&gt;
published: true&lt;br&gt;
description: "A production-ready analytics dashboard built with vanilla JavaScript, Firebase, and zero frameworks. Full CRUD, real-time sync, Excel import/export, and Arabic RTL support."&lt;br&gt;
tags: javascript, firebase, dashboard, webdev, beginners&lt;br&gt;
cover_image: &lt;a href="https://your-screenshot-link.png" rel="noopener noreferrer"&gt;https://your-screenshot-link.png&lt;/a&gt;&lt;br&gt;
I Built a Real-Time Analytics Dashboard with Vanilla JS — Here's How&lt;br&gt;
TL;DR: I built a fully functional analytics dashboard using only HTML, CSS, and vanilla JavaScript — no React, no Vue, no build tools. It has real-time data sync, authentication, CRUD operations, charts, Excel import/export, and full Arabic RTL support. Live Demo | GitHub Repo&lt;br&gt;
Who Am I?&lt;br&gt;
I'm Omar, a developer from Egypt. I've been coding for a while now, and today I want to share something I'm genuinely proud of — a real-time analytics dashboard that I built from scratch.&lt;br&gt;
This isn't just a UI mockup. It's a full-stack application with a Firebase backend, real-time data synchronization, user authentication, and a dark glassmorphism design.&lt;br&gt;
What I Built&lt;br&gt;
Vertex Analytics Dashboard is a multi-view analytics panel designed for small businesses, e-commerce stores, and freelancers who need to track their data without paying for expensive SaaS tools.&lt;br&gt;
Features&lt;br&gt;
جدول&lt;br&gt;
Feature Description&lt;br&gt;
 Real-Time Sync Data changes appear instantly across all connected clients via Firebase Firestore&lt;br&gt;
 Authentication Secure email/password login &amp;amp; registration&lt;br&gt;
 Interactive Charts Line &amp;amp; bar charts powered by Chart.js&lt;br&gt;
 Excel Import/Export    Bulk data import and one-click export&lt;br&gt;
 Glassmorphism UI   Modern dark theme with neon accents&lt;br&gt;
 Arabic RTL Full right-to-left support&lt;br&gt;
 Responsive Works on desktop, tablet, and mobile&lt;br&gt;
5 Dashboard Views&lt;br&gt;
Overview — Summary cards + weekly performance chart&lt;br&gt;
Sales — Full sales table with add/edit/delete&lt;br&gt;
Products — Inventory management with stock alerts&lt;br&gt;
Traffic — Visit analytics by source&lt;br&gt;
Revenue — Revenue breakdown by product&lt;br&gt;
The Tech Stack&lt;br&gt;
I intentionally kept this framework-free. Here's why:&lt;br&gt;
No build step — Just open index.html in a browser&lt;br&gt;
No dependencies to install — Everything loads via CDN&lt;br&gt;
Easy to understand — Anyone can read the code&lt;br&gt;
Fast to deploy — Upload one file and you're done&lt;br&gt;
plain&lt;br&gt;
Frontend:  HTML5 + CSS3 + Vanilla JavaScript&lt;br&gt;
Backend:   Firebase (Auth + Firestore)&lt;br&gt;
Charts:    Chart.js (CDN)&lt;br&gt;
Excel:     XLSX.js (CDN)&lt;br&gt;
Design:    Custom CSS with CSS variables&lt;br&gt;
Key Code Snippets&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Firebase Real-Time Listener
This is the magic that makes everything sync in real time:
JavaScript
function initDashboard() {
// Listen to sales collection in real-time
getSalesRef().orderBy('createdAt', 'desc').onSnapshot(snap =&amp;gt; {
salesData = [];
snap.forEach(doc =&amp;gt; salesData.push({ id: doc.id, ...doc.data() }));
updateDashboard();
});
}
Any change in the database — add, edit, delete — instantly updates the UI. No refresh needed.&lt;/li&gt;
&lt;li&gt;Per-User Data Isolation
Each user only sees their own data:
JavaScript
function getSalesRef() {
return db.collection('users').doc(currentUser.uid).collection('sales');
}
This creates a structure like:
plain
users/{userId}/sales/{saleId}
users/{userId}/products/{productId}
users/{userId}/visits/{visitId}&lt;/li&gt;
&lt;li&gt;Excel Import with Batch Operations
JavaScript
async function processImport(mode) {
const workbook = pendingWorkbook;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;// Option 1: Append to existing data&lt;br&gt;
  // Option 2: Replace all data&lt;/p&gt;

&lt;p&gt;if (mode === 'replace') await clearCollection(getSalesRef());&lt;/p&gt;

&lt;p&gt;const rows = XLSX.utils.sheet_to_json(workbook.Sheets['المبيعات'], { header: 1 });&lt;br&gt;
  for (let i = 1; i &amp;lt; rows.length; i++) {&lt;br&gt;
    const row = rows[i];&lt;br&gt;
    if (row[0]) {&lt;br&gt;
      await addSale({&lt;br&gt;
        product: String(row[0] || ''),&lt;br&gt;
        customer: String(row[1] || ''),&lt;br&gt;
        amount: parseFloat(row[2]) || 0,&lt;br&gt;
        date: String(row[3] || new Date().toISOString().split('T')[0])&lt;br&gt;
      });&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Spider Web Background (Canvas)
I added an animated canvas background for that cyberpunk feel:
JavaScript
const NODES = 70, CONN_DIST = 160;
let nodes = [];&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;function draw() {&lt;br&gt;
  ctx.clearRect(0, 0, W, H);&lt;br&gt;
  for (let i = 0; i &amp;lt; nodes.length; i++) {&lt;br&gt;
    for (let j = i + 1; j &amp;lt; nodes.length; j++) {&lt;br&gt;
      const d = dist(nodes[i], nodes[j]);&lt;br&gt;
      if (d &amp;lt; CONN_DIST) {&lt;br&gt;
        const alpha = (1 - d / CONN_DIST) * 0.25;&lt;br&gt;
        ctx.strokeStyle = &lt;code&gt;rgba(124,58,237,${alpha})&lt;/code&gt;;&lt;br&gt;
        ctx.beginPath();&lt;br&gt;
        ctx.moveTo(nodes[i].x, nodes[i].y);&lt;br&gt;
        ctx.lineTo(nodes[j].x, nodes[j].y);&lt;br&gt;
        ctx.stroke();&lt;br&gt;
      }&lt;br&gt;
    }&lt;br&gt;
  }&lt;br&gt;
  requestAnimationFrame(draw);&lt;br&gt;
}&lt;br&gt;
Challenges I Faced&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;RTL Layout
Building a right-to-left dashboard in Arabic meant reversing everything — sidebar on the right, text alignment, flex directions. CSS logical properties helped, but I ended up using a lot of custom adjustments.&lt;/li&gt;
&lt;li&gt;Single-File Architecture
Keeping everything in one index.html file (HTML + CSS + JS) was challenging for organization. I used clear section comments and kept CSS variables at the top for easy theming.&lt;/li&gt;
&lt;li&gt;Firebase Security Rules
Since this is a client-side app, I had to carefully set up Firestore security rules to ensure users can only access their own data:
plain
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId}/{document=**} {
  allow read, write: if request.auth != null &amp;amp;&amp;amp; request.auth.uid == userId;
}
}
}
What I Learned
Vanilla JS is powerful — You don't always need a framework
Firebase makes backend easy — Auth and database in minutes
Design matters — A good UI makes simple features look professional
Single-file deployment is underrated — No build step = no headaches
What's Next?
[ ] Add dark/light mode toggle
[ ] Add PDF report generation
[ ] Add more chart types (pie, doughnut)
[ ] Build a React version for comparison
[ ] Add Stripe integration for payments tracking
Try It Yourself
Live Demo: &lt;a href="https://engmmmar6-bit.github.io/Vertex-Dashboard/" rel="noopener noreferrer"&gt;https://engmmmar6-bit.github.io/Vertex-Dashboard/&lt;/a&gt;
GitHub Repo: &lt;a href="https://github.com/engmmmar6-bit/Vertex-Dashboard" rel="noopener noreferrer"&gt;https://github.com/engmmmar6-bit/Vertex-Dashboard&lt;/a&gt;
Star the repo if you found it useful!
Connect With Me
I'm learning and building in public. If you have feedback, suggestions, or just want to say hi — drop a comment below!
Built with  by Omar
This is my first "build in public" project. If you're a beginner, just start building. You don't need to know everything — you just need to start.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>firebase</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
