<?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>Forem: Mayank Chawdhari</title>
    <description>The latest articles on Forem by Mayank Chawdhari (@mayankchawdhari).</description>
    <link>https://forem.com/mayankchawdhari</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1121512%2Fb2a91e4d-259c-4700-96d8-b0114899dcac.jpeg</url>
      <title>Forem: Mayank Chawdhari</title>
      <link>https://forem.com/mayankchawdhari</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mayankchawdhari"/>
    <language>en</language>
    <item>
      <title>YT Poller — Build a fast, cache-first YouTube feed (PHP + JS)</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Fri, 30 Jan 2026 02:59:01 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/yt-poller-build-a-fast-cache-first-youtube-feed-php-js-4cgj</link>
      <guid>https://forem.com/mayankchawdhari/yt-poller-build-a-fast-cache-first-youtube-feed-php-js-4cgj</guid>
      <description>&lt;p&gt;&lt;em&gt;By Mayank Chawdhari — a practical guide to setup, deploy, and embed a production-ready YouTube RSS poller.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo8k5h6v7k3n7jr586pya.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo8k5h6v7k3n7jr586pya.png" alt="YT POLLER INDEX PAGE, 5 DIFFRENT THEMES TO SELECT FROM" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; YT Poller fetches a YouTube channel RSS feed, parses it, stores a JSON cache (atomic writes + locking), and exposes a small HTTP API (&lt;code&gt;/api/get_videos.php&lt;/code&gt;). A themeable frontend (&lt;code&gt;index.php&lt;/code&gt;) and a documentation/instructions page (&lt;code&gt;setup.php&lt;/code&gt;) make integration trivial. Use a cron job to pre-warm cache and serve instant results to visitors. This post explains why this architecture is fast and SEO-friendly, how the pieces fit together, and step-by-step instructions to get it running and hosted (including static GitHub Pages usage for the docs/UI).&lt;/p&gt;




&lt;h2&gt;
  
  
  Why YT Poller (short, practical reasons)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Avoids on-demand network fetches to YouTube when visitors arrive — reduced latency and increased reliability.&lt;/li&gt;
&lt;li&gt;Pre-warmed cache + small JSON payload = fast pages and better Core Web Vitals.&lt;/li&gt;
&lt;li&gt;No API keys required (uses YouTube RSS), so it’s easy to deploy and maintain.&lt;/li&gt;
&lt;li&gt;The API returns JSON only (no HTML errors), so frontends behave predictably.&lt;/li&gt;
&lt;li&gt;Easy to embed on any site: client-side snippet or server-side pre-warm via cron.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;PHP 7.4+ / 8.x with &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;simplexml&lt;/code&gt; enabled.&lt;/li&gt;
&lt;li&gt;Web server (Apache / Nginx / PHP-FPM) or a host that runs PHP.&lt;/li&gt;
&lt;li&gt;Ability to run cron jobs (or other scheduler).&lt;/li&gt;
&lt;li&gt;Optional: GitHub account (for Pages), Docker (if you want containerization).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Project overview — structure &amp;amp; responsibilities
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/
├─ index.php           # themeable UI (client)
├─ setup.php           # documentation &amp;amp; integration generator (keep this as your docs page)
├─ api/get_videos.php  # API gateway (validate, cache, fetch fallback)
├─ includes/
│  ├─ config.php       # settings: default TTL, cache_dir, allowed_origins, default_channel (optional)
│  ├─ cache.php        # atomic file cache helper (read/write)
│  └─ fetcher.php      # channel resolver, feed builder, fetcher, RSS parser
└─ cache/               # JSON cache files and runtime logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  How it works (brief)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Frontend requests &lt;code&gt;/api/get_videos.php?channel=...&amp;amp;limit=...&amp;amp;ttl=...&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;API validates input and checks cache. If cache is fresh, return it.&lt;/li&gt;
&lt;li&gt;If stale/forced, server uses &lt;code&gt;fetcher.php&lt;/code&gt; to resolve channel (UC id), build a reliable RSS URL, fetch feed via cURL, parse with SimpleXML, then write JSON to cache atomically.&lt;/li&gt;
&lt;li&gt;API always returns JSON; on fetch failure it falls back to previous cache (if present) or returns a clear &lt;code&gt;fetch_failed&lt;/code&gt; error with HTTP status.&lt;/li&gt;
&lt;li&gt;Optionally run a server-side cron (&lt;code&gt;prime_cache.php&lt;/code&gt;) to force fetch and pre-warm cache.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Key implementation notes (you can copy these into docs or README)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;includes/cache.php&lt;/code&gt; — atomic JSON writes (safe)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sanitizes channel id for filename.&lt;/li&gt;
&lt;li&gt;Writes to a &lt;code&gt;.tmp&lt;/code&gt; then &lt;code&gt;rename()&lt;/code&gt; (atomic on POSIX).&lt;/li&gt;
&lt;li&gt;Uses &lt;code&gt;flock()&lt;/code&gt; for exclusive lock during write.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Important behavior: robust to partial writes and concurrent access.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;includes/fetcher.php&lt;/code&gt; — channel resolution + RSS parsing
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Accepts many channel forms: &lt;code&gt;UC...&lt;/code&gt;, full channel URL, &lt;code&gt;@handle&lt;/code&gt;, &lt;code&gt;/c/username&lt;/code&gt; etc.&lt;/li&gt;
&lt;li&gt;Resolves to the canonical &lt;code&gt;UC...&lt;/code&gt; id (recommended approach: use YouTube oEmbed or author_url detection server-side).&lt;/li&gt;
&lt;li&gt;Builds RSS URL: &lt;code&gt;https://www.youtube.com/feeds/videos.xml?channel_id=UC...&lt;/code&gt; (this is the reliable canonical RSS endpoint).&lt;/li&gt;
&lt;li&gt;Uses cURL with sensible defaults (timeout, follow redirects, user agent) and &lt;code&gt;simplexml_load_string()&lt;/code&gt; to parse RSS.&lt;/li&gt;
&lt;li&gt;Extracts &lt;code&gt;videoId&lt;/code&gt;, &lt;code&gt;title&lt;/code&gt;, &lt;code&gt;published&lt;/code&gt;, &lt;code&gt;thumbnails&lt;/code&gt;, etc., into a simple array suitable for JSON.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;code&gt;api/get_videos.php&lt;/code&gt; — the small API gateway
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Central responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input validation and sanitization&lt;/li&gt;
&lt;li&gt;CORS header support (configured via &lt;code&gt;includes/config.php&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Cache TTL logic and server-side minimum fetch interval (throttling)&lt;/li&gt;
&lt;li&gt;Safe error handling (exceptions/errors converted to JSON payloads, not HTML 502 pages)&lt;/li&gt;
&lt;li&gt;Fallback to cached payload if fetch fails&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Production tips:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set &lt;code&gt;YTPOLLER_DEV&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; in production to hide stack traces.&lt;/li&gt;
&lt;li&gt;Limit &lt;code&gt;allowed_origins&lt;/code&gt; to your domain in &lt;code&gt;includes/config.php&lt;/code&gt; to avoid open CORS in prod.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Quick install (5–10 minutes)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone repo:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/BOSS294/yt-poller.git
&lt;span class="nb"&gt;cd &lt;/span&gt;yt-poller
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Ensure PHP + extensions:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-m&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s2"&gt;"curl|simplexml"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create and secure cache dir:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; cache
&lt;span class="nb"&gt;chown &lt;/span&gt;www-data:www-data cache        &lt;span class="c"&gt;# adapt to your server user&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;750 cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Configure (optional): edit &lt;code&gt;includes/config.php&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;object&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;
  &lt;span class="s1"&gt;'default_ttl'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'max_ttl'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;86400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'cache_dir'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;__DIR__&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;'/../cache'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'allowed_origins'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'https://yourdomain.com'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="s1"&gt;'user_agent'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'YT-Poller/1.0 (+https://yourdomain.example)'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'min_fetch_interval'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s1"&gt;'default_limit'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="c1"&gt;// optional default channel:&lt;/span&gt;
  &lt;span class="c1"&gt;// 'default_channel' =&amp;gt; 'UC_xxxxxxxxxxxxx',&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Upload to PHP host or run locally for testing:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-S&lt;/span&gt; 0.0.0.0:8000
&lt;span class="c"&gt;# Visit http://localhost:8000/setup.php to read the docs page and generate snippets&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Recommended cron: pre-warm cache
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;cron/prime_cache.php&lt;/code&gt; (or use the snippet in &lt;code&gt;setup.php&lt;/code&gt;) and add to crontab:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cron/prime_cache.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="nv"&gt;$channel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"UC_xxxxxxxxx"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// your channel&lt;/span&gt;
&lt;span class="nv"&gt;$api&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://yourdomain.com/api/get_videos.php"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$api&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="s1"&gt;'?channel='&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;urlencode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$channel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="s1"&gt;'&amp;amp;ttl=3600&amp;amp;limit=20&amp;amp;force=1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$ch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;curl_init&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;curl_setopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CURLOPT_RETURNTRANSFER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;curl_exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;curl_close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$ch&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Done&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Crontab entry (every 15 minutes):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;*/15 * * * * /usr/bin/php /path/to/cron/prime_cache.php &amp;gt;/dev/null 2&amp;gt;&amp;amp;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose TTL and cron frequency sensibly. For low-frequency channels, longer TTL (1h–24h) might be OK. For active channels, 5–15 minutes is common.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;force=1&lt;/code&gt; in cron so it bypasses TTL and fetches fresh.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GITHUB REPO : &lt;a href="https://github.com/BOSS294/yt-poller" rel="noopener noreferrer"&gt;https://github.com/BOSS294/yt-poller&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>youtuberss</category>
      <category>rss</category>
      <category>javascript</category>
    </item>
    <item>
      <title>What developers always miss when building color schemes (and how to fix it)</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Sun, 18 Jan 2026 18:14:10 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/what-developers-always-miss-when-building-color-schemes-and-how-to-fix-it-38ml</link>
      <guid>https://forem.com/mayankchawdhari/what-developers-always-miss-when-building-color-schemes-and-how-to-fix-it-38ml</guid>
      <description>&lt;p&gt;Color is not decoration. It’s hierarchy, affordance, accessibility, and mood — all encoded in tiny hexes. Ship a color system, not a handful of random swatches. Below is a ready-to-publish Dev.to post in Markdown you can copy, paste, and publish as-is.&lt;/p&gt;




&lt;h2&gt;
  
  
  Stop treating color like an afterthought — a practical guide to color systems for devs
&lt;/h2&gt;

&lt;p&gt;Too many apps pick a primary color, slap it on buttons, and call it a day. The result: inconsistent UIs, accessibility failures, and a product that feels half-baked. This post lays out the subtle—but high-impact—things developers routinely forget when designing color systems, plus practical rules, copy-paste tokens, and an accessibility checklist you can run before launch.&lt;/p&gt;




&lt;h2&gt;
  
  
  What most devs miss (quick list)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Semantic tokens, not “random hexes”&lt;/strong&gt; — colors should represent roles (background, surface, primary, success, border), not only components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contrast &amp;amp; accessibility&lt;/strong&gt; — color choices must work for low-vision and color-blind users, not just look pretty on a monitor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State &amp;amp; scale&lt;/strong&gt; — every semantic color needs &lt;code&gt;base&lt;/code&gt;, &lt;code&gt;hover&lt;/code&gt;, &lt;code&gt;active&lt;/code&gt;, &lt;code&gt;disabled&lt;/code&gt;, and &lt;code&gt;on&lt;/code&gt; (text-on-color) variants.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Color-only meaning&lt;/strong&gt; — never rely on color alone to convey status; pair with iconography, labels, or patterns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dark mode parity&lt;/strong&gt; — dark theme is a first-class citizen; don’t just invert light values.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Saturation &amp;amp; chroma control&lt;/strong&gt; — tame saturation for large surfaces; reserve high chroma for CTAs and micro-interactions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token naming &amp;amp; design tokens&lt;/strong&gt; — name by role (&lt;code&gt;--color-surface&lt;/code&gt;) not by hue (&lt;code&gt;--blue-500&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Device gamut awareness&lt;/strong&gt; — wide-gamut displays (P3) make colors pop; design defensively so things don’t blow out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visible focus &amp;amp; keyboard affordances&lt;/strong&gt; — ensure focus rings remain legible on all backgrounds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing &amp;amp; tooling&lt;/strong&gt; — integrate contrast checks and color-blind simulators into QA.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Concrete rules — how to build a reliable color system
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Layer your tokens&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Foundational tokens:&lt;/em&gt; hue/saturation/lightness values for brand and feedback colors.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Semantic tokens:&lt;/em&gt; &lt;code&gt;--color-surface&lt;/code&gt;, &lt;code&gt;--color-primary&lt;/code&gt;, &lt;code&gt;--color-border&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Component tokens:&lt;/em&gt; &lt;code&gt;--btn-primary-bg&lt;/code&gt; references &lt;code&gt;--color-primary&lt;/code&gt;.

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use HSL&lt;/strong&gt; (or CSS color functions): tunable — changing lightness or saturation produces consistent tints/shades.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provide states&lt;/strong&gt;: for each semantic color include &lt;code&gt;base&lt;/code&gt;, &lt;code&gt;on&lt;/code&gt; (text), &lt;code&gt;hover&lt;/code&gt;, &lt;code&gt;active&lt;/code&gt;, &lt;code&gt;disabled&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prefer off-white / off-black&lt;/strong&gt;: &lt;code&gt;#fff&lt;/code&gt; and &lt;code&gt;#000&lt;/code&gt; are harsh. Slightly off values reduce eye strain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test contrast for real text sizes&lt;/strong&gt; (WCAG AA as minimum for body text).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don’t rely on color alone&lt;/strong&gt; for statuses — add icons, text, or patterns.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design dark mode independently&lt;/strong&gt; — adjust saturation and lightness; don’t blindly invert.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make tokens available to designers and devs&lt;/strong&gt; (JSON/CSS exports) so both sides use the same source of truth.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Copy-paste CSS starter (semantic tokens + states)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* 1) Base HSL tokens (role-based, tuneable) */&lt;/span&gt;
&lt;span class="nd"&gt;:root&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Brand / primary in HSL */&lt;/span&gt;
  &lt;span class="py"&gt;--primary-h&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;210&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--primary-s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;88%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--primary-l&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;52%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c"&gt;/* Feedback hues */&lt;/span&gt;
  &lt;span class="py"&gt;--success-h&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;140&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--success-s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;55%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--success-l&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;38%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="py"&gt;--error-h&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--error-s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;84%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--error-l&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;48%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c"&gt;/* Neutral scale (store as H S% L% strings when helpful) */&lt;/span&gt;
  &lt;span class="py"&gt;--neutral-0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0%&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c"&gt;/* white-ish surface */&lt;/span&gt;
  &lt;span class="py"&gt;--neutral-1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;220&lt;/span&gt; &lt;span class="m"&gt;14%&lt;/span&gt; &lt;span class="m"&gt;96%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--neutral-2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;220&lt;/span&gt; &lt;span class="m"&gt;12%&lt;/span&gt; &lt;span class="m"&gt;88%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--neutral-3&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;220&lt;/span&gt; &lt;span class="m"&gt;10%&lt;/span&gt; &lt;span class="m"&gt;72%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;--neutral-4&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;220&lt;/span&gt; &lt;span class="m"&gt;8%&lt;/span&gt; &lt;span class="m"&gt;44%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c"&gt;/* text default */&lt;/span&gt;
  &lt;span class="py"&gt;--neutral-5&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;220&lt;/span&gt; &lt;span class="m"&gt;6%&lt;/span&gt; &lt;span class="m"&gt;10%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c"&gt;/* near black */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* 2) Derived semantic tokens */&lt;/span&gt;
&lt;span class="nd"&gt;:root&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="py"&gt;--color-surface&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--neutral-1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="py"&gt;--color-surface-2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--neutral-2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="py"&gt;--color-text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--neutral-4&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="py"&gt;--color-text-strong&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--neutral-5&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="py"&gt;--color-primary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-h&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-s&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-l&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="py"&gt;--color-primary-hover&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-h&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-s&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;-&lt;/span&gt; &lt;span class="m"&gt;8%&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="py"&gt;--color-primary-active&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-h&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-s&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;calc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--primary-l&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;-&lt;/span&gt; &lt;span class="m"&gt;14%&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="py"&gt;--color-primary-on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="py"&gt;--color-success&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--success-h&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--success-s&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--success-l&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="py"&gt;--color-error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--error-h&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--error-s&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--error-l&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="py"&gt;--color-border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hsl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;220&lt;/span&gt; &lt;span class="m"&gt;10%&lt;/span&gt; &lt;span class="m"&gt;85%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* 3) Component usage example */&lt;/span&gt;
&lt;span class="nc"&gt;.btn&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color-primary&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color-primary-on&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.6rem&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;8px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;transition&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;background&lt;/span&gt; &lt;span class="m"&gt;.12s&lt;/span&gt; &lt;span class="n"&gt;ease&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;transform&lt;/span&gt; &lt;span class="m"&gt;.06s&lt;/span&gt; &lt;span class="n"&gt;ease&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.btn&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color-primary-hover&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;-1px&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.btn&lt;/span&gt;&lt;span class="nd"&gt;:active&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color-primary-active&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;translateY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.btn&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;disabled&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;opacity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;not-allowed&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Quick tips &amp;amp; practical patterns
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Elevation with alpha:&lt;/strong&gt; use subtle alpha overlays (e.g., &lt;code&gt;background: rgba()&lt;/code&gt; / &lt;code&gt;color-mix()&lt;/code&gt; or &lt;code&gt;linear-gradient&lt;/code&gt;) rather than many solid surface colors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reserve saturation for action:&lt;/strong&gt; low saturation on large surfaces; higher saturation for CTAs and micro-interactions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Icon color = text color&lt;/strong&gt; — treat icons as text for accessibility/contrast.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Token naming rule:&lt;/strong&gt; &lt;code&gt;--color-&amp;lt;role&amp;gt;&lt;/code&gt; (e.g., &lt;code&gt;--color-surface&lt;/code&gt;, &lt;code&gt;--color-border&lt;/code&gt;, &lt;code&gt;--color-primary&lt;/code&gt;) — makes intent obvious.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design tokens pipeline:&lt;/strong&gt; export tokens to JSON/CSS and import into Figma/Sketch so design and code stay in sync.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dark mode strategy:&lt;/strong&gt; pick a neutral dark background (not pure black), lower saturation of primaries, raise contrast for text.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Small but high-impact gotchas developers skip
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Disabled states without contrast tests (users can’t read disabled labels).&lt;/li&gt;
&lt;li&gt;Tiny icons with insufficient contrast (icons are UI text too).&lt;/li&gt;
&lt;li&gt;Relying on red/green alone for status—fails for color-blind users.&lt;/li&gt;
&lt;li&gt;Focus rings that disappear on colored backgrounds.&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;#000&lt;/code&gt;/&lt;code&gt;#fff&lt;/code&gt; everywhere instead of pleasant off-black/off-white for better perceived contrast.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Example: focus-visible and accessible error
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* visible focus */&lt;/span&gt;
&lt;span class="nd"&gt;:focus-visible&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;outline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt; &lt;span class="nb"&gt;solid&lt;/span&gt; &lt;span class="n"&gt;color-mix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;srgb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color-primary&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;80%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;white&lt;/span&gt; &lt;span class="m"&gt;20%&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;outline-offset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* error state with icon + label */&lt;/span&gt;
&lt;span class="nc"&gt;.input--error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;border-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color-error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="m"&gt;3px&lt;/span&gt; &lt;span class="n"&gt;color-mix&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;srgb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color-error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="m"&gt;8%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;transparent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.error-msg&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="py"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.5rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;align-items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;--color-error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;.9rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Color is not an afterthought — it’s a system. Treat it like one: define semantic tokens, plan states (hover/active/disabled/on), and design dark mode intentionally. Make accessibility (contrast, color-blind checks, visible focus) a non-negotiable part of your workflow, not an optional QA step. Small, deliberate color decisions — saturation, context, and naming — are what separate a hurried UI from a polished, inclusive product. Ship the system, not just a swatch.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
    </item>
    <item>
      <title>CamSecure V2 – Advanced Web-Based Surveillance for Modern Security Needs</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Sun, 10 Aug 2025 08:47:47 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/camsecure-v2-advanced-web-based-surveillance-for-modern-security-needs-o70</link>
      <guid>https://forem.com/mayankchawdhari/camsecure-v2-advanced-web-based-surveillance-for-modern-security-needs-o70</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr57vsp3r6fc8b5wqw6xk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr57vsp3r6fc8b5wqw6xk.png" alt="CAM SECURE WEB INTERFACE" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feddrlgkondcqj8lvclsi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feddrlgkondcqj8lvclsi.png" alt="CAM SECURE WEB INTERFACE" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Inspired by a real horror story. Built for unmatched privacy and advanced security.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Story
&lt;/h2&gt;

&lt;p&gt;Late one night, I experienced the kind of horror no security professional expects: undefined motion, chilling noises, and a sense that something dangerous was in my workspace. My standard security system didn’t react fast enough. That night inspired the creation of &lt;strong&gt;CamSecure V2&lt;/strong&gt;—a surveillance system that actively detects, analyzes, and documents every unusual occurrence, giving complete control and peace of mind.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Features Overview
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Visual Capture&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Live Feed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Real-time video stream with instant motion highlighting&lt;/td&gt;
&lt;td&gt;✅ All motion events&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Room Scan&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Detects, marks, and screenshots faces in predefined zones (entry/exit points)&lt;/td&gt;
&lt;td&gt;✅ Faces in zones&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Thermal Mode&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Thermal-like view pinpoints anomalies and unusual heat signatures&lt;/td&gt;
&lt;td&gt;✅ Anomaly screenshots&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Advanced Feed&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Zooms into detected people, analyzes bodies, faces, emotions, and marks threat activity&lt;/td&gt;
&lt;td&gt;✅ Zoom/threat shots&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Motion Heatmap&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Shows where activity frequently occurs within the camera view over time&lt;/td&gt;
&lt;td&gt;✅ Heatmap images&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Threat Logging&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Every suspicious movement, heavy motion, or threat is screenshotted and logged automatically&lt;/td&gt;
&lt;td&gt;✅ Snapshots + logs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Simple Motion Log&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Even minor motion is captured and recorded for user review&lt;/td&gt;
&lt;td&gt;✅ Screenshots&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Audio Monitoring&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Optional monitoring of spikes in sound or suspicious audio patterns&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Network &amp;amp; Device Health&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Real-time metrics for connection and system status&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Web Dashboard&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Intuitive, multi-stream dashboard for instant switching and event management&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Privacy-first&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Local-only storage and processing; absolutely no cloud&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Why CamSecure V2 is Different
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Screenshots for Every Event:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Every heavy motion and simple movement is screenshotted and logged, so you have clear visual records—not just data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Advanced feed zooms into people:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Detects people (bodies/faces), automatically focuses and zooms the stream for identification and incident review.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Heatmap Analytics:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Track which parts of your space are most active. Spot risks, patterns, and vulnerabilities instantly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Instant Threat Detection:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Unusual activity—from fire or smoke to unauthorized presence—is detected, marked, and logged with severity levels.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Privacy by Design:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Nothing leaves your device. All data, images, and logs are stored locally.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Professional Technology Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python &amp;amp; Flask:&lt;/strong&gt; Fast, reliable web backend and API&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenCV &amp;amp; NumPy:&lt;/strong&gt; Industry-standard for vision and processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML5, CSS, JavaScript:&lt;/strong&gt; Modern, responsive web interface&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DeepFace (optional):&lt;/strong&gt; Deep learning analysis of faces/emotions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;psutil, sounddevice (optional):&lt;/strong&gt; Device and audio metrics&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure local exports:&lt;/strong&gt; CSV and snapshot files for review and reporting&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Designed for Real Security Needs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Perfect for homes, labs, makerspaces, workshops, and professionals&lt;/li&gt;
&lt;li&gt;4 simultaneous video feeds for flexible monitoring&lt;/li&gt;
&lt;li&gt;Admin panel: review, export, and manage threats/logs&lt;/li&gt;
&lt;li&gt;Network and device health monitoring—know your system is stable&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Makes CamSecure V2 Unique?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inspired by fear, built for proof.&lt;/strong&gt; My own unexplained experience led to a system where nothing is missed, and every threat is automatically documented.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High-quality evidence.&lt;/strong&gt; Snapshots and logs of all suspicious activity—heavy and minor—mean you’re always in control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instant analytics.&lt;/strong&gt; Heatmaps, zone-based detection, threat logs, all available in one user-friendly dashboard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Totally local, totally secure.&lt;/strong&gt; Your privacy is never compromised.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Your Feedback Fuels Development
&lt;/h2&gt;

&lt;p&gt;Have you faced a security scare? Do you need analytics, privacy, or flexible monitoring? CamSecure V2 is evolving based on real feedback from users like you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Share your story, suggest a feature, or ask for a demo in the comments below!&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;CamSecure V2 — Because the real horror is what goes unseen.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This is a private, local-only project. For more about the technology, interface, or the horror story itself, connect in the comments or DM.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>mayankchawdhari</category>
      <category>python</category>
      <category>security</category>
    </item>
    <item>
      <title>Inside DebtMatePro V2: Dashboard Page</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Mon, 21 Apr 2025 10:10:53 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/inside-debtmatepro-v2-dashboard-page-3nic</link>
      <guid>https://forem.com/mayankchawdhari/inside-debtmatepro-v2-dashboard-page-3nic</guid>
      <description>&lt;h3&gt;
  
  
  Clients Dashboard
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7o5vma0losoi9n9q1pdu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7o5vma0losoi9n9q1pdu.png" alt="This Panel Dashboard page combines cutting-edge asynchronous data fetching, responsive design patterns, and engaging animations. Every element—from the dynamic greeting to the detailed metric and feature cards—has been crafted to ensure that users receive a comprehensive, user-friendly, and visually appealing overview of their account and system performance at a glance." width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Overview:
&lt;/h1&gt;

&lt;p&gt;This page serves as a comprehensive and dynamic Panel Dashboard designed to provide real-time insight into key account and system metrics. It fuses modern design elements, smooth animations, and responsive layouts to deliver an exceptional user experience.&lt;/p&gt;

&lt;h1&gt;
  
  
  Greeting Section:
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Dynamic Greeting &amp;amp; Date/Time:
&lt;/h2&gt;

&lt;p&gt;A greeting block dynamically updates to display a personalized welcome message ("Welcome Back, Good [Morning/Afternoon/Evening]") based on the current IST time.&lt;/p&gt;

&lt;p&gt;The current date is shown in bold green, while the time is segmented into hours/minutes and seconds—with seconds highlighted in red—offering a clear, real-time display.&lt;/p&gt;

&lt;h1&gt;
  
  
  Metric Cards Section:
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Data Visualization:
&lt;/h2&gt;

&lt;p&gt;The dashboard leverages a grid layout to present various data cards. Each card displays a specific metric (e.g., Total Debtors, Recorded Debt, Calls over various periods, Documents, Version, API Status, Logs).&lt;br&gt;
Icons from Material Icons are used alongside each metric, providing a visual cue that complements the textual information.&lt;/p&gt;

&lt;h2&gt;
  
  
  Interactivity &amp;amp; Feedback:
&lt;/h2&gt;

&lt;p&gt;Every card features a subtle shadow and 3D-tilt effect upon hover, improving the tactile feel of the dashboard.&lt;br&gt;
A tooltip appears when hovering over a card, offering additional details about each metric (e.g., “Outstanding balance” for Recorded Debt).&lt;br&gt;
Some metrics (like Recorded Debt) are conditionally styled with specific colors (e.g., red for critical values) to attract user attention.&lt;br&gt;
Panel Features Section:&lt;/p&gt;

&lt;h1&gt;
  
  
  Real-Time Data &amp;amp; Updates:
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Asynchronous Fetching:
&lt;/h2&gt;

&lt;p&gt;The dashboard fetches analytics data asynchronously from a backend API endpoint at regular intervals (every 6 seconds) ensuring that the displayed metrics remain up-to-date.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scheduled Time Updates:
&lt;/h2&gt;

&lt;p&gt;A JavaScript function updates the IST date and time every second, ensuring that users always see the current time without having to refresh the page.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>websoftware</category>
      <category>programming</category>
      <category>api</category>
    </item>
    <item>
      <title>Implementation of Folder and Image Upload System with Database Integration</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Mon, 10 Feb 2025 12:44:33 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/implementation-of-folder-and-image-upload-system-with-database-integration-542n</link>
      <guid>https://forem.com/mayankchawdhari/implementation-of-folder-and-image-upload-system-with-database-integration-542n</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This is integrated in one of my projects&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Overview:&lt;/strong&gt;
&lt;/h3&gt;
&lt;/blockquote&gt;

&lt;p&gt;Introducing a robust system for handling &lt;strong&gt;image uploads&lt;/strong&gt; and &lt;strong&gt;folder creation&lt;/strong&gt; with full validation, processing, and database integration. The system includes checks for user authentication, file handling (with image format conversion), folder creation, and the insertion of relevant metadata into the database. The system ensures that uploaded images are stored efficiently and the user is provided with structured feedback on success or failure.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Key Features Implemented:&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;User Authentication Validation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script starts by ensuring the user is authenticated. If the session does not contain the &lt;code&gt;aUsername&lt;/code&gt; variable, an error message is returned in JSON format, halting the script's execution. This ensures that only authorized users can interact with the image upload process.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Folder Creation and Validation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The system checks if the &lt;strong&gt;base upload directory&lt;/strong&gt; (&lt;code&gt;Resources/PropertiesMedia&lt;/code&gt;) exists. If not, the script responds with an error, indicating the missing directory.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;folder name&lt;/strong&gt; provided in the request is validated and sanitized to only include alphanumeric characters, dashes, and underscores. If no folder name is provided, the script returns an error indicating the missing folder name.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Folder Directory Creation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the target folder doesn’t exist, the script attempts to create the folder inside the base directory using appropriate permissions (&lt;code&gt;0755&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The folder name is dynamically generated based on the sanitized input, and if folder creation fails, the script returns an error message indicating the failure.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;File Upload Validation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script verifies that &lt;strong&gt;exactly 7 files&lt;/strong&gt; are uploaded by checking the &lt;code&gt;$_FILES&lt;/code&gt; array. If the number of files differs from 7, the system halts and returns an error message indicating how many files were uploaded versus the expected number.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Image Processing with Conversion (WebP):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The system checks whether the &lt;strong&gt;GD extension&lt;/strong&gt; is available, enabling image conversion.&lt;/li&gt;
&lt;li&gt;If the GD extension is available, uploaded images are converted to &lt;strong&gt;WebP format&lt;/strong&gt; (with 80% quality), making them more optimized for web usage.&lt;/li&gt;
&lt;li&gt;For unsupported formats or when GD is not available, the image is saved in its original format, and the process continues.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Random String Generation for Image Filenames:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To ensure &lt;strong&gt;unique filenames&lt;/strong&gt; and avoid conflicts, a helper function generates a random string (5 characters by default). This random string is appended to the file name before storing it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;File Handling:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each uploaded file is moved to the newly created folder. The script calculates the &lt;strong&gt;total size&lt;/strong&gt; of all uploaded images and accumulates it as the total size of the folder.&lt;/li&gt;
&lt;li&gt;For each uploaded image, the script also collects metadata (image name, URL, quality, and size) to insert into the database.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Database Integration:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Folder Metadata:&lt;/strong&gt; Once the images are uploaded, metadata about the folder (name, assigned user, quality, and size) is inserted into the &lt;code&gt;property_media_folders&lt;/code&gt; table. This creates a record of the folder and its details in the database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image Metadata:&lt;/strong&gt; For each image, metadata including the name, URL, quality, and size is inserted into the &lt;code&gt;property_images&lt;/code&gt; table. The images are linked to the folder they were uploaded to by associating them with the folder name.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Error Handling and Feedback:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script contains multiple layers of &lt;strong&gt;error handling&lt;/strong&gt; for various stages, including:

&lt;ul&gt;
&lt;li&gt;Missing or invalid folder name.&lt;/li&gt;
&lt;li&gt;Incorrect number of files uploaded.&lt;/li&gt;
&lt;li&gt;Unsupported image formats.&lt;/li&gt;
&lt;li&gt;GD extension availability.&lt;/li&gt;
&lt;li&gt;Folder creation failures.&lt;/li&gt;
&lt;li&gt;Database insertion failures.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured JSON responses&lt;/strong&gt; provide clear feedback to the user, whether successful or error messages are returned.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Response Message:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If all operations (folder creation, file uploads, and database insertions) are successful, the script returns a &lt;strong&gt;success message&lt;/strong&gt; with details about the folder and the images that were processed.&lt;/li&gt;
&lt;li&gt;If any part of the process fails, an &lt;strong&gt;error message&lt;/strong&gt; is returned, describing the issue and halting further execution.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Detailed Explanation of Each Process:&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;1. User Authentication:&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;The script verifies the session for the &lt;code&gt;aUsername&lt;/code&gt; key. If not found, it immediately returns an error in JSON format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ERROR"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"User not authenticated."&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;2. Folder Validation:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The folder name is sanitized using &lt;code&gt;preg_replace&lt;/code&gt; to ensure it only contains alphanumeric characters, dashes, and underscores.&lt;/li&gt;
&lt;li&gt;If the base directory doesn't exist, an error response is returned:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Base upload directory not found."&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If the folder name is missing, the script returns:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Folder name is required."&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;3. File Upload Validation:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The system checks that exactly &lt;strong&gt;7 files&lt;/strong&gt; are uploaded. If not, the script responds:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Exactly 7 images must be uploaded. Received: X"&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;4. Image Conversion:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;If the &lt;strong&gt;GD extension&lt;/strong&gt; is available, uploaded images are processed and converted into &lt;strong&gt;WebP format&lt;/strong&gt;. The response message indicates whether the images were converted to WebP or saved in their original format.&lt;/li&gt;
&lt;li&gt;If GD is not available, the images are simply moved to the directory without conversion.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;5. Database Integration:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;folder metadata&lt;/strong&gt; is inserted into the database with the following SQL statement:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;   &lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;property_media_folders&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;FolderID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FolderName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FolderAssignedTo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ImageQuality&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;Size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(:&lt;/span&gt;&lt;span class="n"&gt;FolderID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;FolderName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;FolderAssignedTo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;ImageQuality&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;Size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Image metadata is inserted into the &lt;code&gt;property_images&lt;/code&gt; table for each image:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;   &lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;property_images&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Image_Name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Image_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;AssignedToFolder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ImageQuality&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ImageSize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt; &lt;span class="p"&gt;(:&lt;/span&gt;&lt;span class="n"&gt;Image_Name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;Image_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;AssignedToFolder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;ImageQuality&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;ImageSize&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;6. Response Example:&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Success response&lt;/strong&gt; with the following structure:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"success"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"message"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Files uploaded successfully. Images converted to WebP."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"folder"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"example_folder_name"&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Error response&lt;/strong&gt; with an appropriate message indicating the specific issue encountered.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This provides a comprehensive solution for managing image uploads and folder creation, along with robust file handling and conversion (if applicable). It integrates with a backend database to store relevant metadata and ensures proper error handling and validation throughout the process. This system is designed to be reliable, efficient, and secure, providing clear feedback to users.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsg9uz8m5yq6tezmqnu4f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsg9uz8m5yq6tezmqnu4f.png" alt="Mayank Chawdhari" width="800" height="462"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmrufcccfrlhjftde5yw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frmrufcccfrlhjftde5yw.png" alt="Mayank Chawdhari" width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8q7dj04qkyh1xq345aup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8q7dj04qkyh1xq345aup.png" alt="Mayank Chawdhari" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm18j9e7w0jospo01epx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm18j9e7w0jospo01epx.png" alt="Mayank Chawdhari" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Web-Scrapper-Python</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Tue, 04 Feb 2025 22:40:30 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/web-scrapper-python-i4</link>
      <guid>https://forem.com/mayankchawdhari/web-scrapper-python-i4</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqccpjjm7t4vbnhe408bn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqccpjjm7t4vbnhe408bn.png" alt="Web Scrapper Python" width="800" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This project is a &lt;strong&gt;powerful web scraper&lt;/strong&gt; built using Python. It is designed to efficiently extract metadata, download images, fetch links, and store the collected data in both CSV and JSON formats for further use. Additionally, the scraper features a &lt;strong&gt;Tkinter-based GUI&lt;/strong&gt; that provides a user-friendly interface, making it accessible to both developers and non-programmers. With support for multithreading, the tool ensures high performance and quick data processing even on websites with a large number of links and images.&lt;/p&gt;




&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Extracts Metadata:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Retrieves key information from webpages, including the page title, meta descriptions, keywords, OpenGraph tags, and Twitter metadata. This functionality is essential for tasks like SEO analysis, content research, and competitive analysis.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Downloads Images:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Automatically downloads all images found on the target website. The images are stored in structured folders based on the site name, ensuring clarity and easy access. Duplicate images are avoided to optimize storage and reduce redundant data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fetches All Links:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Extracts all hyperlinks present on a webpage and processes each link to gather additional metadata. This enables users to perform a comprehensive site crawl and data extraction from multiple pages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Saves Data in CSV and JSON:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The scraped data is stored in both CSV and JSON formats inside a structured directory (&lt;code&gt;SITE/{site_name}&lt;/code&gt;). This dual-format output facilitates seamless integration with various data analysis tools and workflows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multithreading for High Performance:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Leveraging Python’s multithreading capabilities, the scraper can process multiple links and download images concurrently. This significantly reduces the total execution time, making it ideal for large-scale web scraping tasks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GUI Interface:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A modern, aesthetically pleasing Tkinter-based graphical user interface allows users to enter the URL, initiate the scraping process, and view real-time log updates. The built-in console log displays progress updates, errors, and other important messages, enhancing the user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error Handling and Logging:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The scraper is equipped with comprehensive error handling using custom logging functions that display messages in different colors based on the type of notification (e.g., errors, warnings, progress updates). This makes troubleshooting easier and improves overall usability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Functions Explained
&lt;/h2&gt;

&lt;p&gt;The project is structured into two main components: &lt;strong&gt;scraper_functions.py&lt;/strong&gt; (which contains all the backend scraping logic) and &lt;strong&gt;main.py&lt;/strong&gt; (which builds the GUI and manages user interaction). Below is a detailed breakdown of the functions included in the project:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get_page_info(url)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Extracts metadata from a given webpage. &lt;br&gt; &lt;strong&gt;Details:&lt;/strong&gt; Sends an HTTP request to the URL and parses the returned HTML using BeautifulSoup. Retrieves the page title and meta tags such as description, keywords, OpenGraph, and Twitter data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sanitize_filename(filename)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Ensures file names are safe for use on any operating system. &lt;br&gt; &lt;strong&gt;Details:&lt;/strong&gt; Removes any invalid characters (e.g., `&amp;lt;&amp;gt;:"/\&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;{% raw %}&lt;code&gt;download_images(url, folder_name, downloaded_images, log_func)&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Downloads images from a webpage. &lt;br&gt; &lt;strong&gt;Details:&lt;/strong&gt; Retrieves all &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tags from the page, constructs absolute URLs for relative paths, and downloads each image if not already downloaded. Images are stored in a dedicated media folder.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;save_to_csv(data, site_name)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Saves the scraped data in CSV format. &lt;br&gt; &lt;strong&gt;Details:&lt;/strong&gt; Organizes data into rows and writes it into a CSV file under the directory &lt;code&gt;SITE/{site_name}&lt;/code&gt;, making the data easily accessible for further analysis or reporting.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;save_to_json(data, site_name)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Saves the scraped data in JSON format. &lt;br&gt; &lt;strong&gt;Details:&lt;/strong&gt; Dumps the data into a JSON file with proper indentation and formatting, stored under &lt;code&gt;SITE/{site_name}&lt;/code&gt;. This is useful for integrations with other applications or APIs.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fetch_links(url, log_func, scraped_data, folder_name, downloaded_images)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Extracts and processes all hyperlinks from a webpage. &lt;br&gt; &lt;strong&gt;Details:&lt;/strong&gt; Uses BeautifulSoup to locate all &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; tags, extracts the &lt;code&gt;href&lt;/code&gt; attribute, and then uses multithreading (via ThreadPoolExecutor) to process each link concurrently.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;process_link(full_url, log_func, scraped_data)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Processes a single hyperlink. &lt;br&gt; &lt;strong&gt;Details:&lt;/strong&gt; For each link, it calls &lt;code&gt;get_page_info&lt;/code&gt; to retrieve metadata and logs the progress. The scraped information is then appended to the aggregated data list for later storage.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;scrape_website(url, log_func)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Main orchestrator of the scraping process. &lt;br&gt; &lt;strong&gt;Details:&lt;/strong&gt; Determines the site name from the URL, initializes data structures (for storing images and scraped data), calls functions to fetch links and download images, and finally saves the data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;log_func(message, color)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Purpose:&lt;/strong&gt; Provides custom logging with colored output. &lt;br&gt; &lt;strong&gt;Details:&lt;/strong&gt; Displays messages to the console with specific colors to denote different types of messages (e.g., errors in red, success in green), enhancing readability during runtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  GUI Interface
&lt;/h2&gt;

&lt;p&gt;The GUI component (defined in &lt;strong&gt;main.py&lt;/strong&gt;) provides a graphical layer over the scraping functions, featuring:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Input Field:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A text entry widget where users can input the URL of the website they wish to scrape.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start Button:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Initiates the scraping process. When clicked, it disables the input field and start button to prevent multiple concurrent operations and changes the button text to indicate that scraping is in progress.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stop Button:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Provides the ability to gracefully halt the scraping process. Once clicked, it attempts to join the scraping thread and resets the interface.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Console Log:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A scrolling text widget that displays real-time logs including information about fetched links, downloaded images, progress updates, and any error messages encountered during the scraping process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Close Program Button:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Allows the user to exit the application gracefully.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The GUI is built using Tkinter and is enhanced with custom themes and styling from the &lt;code&gt;ttkthemes&lt;/code&gt; package, making the user interface both modern and responsive.&lt;/p&gt;




&lt;h2&gt;
  
  
  Usage &amp;amp; Applications
&lt;/h2&gt;

&lt;p&gt;This web scraper can be used in various scenarios, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;SEO Analysis:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Extract metadata from websites to evaluate their SEO structure and performance. This is particularly useful for digital marketers and SEO specialists.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Web Archiving:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Save website content and structure in a persistent format (CSV/JSON) for archival or offline browsing purposes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Research &amp;amp; Data Collection:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Collect data from multiple websites for academic research, market analysis, or competitive intelligence. The structured output can be directly imported into data analysis tools.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Image Scraping:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Automatically download images from websites for content creation, analysis, or reuse. The scraper ensures that images are organized and duplicates are avoided.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automated Data Extraction:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use the tool as a backend component in larger automation workflows, integrating with other systems via its CSV/JSON outputs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How to Run
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Clone the Repository:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone https://github.com/BOSS294/Web-Scrapper.git
   &lt;span class="nb"&gt;cd &lt;/span&gt;Web-Scrapper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Install Dependencies:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ensure you have Python 3 installed. Then, install the required packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Run the Scraper:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Launch the application by running the main Python file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   python main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The GUI window will appear, allowing you to input a URL and start scraping.&lt;/p&gt;




&lt;h2&gt;
  
  
  Technology Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python 3:&lt;/strong&gt; The core programming language used for scripting and application logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tkinter:&lt;/strong&gt; For creating the GUI interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BeautifulSoup &amp;amp; Requests:&lt;/strong&gt; For web scraping and HTML parsing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Selenium &amp;amp; WebDriver Manager:&lt;/strong&gt; For handling dynamic web content (if needed).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ThreadPoolExecutor:&lt;/strong&gt; For concurrent processing of multiple links.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSV &amp;amp; JSON Modules:&lt;/strong&gt; For structured data storage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ttkthemes:&lt;/strong&gt; For enhancing the look and feel of the Tkinter GUI.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Future Roadmap
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enhanced Error Handling:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Implement more robust error and exception management to handle various edge cases (e.g., network failures, unexpected HTML structures).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Progress Indicators:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Add progress bars and visual indicators within the GUI to display real-time scraping progress.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Customization Options:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Allow users to customize output directories, file naming conventions, and select specific types of data to scrape.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Support for JavaScript-Heavy Sites:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Further integrate Selenium or headless browsers to scrape sites that rely heavily on JavaScript for content loading.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automated Scheduling:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Enable scheduled scraping tasks that can run at predefined intervals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User Authentication:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Incorporate options to scrape data from websites that require user authentication.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Contributing
&lt;/h2&gt;

&lt;p&gt;Contributions are welcome! If you have suggestions, improvements, or bug fixes, please feel free to fork the repository and submit a pull request. Here’s how you can contribute:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fork the repository.&lt;/li&gt;
&lt;li&gt;Create a new branch for your feature or bug fix.&lt;/li&gt;
&lt;li&gt;Commit your changes and push the branch.&lt;/li&gt;
&lt;li&gt;Open a pull request describing your changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For any major changes, please open an issue first to discuss what you would like to change.&lt;/p&gt;




&lt;h2&gt;
  
  
  Author
&lt;/h2&gt;

&lt;p&gt;👨‍💻 &lt;strong&gt;Made By:&lt;/strong&gt; Mayank Chawdhari&lt;/p&gt;

&lt;p&gt;Feel free to reach out if you have any questions or need further assistance with the project.&lt;/p&gt;




</description>
      <category>python</category>
      <category>webdev</category>
      <category>website</category>
      <category>powerautomate</category>
    </item>
    <item>
      <title>Building a Real-Time User Analytics Dashboard with Chart.js: Track Active &amp; Inactive Users Dynamically</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Sun, 02 Feb 2025 00:33:22 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/building-a-real-time-user-analytics-dashboard-with-chartjs-track-active-inactive-users-11j7</link>
      <guid>https://forem.com/mayankchawdhari/building-a-real-time-user-analytics-dashboard-with-chartjs-track-active-inactive-users-11j7</guid>
      <description>&lt;h2&gt;
  
  
  User Analytics Dashboard
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpk4v54q9e1fbs8gth0ry.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpk4v54q9e1fbs8gth0ry.png" alt="image" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;This &lt;strong&gt;User Analytics Dashboard&lt;/strong&gt; is a real-time, interactive web application designed to track and visualize active, inactive, and total users with dynamic data updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real-Time Data&lt;/strong&gt;: The dashboard dynamically updates user data every 30 seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Analytics&lt;/strong&gt;: Displays statistics on active users, inactive users, and the total number of users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Charts&lt;/strong&gt;: Visual representation of user data over time using interactive line charts powered by Chart.js.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refreshing Countdown&lt;/strong&gt;: Includes a countdown timer to indicate the next data refresh cycle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modern UI&lt;/strong&gt;: Stylish and user-friendly design with smooth animations, hover effects, and modern color schemes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technologies Used:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML5&lt;/strong&gt;: For structuring the webpage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS3&lt;/strong&gt;: For styling and layout, including flexbox and box-shadow effects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JavaScript&lt;/strong&gt;: For real-time data manipulation, Chart.js for chart rendering, and dynamic updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chart.js&lt;/strong&gt;: For interactive and visually appealing line charts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Material Icons&lt;/strong&gt;: Used for interactive elements like refresh button.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Roadmap
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Current Features:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Dynamic user data update every 30 seconds.&lt;/li&gt;
&lt;li&gt;Real-time line charts displaying active, inactive, and total users.&lt;/li&gt;
&lt;li&gt;Visual countdown timer before data refresh.&lt;/li&gt;
&lt;li&gt;Data statistics with styled counts in the UI.&lt;/li&gt;
&lt;li&gt;Fully responsive layout for different screen sizes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Upcoming Features:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;User Data Source Integration&lt;/strong&gt;: Integrate with a real backend (e.g., REST API) to fetch real user data instead of static numbers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Role Tracking&lt;/strong&gt;: Add user roles (e.g., Admin, Member, Guest) to display different statistics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notifications&lt;/strong&gt;: Real-time notifications for critical data changes, like a spike in inactive users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable Dashboard&lt;/strong&gt;: Allow users to customize which metrics they want to see and how the data is visualized.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Possible Future Enhancements:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Export Data&lt;/strong&gt;: Add the ability to export user data in CSV/JSON format.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt;: Implement user login/logout with role-based access control for enhanced security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graph Customization&lt;/strong&gt;: Allow users to customize the type of graph (e.g., bar, pie, area chart) for user data visualization.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;To get started, simply clone this repository and open the &lt;code&gt;index.html&lt;/code&gt; file in your browser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/BOSS294/User-Analytics-Dashboard.git
&lt;span class="nb"&gt;cd &lt;/span&gt;User-Analytics-Dashboard
open index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No additional setup is needed as it is a static web application with Chart.js.&lt;/p&gt;




&lt;p&gt;Made with 💖 by &lt;strong&gt;Mayank Chawdhari&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>chartjs</category>
    </item>
    <item>
      <title>PROJECT-991 ( MASH AI )</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Wed, 18 Dec 2024 12:18:31 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/project-991-mash-ai--566f</link>
      <guid>https://forem.com/mayankchawdhari/project-991-mash-ai--566f</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7jpa35w1yk36ho52e152.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7jpa35w1yk36ho52e152.png" alt="THe (1)" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Project 991: Mash - Speech-Based AI using Python
&lt;/h2&gt;

&lt;p&gt;Description:&lt;br&gt;
Project 991, called Mash, is a groundbreaking initiative that introduces a modern-day Speech-Based AI machine, combining the power of advanced speech recognition and natural language processing techniques with the flexibility of the Python programming language. The project aims to deliver an intuitive and interactive speech-based AI experience.&lt;/p&gt;

&lt;p&gt;Mash incorporates state-of-the-art speech recognition algorithms to accurately convert spoken language into text, facilitating effortless interaction between users and the AI. Leveraging effective natural language processing (NLP) strategies, Mash comprehends user queries, recognizes context, analyzes intent, and extracts relevant information to provide unique and context-aware responses.&lt;/p&gt;

&lt;p&gt;Key Functions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Created a speech recognition system using the &lt;code&gt;speech_recognition&lt;/code&gt; library in Python.&lt;/li&gt;
&lt;li&gt;Implemented the ability for the AI to listen to user speech input and convert it to text.&lt;/li&gt;
&lt;li&gt;Integrated the &lt;code&gt;pyttsx3&lt;/code&gt; library for text-to-speech functionality.&lt;/li&gt;
&lt;li&gt;Added support for performing mathematical calculations by evaluating user-provided mathematical expressions.&lt;/li&gt;
&lt;li&gt;Implemented the ability for the AI to handle tasks assigned by the user, such as opening specific websites or performing searches.&lt;/li&gt;
&lt;li&gt;Enhanced the AI's understanding of user instructions by processing and extracting relevant information from the user's speech input.&lt;/li&gt;
&lt;li&gt;Improved error handling and providing appropriate responses in case of unrecognized speech or errors in task execution.&lt;/li&gt;
&lt;li&gt;Incorporated the use of a voice synthesis engine to customize the voice of the AI.&lt;/li&gt;
&lt;li&gt;Developed a command-based interaction system where the AI responds to specific commands or instructions given by the user.&lt;/li&gt;
&lt;li&gt;Enhanced the user experience by providing voice feedback for executed tasks and mathematical calculations.&lt;/li&gt;
&lt;li&gt;Implemented the ability for the AI to process user instructions even when provided in a sentence or paragraph format.&lt;/li&gt;
&lt;li&gt;Integrated neural network models for natural language processing and understanding.&lt;/li&gt;
&lt;li&gt;Enabled the AI to understand and execute tasks based on specific keywords and instructions provided by the user.&lt;/li&gt;
&lt;li&gt;Improved the overall functionality and reliability of the MaSh AI program based on user feedback and iterative updates.&lt;/li&gt;
&lt;li&gt;These updates have enhanced the AI's capabilities, improved its understanding of user instructions, and provided a more interactive and personalized experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Roadmap:&lt;/p&gt;

&lt;p&gt;The future roadmap for Mash includes several exciting developments to further enhance its capabilities and expand its applications. The key milestones are as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enhanced Speech Recognition: Continuously improve speech recognition algorithms to enhance accuracy and support a broader range of languages and accents.&lt;/li&gt;
&lt;li&gt;Contextual Understanding: Train Mash to better understand and maintain context, enabling deeper and more meaningful conversations.&lt;/li&gt;
&lt;li&gt;Multi-Modal Integration: Integrate visual and auditory cues to provide a more immersive and interactive user experience, combining speech recognition with image and video analysis.&lt;/li&gt;
&lt;li&gt;Domain-Specific Customization: Enable customization of Mash for specific industries or domains, allowing organizations to tailor the AI system to their specific requirements.&lt;/li&gt;
&lt;li&gt;Advanced User Interface: Refine and enhance the user interface to provide additional features such as visual feedback, voice commands, and personalized settings, further improving the user experience.&lt;/li&gt;
&lt;li&gt;Integration with IoT Devices: Adapt Mash to seamlessly integrate with Internet of Things (IoT) devices, allowing users to control their smart homes, appliances, and other connected devices using voice commands.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By leveraging the power of advanced speech recognition, natural language processing techniques, and the flexibility of Python, Mash offers exciting opportunities for developing intelligent, speech-controlled applications. The project's roadmap ensures continuous improvements, promising a more natural and immersive speech-based AI experience for both personal and business applications.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>nlp</category>
      <category>python</category>
      <category>devops</category>
    </item>
    <item>
      <title>Funny-Captcha Web</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Wed, 18 Dec 2024 12:17:31 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/funny-captcha-web-2jod</link>
      <guid>https://forem.com/mayankchawdhari/funny-captcha-web-2jod</guid>
      <description>&lt;p&gt;Welcome to the most entertaining CAPTCHA system ever! This project not only verifies if you're a human but also makes you smile, laugh, and enjoy the process. Say goodbye to boring CAPTCHAs and hello to fun and interactivity! 😄&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Is
&lt;/h2&gt;

&lt;p&gt;This project is a dynamic and amusing CAPTCHA system designed to enhance user experience. Whether you're correct or incorrect, you get a delightful response that will make you enjoy solving CAPTCHAs. It's perfect for web applications that want to add a bit of fun to their form validations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features 🌟
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Fun Animation for Correct Answers&lt;/strong&gt; 🎉&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When you solve the CAPTCHA correctly, a celebratory sound plays, and small papers fly from the sides of the screen! &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Humorous Video for Incorrect Answers&lt;/strong&gt; 😂&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you get the CAPTCHA wrong, an amusing video pops up to cheer you up and make you try again with a smile.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Modern Design&lt;/strong&gt; ✨&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The CAPTCHA form is stylish, responsive, and includes a smooth hover effect to enhance user interaction.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Interactive SweetAlert2 Popups&lt;/strong&gt; 🍬&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses SweetAlert2 for delightful and customizable popup messages.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Responsive Layout&lt;/strong&gt; 📱&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Looks great on both desktop and mobile devices, ensuring a seamless experience for all users.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Use
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone the repository: &lt;code&gt;git clone https://github.com/BOSS294/Funny-Captcha.git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open the &lt;code&gt;main.html&lt;/code&gt; file in your favorite web browser.&lt;/li&gt;
&lt;li&gt;Enjoy the fun CAPTCHA experience! 🎊&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Installation and Setup
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone this repository: &lt;code&gt;git clone https://github.com/BOSS294/Funny-Captcha.git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to the project directory: &lt;code&gt;cd Funny-Captcha&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;main.html&lt;/code&gt; in your web browser to see the CAPTCHA in action.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Contributing 🤝
&lt;/h2&gt;

&lt;p&gt;Contributions are welcome! Feel free to open issues or submit pull requests to improve the project and make it even more fun.&lt;/p&gt;

&lt;h2&gt;
  
  
  Acknowledgments 🙌
&lt;/h2&gt;

&lt;p&gt;Special thanks to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://sweetalert2.github.io/" rel="noopener noreferrer"&gt;SweetAlert2&lt;/a&gt; for their awesome popup library.&lt;/li&gt;
&lt;li&gt;All contributors and users who make this project fun and engaging.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Created by Mayank Chawdahri. Follow me on &lt;a href="[https://www.instagram.com/your_instagram_handle](https://www.instagram.com/mayankchawdhari/?hl=en)"&gt;Instagram&lt;/a&gt; for more updates!&lt;/p&gt;




&lt;p&gt;Enjoy making your users smile with this funny and interactive CAPTCHA system! 😃🎈&lt;/p&gt;




</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>CID-FUNNY-LOGIN</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Wed, 18 Dec 2024 12:16:48 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/cid-funny-login-4455</link>
      <guid>https://forem.com/mayankchawdhari/cid-funny-login-4455</guid>
      <description>&lt;p&gt;&lt;strong&gt;CID-Themed Login System&lt;/strong&gt; 🎬🔐&lt;/p&gt;

&lt;p&gt;This project presents a fun, CID-themed login system where users are entertained with iconic CID meme videos upon successful login. It offers a unique and engaging user experience by integrating CID-themed elements throughout the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;🎭 CID-Themed:&lt;/strong&gt; Enjoy the nostalgic CID series with themed memes and videos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🔐 Credential Check:&lt;/strong&gt; Validate login with predefined username and password.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;📽️ Video Playback:&lt;/strong&gt; Plays a specific video on successful login.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;⚠️ Custom Alerts:&lt;/strong&gt; Utilizes SweetAlert for custom, stylish pop-up messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;🔊 Audio Control:&lt;/strong&gt; Plays background music with an option to pause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;📋 Session Management:&lt;/strong&gt; Manages user sessions to control video playback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;📱 Responsive Design:&lt;/strong&gt; Fully responsive, providing a seamless experience on all devices.
## Videos &lt;/li&gt;
&lt;li&gt;Timelaspe of CID FUNNY LOGIN CREATION : &lt;/li&gt;
&lt;li&gt;CID FUNNY LOGIN Full Video : 
## Images
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F161p8jp0rf4b6a46pvt8.png" alt="image" width="800" height="448"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Developed By
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;MAYANK CHAWDHARI&lt;/strong&gt;
## Special Thanks to&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Kishan Kumar&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vedant&lt;/strong&gt;
## User Guide&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Predefined Credentials
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Username:&lt;/strong&gt; Admin&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Password:&lt;/strong&gt; 12345678&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Authentication and Video Playback
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Enter Credentials:&lt;/strong&gt; Input the predefined username and password.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Play Video:&lt;/strong&gt; On successful login, a full-screen video will play.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session Management:&lt;/strong&gt; The user's authentication status is stored, allowing for conditional video playback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redirect and Audio Control:&lt;/strong&gt; After the video ends, the user is redirected back, and any playing audio is stopped.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Changing Authentication for Specific Videos
&lt;/h3&gt;

&lt;p&gt;To play different videos based on authentication:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Edit the Auth Variable:&lt;/strong&gt;
In the JavaScript code, locate the &lt;code&gt;auth&lt;/code&gt; variable. Set its value to 1 or 0 based on the condition.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;auth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// or 0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Specify Video Source:&lt;/strong&gt;
Update the video source paths for different auth values.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;auth&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;fullScreenVideo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2.mp4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Path to video for auth = 1&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;fullScreenVideo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1.mp4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Path to video for auth = 0&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Custom Pop-Up Alerts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SweetAlert:&lt;/strong&gt; Stylish pop-up messages for user notifications.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;Swal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fire&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Please fill out all fields!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;top-end&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;timerProgressBar&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;showConfirmButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;250px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;timer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;backdrop&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Full-Screen Video Playback
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML Video Element:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;video&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"fullScreenVideo"&lt;/span&gt; &lt;span class="na"&gt;autoplay&lt;/span&gt; &lt;span class="na"&gt;controls&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;source&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"path/to/your/video-file.mp4"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"video/mp4"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      Your browser does not support the video tag.
  &lt;span class="nt"&gt;&amp;lt;/video&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JavaScript to Handle Video Playback and Redirection:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;  &lt;span class="nx"&gt;fullScreenVideo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ended&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;stopAllAudio&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;login.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Responsive Layout:&lt;/strong&gt;
Ensures compatibility across various devices for a seamless user experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Enjoy the CID-themed login system and enhance your application's user engagement with iconic CID moments! 🎉🔐&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>PopupPro JS Module</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Wed, 18 Dec 2024 12:15:37 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/popuppro-js-module-6jp</link>
      <guid>https://forem.com/mayankchawdhari/popuppro-js-module-6jp</guid>
      <description>&lt;h3&gt;
  
  
  PopupPro - Customizable Popup Library 🚀
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwka3cqldpjsrl4tmtkjf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwka3cqldpjsrl4tmtkjf.png" alt="Thumnail shape" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repository:&lt;/strong&gt; &lt;a href="https://github.com/BOSS294/PopupPro" rel="noopener noreferrer"&gt;PopupPro&lt;/a&gt; 🌟&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PopupPro is a modern, highly customizable JavaScript library designed to enhance user interactions with versatile and stylish popups. It goes beyond traditional popup libraries with its extensive feature set, including flexible configurations, smooth animations, and rich styling options. Whether you need a simple alert or a complex modal with various buttons, PopupPro provides an intuitive way to create engaging and visually appealing popups for your web applications. ✨&lt;/p&gt;




&lt;h3&gt;
  
  
  Features 🌟
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Customizable Options:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Title &amp;amp; Message:&lt;/strong&gt; Easily set the title and message of the popup. 📝&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Background Color &amp;amp; Text Color:&lt;/strong&gt; Fully customizable colors for a tailored look. 🎨&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size &amp;amp; Styling:&lt;/strong&gt; Adjustable width, height, and border radius to match your design. 📏&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Close Button:&lt;/strong&gt; Option to include or exclude the close button. ❌&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Animation Support:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Built-in Animations:&lt;/strong&gt; Choose from pre-defined animations like &lt;code&gt;bounce&lt;/code&gt;, or create custom animations. 🕺&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Animation Duration:&lt;/strong&gt; Fine-tune animation timing for a smooth experience. ⏳&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Button Configuration:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multiple Buttons:&lt;/strong&gt; Support for multiple buttons with customizable text. 🔘&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Button Styling:&lt;/strong&gt; Style buttons with different colors, borders, and hover effects. 🎨&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Button Actions:&lt;/strong&gt; Define actions and redirection URLs for each button. 🌐&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Responsive and Accessible:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Responsive Design:&lt;/strong&gt; Designed to work well on various screen sizes and devices. 📱💻&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accessibility:&lt;/strong&gt; Focus management and overlay click handling for improved accessibility. ♿&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Error Handling:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Error Reporting:&lt;/strong&gt; In-built error handling with console logging and alerts. ⚠️&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  How PopupPro Stands Out 🌟
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Extensive Customization:&lt;/strong&gt; Unlike many popup libraries, PopupPro allows granular control over virtually every aspect of the popup, including animation types, button styles, and overall design. This level of customization ensures that your popups can be tailored to fit seamlessly into any design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Animation Flexibility:&lt;/strong&gt; While many popup modules offer basic fade-in/fade-out animations, PopupPro supports a variety of animations, including custom animations, to create engaging and dynamic user experiences. You can choose from built-in animations like &lt;code&gt;bounce&lt;/code&gt; or define your own.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Versatile Button Configuration:&lt;/strong&gt; PopupPro supports multiple buttons with diverse configurations. Each button can have its own text, style, action, and optional redirection URL, making it possible to handle complex user interactions within a single popup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Focus on Accessibility:&lt;/strong&gt; PopupPro emphasizes accessibility with features like focus management and overlay click handling, ensuring that your popups are usable by everyone, including users with disabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Error Handling and Debugging:&lt;/strong&gt; The library includes comprehensive error handling with console logging and alert notifications, simplifying the debugging process and improving reliability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Clean and Modern Design:&lt;/strong&gt; The default styling of PopupPro is modern and clean, providing a professional appearance out of the box. It also offers extensive styling options to match your specific design needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Responsive Design:&lt;/strong&gt; PopupPro is designed to adapt to various screen sizes, ensuring that your popups look great on both mobile and desktop devices.&lt;/p&gt;




&lt;h3&gt;
  
  
  About the Developer 👨‍💻
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Developer:&lt;/strong&gt; &lt;a href="https://github.com/BOSS294" rel="noopener noreferrer"&gt;Mayank Chawdhari&lt;/a&gt; 🌟&lt;/p&gt;

&lt;p&gt;Mayank Chawdhari is a dedicated and innovative web developer with a focus on creating elegant and user-friendly web applications. With expertise in JavaScript, CSS, and PHP, Mayank brings a passion for clean code and exceptional user experiences. Known for delivering high-quality solutions and continually exploring new technologies, Mayank is committed to advancing the field of web development and enhancing user interactions. 🚀💡&lt;/p&gt;




&lt;h3&gt;
  
  
  Usage 📚
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Include the Library:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Download &lt;code&gt;PopupPro.js&lt;/code&gt; from this repository or include it directly in your project. Add the following script tag to your HTML file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"path/to/PopupPro.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Basic Popup Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Add a button to your HTML and configure the popup with JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"PopupPro.show({
    title: 'Login Authentication',
    message: 'Wrong password or username, Please try again',
    backgroundColor: '#333',
    textColor: '#fff',
    width: '400px',
    borderRadius: '20px',
    buttons: [
        {
            text: 'Retry',
            style: 'default',
            onClick: function() { console.log('Retry button clicked'); }
        },
        {
            text: 'Cancel',
            style: 'default',
            onClick: function() { console.log('Cancel button clicked'); }
        }
    ]
})"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Show Popup&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Configuration Options:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;title&lt;/code&gt;&lt;/strong&gt;: Title of the popup. 🏷️&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;message&lt;/code&gt;&lt;/strong&gt;: Message text displayed in the popup. 🗨️&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;backgroundColor&lt;/code&gt;&lt;/strong&gt;: Background color of the popup container. 🎨&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;textColor&lt;/code&gt;&lt;/strong&gt;: Color of the text. 🖋️&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;width&lt;/code&gt;&lt;/strong&gt;: Width of the popup container. 📐&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;height&lt;/code&gt;&lt;/strong&gt;: Height of the popup container (optional). 📏&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;borderRadius&lt;/code&gt;&lt;/strong&gt;: Border radius for rounded corners. 🧩&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;closeButton&lt;/code&gt;&lt;/strong&gt;: Boolean value to show or hide the close button. ❌&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;animationDuration&lt;/code&gt;&lt;/strong&gt;: Duration of the popup animation. ⏳&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;animation&lt;/code&gt;&lt;/strong&gt;: Animation type (e.g., &lt;code&gt;bounce&lt;/code&gt;). 🕺&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;buttons&lt;/code&gt;&lt;/strong&gt;: Array of button configurations, including text, style, click action, and optional redirection URL. 🔘&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Handling Button Actions:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each button can be configured with a &lt;code&gt;text&lt;/code&gt;, &lt;code&gt;style&lt;/code&gt;, &lt;code&gt;onClick&lt;/code&gt; function, and optional &lt;code&gt;redirect&lt;/code&gt; URL. The popup will close automatically after the button is clicked unless specified otherwise. 🚪&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Advanced Usage:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To customize the default settings, use the &lt;code&gt;setOptions&lt;/code&gt; method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;PopupPro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setOptions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;animationDuration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;0.5s&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#f0f0f0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;buttons&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Confirm&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* custom action */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Error Handling:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If an error occurs, it will be logged to the console and displayed in an alert dialog for quick debugging. 🛠️&lt;/p&gt;




&lt;h3&gt;
  
  
  Contributing 🤝
&lt;/h3&gt;

&lt;p&gt;Contributions are welcome! Please open issues, submit suggestions, or create pull requests. For detailed guidelines, refer to the &lt;code&gt;CONTRIBUTING.md&lt;/code&gt; file in the repository. 📝&lt;/p&gt;




&lt;h3&gt;
  
  
  License 📜
&lt;/h3&gt;

&lt;p&gt;This project is licensed under the MIT License. See the &lt;code&gt;LICENSE&lt;/code&gt; file for more details. 🔓&lt;/p&gt;

&lt;p&gt;For further support or questions, please open an issue on the &lt;a href="https://github.com/BOSS294/PopupPro" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;. 💬&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>module</category>
    </item>
    <item>
      <title>3D Web-Calculator with Node.js-Integration</title>
      <dc:creator>Mayank Chawdhari</dc:creator>
      <pubDate>Wed, 18 Dec 2024 12:14:21 +0000</pubDate>
      <link>https://forem.com/mayankchawdhari/3d-web-calculator-with-nodejs-integration-52nn</link>
      <guid>https://forem.com/mayankchawdhari/3d-web-calculator-with-nodejs-integration-52nn</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fax8lcjv40rx25ptl4knl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fax8lcjv40rx25ptl4knl.png" alt="image" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Features Added
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;3D UI Design&lt;/strong&gt; 🌟:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modern, 3D-inspired design with pop-in animation for a visually appealing user interface.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sound Effects&lt;/strong&gt; 🔊:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click sound effects on button presses for enhanced user interaction experience.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Responsive Layout&lt;/strong&gt; 📱:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flexbox-based layout ensuring the calculator is centered and responsive across different screen sizes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dynamic Display&lt;/strong&gt; 🖥️:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-time update of input values and results in the display field.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Error Handling&lt;/strong&gt; ⚠️:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic error handling for invalid operations with "Error" display message.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Interactive Buttons&lt;/strong&gt; 🎨:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Styled buttons with modern hover effects and animations for an engaging user experience.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  To Be Fixed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Arithmetic Operations Not Working Properly&lt;/strong&gt; 🛠️:

&lt;ul&gt;
&lt;li&gt;Ensure proper handling of arithmetic operations and update the script to correctly compute and display results for all valid operations.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
