MoreRSS

site iconThe Practical DeveloperModify

A constructive and inclusive social network for software developers.
Please copy the RSS to your reader, or quickly subscribe to:

Inoreader Feedly Follow Feedbin Local Reader

Rss preview of Blog of The Practical Developer

My Docs Are Safer Than My Search History 😎

2026-02-15 18:20:01

This is a submission for the GitHub Copilot CLI Challenge: Build with AI

Hey there! Welcome back. This is my latest project that I'm super excited to share with you!

Remember that one time your friend asked you to "just quickly check" their Google Doc, and you spent 20 minutes figuring out if you had view-only or editing access? Or when your team's important document got accidentally shared with the entire internet? Yeah, me too. 😅

That's why I built Radhika's AI DocManager, a document management system that doesn't mess around when it comes to security, roles, and AI-powered features.

banner
Live Demo: radhika-docmanager.vercel.app

 

What's This All About? 🤔

Imagine you and your partner have a shared notebook. But here's the twist:

  • You can write anything you want in your sections
  • Your partner can only read some sections (View Only)
  • Your partner can comment on other sections but not edit them (Comment)
  • Some pages are locked with a password because they contain surprise party plans 🎉

That's basically what this project does, but for teams and organizations!

Question for you: Have you ever accidentally deleted someone else's important document or had your document deleted by someone? How did that go? 😬

 

The Cool Features That'll Make You Go "Woah!" 🚀

1️⃣ Four Roles, Four Levels of Trust

Think of roles like relationship stages:

  • User (Dating Stage): You can only see and manage your own stuff. Can't touch anyone else's documents.
  • Admin (Committed Relationship): You can see everything in your organization and manage your team members. You're the responsible one now!
  • Super Admin (Marriage Level): Like Admin but with superpowers! You approve who joins your org, can promote people to Admin, and have elevated privileges. But you're still tied to your organization!
  • God (The Parent): Full control over the ENTIRE platform across ALL organizations. Can post documents to ALL organizations at once. The ONLY role with cross-org access! Ultimate power! 💪
    • Important Note: God has read access to all documents across organizations for platform management, but the primary focus is on public documents and cross-org coordination. Organizations still maintain their privacy for internal operations.

Each role has a "weight" number. Higher weight = more authority. Just like how your mom outranks you when deciding what's for dinner! 😄

Important: Only God can see across organizations. Super Admin, Admin, and User are all scoped to their own organization!

2️⃣ Document Security That Actually Makes Sense

Your documents can have different classification levels:

  • Public: Everyone can see it (like your Instagram story)
  • Organization: Only your team can see it (like your company Slack)
  • Internal: More restricted (like your team's strategy docs)
  • Confidential: Top secret stuff (like your salary slip)
  • General: The default, casual classification

Plus, you can set access levels:

  • View Only: Read-only, no comments allowed (like when your partner says "just look, don't touch")
  • Comment: Can read and comment but not edit (like leaving sticky notes on a physical document)
  • Edit: Can make changes to the content
  • Full Access: Complete control (the relationship goals)

Want to add extra protection? Lock any document with a 9-digit password! 🔐

3️⃣ AI That Works For YOU (Not For Big Tech)

Here's the thing: I hate vendor lock-in. You know what's worse than a bad breakup? Being forced to stay with a service because you can't leave!

That's why Radhika's AI DocManager lets you bring your own API keys:

  • Groq (FREE tier available! Fast and perfect for getting started)
  • OpenAI (Premium quality)
  • Anthropic (Great for long documents)

Your keys are encrypted with AES-256-GCM encryption. That's military-grade security, folks! Even if someone breaks into the database, your keys are safer than your ex's secrets in your DMs. 🤫

The AI can:

  • Summarize documents (TL;DR generator)
  • Analyze sentiment (is this doc angry or happy?)
  • Extract key points (bullet points anyone?)
  • Improve writing (make it sound professional)
  • Translate content (hola, bonjour, namaste!)
  • Generate Q&A (instant study guide)
  • Custom prompts (ask it anything!)

Pro tip: You also get FREE local tools that work without any API key — Word Count, Structure Analysis, and Text Preview. All running in your browser!

4️⃣ Organizations That Don't Mix Like Oil and Water

Multiple organizations, complete data isolation. Think of it like this:

You have three friend groups:

  1. College friends (Acme Corp)
  2. Work friends (Globex Inc)
  3. Gym friends (Initech LLC)

Each group has its own private WhatsApp group. Nobody from college friends can see what's happening in your work friends group. That's exactly how organizations work here!

To join an organization, you need an Organization Code (like a secret club password). A Super Admin must approve your membership request. No random people crashing your party! 🎊

 

How GitHub Copilot CLI Supercharged My Development 🚀

Okay, confession time: Building this project would have taken me MUCH longer without GitHub Copilot CLI. Let me tell you how it became my coding partner!

What is GitHub Copilot CLI?

Think of it as having a really smart friend who sits in your terminal and helps you with commands, debugging, and understanding code. You just talk to it in natural language!

How I Used It in This Project

1. Generating the Complete Supabase Schema

This was HUGE. Instead of manually writing hundreds of lines of SQL:

gh copilot suggest "generate supabase schema for document management system with organizations, users, documents, comments, and audit logs with proper foreign keys and indexes"

It gave me a complete schema structure! I just had to customize it for my needs. Saved hours of work!

2. Setting Up Row Level Security (RLS)

Supabase RLS policies are tricky. I asked:

gh copilot suggest "create row level security policy for organization isolation in supabase"

It generated the exact SQL I needed to ensure users can only see data from their organization!

3. Database Schema Debugging

When my foreign key constraints weren't working:

gh copilot explain "Why is my foreign key constraint failing between documents and profiles?"

Boom! Got the answer instantly and fixed the relationship properly.

4. Creating Storage Buckets with Policies

Setting up Supabase storage:

gh copilot suggest "create supabase storage bucket for documents with 50MB limit and access policies"

Got the complete SQL for buckets AND storage policies. No more digging through docs!

5. Environment Setup and Security

Setting up encryption for API keys:

gh copilot suggest "generate secure random encryption key for AES-256-GCM in node"

It gave me the exact command to generate a proper 64-character hex string. Saved me from using weak keys!

6. Complex Git Operations

Had to rebase multiple commits with conflicting changes:

gh copilot suggest "rebase last 5 commits and squash them into one"

Got the exact git commands I needed. No more Stack Overflow!

7. TypeScript Type Errors

When dealing with complex Supabase types:

gh copilot explain "Cannot find name 'UserRole' in this scope"

Instantly told me I needed to import from @/lib/supabase/types. No more hunting through files!

8. Debugging Permission Logic

When my role-based access control wasn't working:

gh copilot explain "why is my outranks function returning false for admin checking user role"

Helped me understand the weight comparison logic and fix the bug in minutes!

9. File Upload Implementation

Struggled with Supabase storage upload with progress:

gh copilot suggest "upload file to supabase storage bucket with progress tracking and error handling"

Got complete working code with progress bars and proper error handling!

10. Understanding bcrypt Hashing

When implementing password security:

gh copilot explain "difference between bcrypt compare and hash and when to use each"

Clear explanation that helped me implement secure authentication correctly!

11. Deployment to Vercel

Deploying with all environment variables:

gh copilot suggest "deploy next.js app to vercel with environment variables from .env file"

Got the proper CLI commands with all the flags needed!

12. Testing Database Queries

When testing complex SQL with multiple JOINs:

gh copilot explain "how to test row level security policies in Supabase without deploying"

It explained the whole local testing process step by step!

But do you know? I've even implemented most of the frontend with it as well. 😎

Why Copilot CLI is a Game Changer

  • No Context Switching: Stay in your terminal, no need to open browser
  • Natural Language: Ask questions like you'd ask a friend
  • Project-Aware: It understands your codebase context
  • Instant Answers: Faster than googling and reading 10 different answers

Real Talk: I probably saved 10-15 hours of googling, debugging, and trial-and-error just by having Copilot CLI help me with terminal commands, git operations, and understanding error messages.

If you're not using it yet, you're missing out! It's like having a senior developer on speed dial. 🎯

 

The Tech Magic Behind the Curtain 🎩✨

(Don't worry, I'll keep it light!)

Built With Love Using:

  • Next.js 14 (App Router, because we're modern like that)
  • Supabase (PostgreSQL database + storage)
  • TypeScript (because typos are for noobs)
  • Tailwind CSS + shadcn/ui (for that crispy dark mode 🌙)
  • Bun runtime (faster than your morning coffee hitting your system)

Security Layers:

  1. Passwords: bcrypt hashing (can't crack it even if you try)
  2. API Keys: AES-256-GCM encryption (Fort Knox level)
  3. Document Passwords: Another layer of bcrypt (double protection!)
  4. Organization Isolation: Complete data separation (no mixing allowed)

Document Support:

Upload pretty much anything:

  • PDF (with embedded viewer)
  • Word docs (auto text extraction!)
  • Plain text, CSV, Markdown
  • HTML, JSON, RTF, ODT
  • Even Excel and PowerPoint (why not?)

File size limit: 50 MB per document. That's like... a LOT of cat pictures! 🐱

 

The Boyfriend-Girlfriend Analogy That'll Make You Understand Permissions 💑

Let's say you and your partner are working on planning a surprise party:

User Role (You):

  • You can create your own to-do list
  • You can only see your own tasks
  • You can't see or touch your partner's secret guest list

Admin Role (Your Partner who's more organized):

  • Can see both your lists (within your organization)
  • Can delete tasks from User-level people
  • Can manage who's invited to the planning team
  • But can only see YOUR organization's party, not other orgs

Super Admin Role (The Senior Party Planner):

  • Like Admin but can also approve new members joining YOUR organization
  • Can promote people to Admin within your org
  • Has elevated privileges for your organization
  • But still can't see OTHER organizations' parties (that's God's job!)

God Role (The Person Whose Birthday It Is):

  • Knows about ALL surprise parties EVERYWHERE (cross-org access!)
  • Can access any planning doc in any organization for platform management
  • Can post announcements to all party groups at once
  • Bypasses all password locks (it's their birthday, after all!)
  • The ONLY role that can see across all organizations!
  • But remember: God is the platform administrator, not Big Brother watching everything. The focus is on managing public documents and cross-org coordination, while respecting organizational privacy.

See? Not so complicated! 😊

 

Real-World Use Cases

For Teams:

  • Store company policies (Organization classification)
  • Share meeting notes (Comment access)
  • Collaborate on proposals (Edit access)
  • Lock sensitive HR docs (Password protection)

For Content Creators:

  • Draft blog posts (Draft status)
  • Get feedback from editors (Assign reviewers)
  • Publish final versions (Published status)
  • Archive old content (Archived status)

For Students:

  • Store class notes
  • Collaborate on group projects
  • Share study guides
  • Keep research papers organized

Question for you: What would YOU use this for? I'd love to hear your use case! Drop it in the comments! 💭

 

The Journey (AKA The Fun Part) 🎢

Building this was like assembling IKEA furniture while blindfolded. Here's what I learned:

Challenge #1: Role-Based Access Control

Creating a system where User < Admin < Super Admin < God without breaking everything? HARD. I used a "weight" system (User = 10, Admin = 50, Super Admin = 75, God = 100). Simple math, complex implications!

Challenge #2: Organization Isolation

Making sure Acme Corp never accidentally sees Globex Inc's documents? I had to filter EVERYTHING by organization. Every. Single. Query.

Challenge #3: Encryption That Doesn't Break

Encrypting API keys is easy. Making sure you can decrypt them later? That's the trick! Used AES-256-GCM with unique IVs for each key. Sounds fancy, works perfectly!

Challenge #4: God's Multi-Org Publishing

When God creates a document for "All Orgs", the system:

  1. Uploads the file ONCE to storage
  2. Creates a document record for EACH organization
  3. All records point to the same file
  4. When God changes the status, ALL copies update together

It's like posting on all your social media at once, but harder!

 

The Tech Implementation (For My Developer Friends)

Permission Checking:

export function outranks(roleA: string, roleB: string): boolean {
  return getRoleWeight(roleA) > getRoleWeight(roleB);
}

export function isAtLeast(roleA: string, roleB: string): boolean {
  return getRoleWeight(roleA) >= getRoleWeight(roleB);
}

Simple, elegant, effective!

Document Deletion Logic:

  • User can delete: Own docs only
  • Admin can delete: Own + User docs (Admin outranks User)
  • Super Admin can delete: Own + User + Admin docs
  • God can delete: Own + any public document

AI Action Flow:

  1. User clicks an AI action
  2. System decrypts their API key in memory (never stored decrypted!)
  3. Sends document content to AI provider
  4. Returns result to user
  5. Result NOT stored (privacy first!)

Organization Membership:

  1. New user registers with Organization Code
  2. Account created with "pending" status
  3. Super Admin approves or rejects
  4. If approved, user gets full access
  5. If rejected, user can't log in

Clean workflow, no confusion!

 

Try It Yourself!

Live Demo: https://radhika-docmanager.vercel.app/

Documentation: https://radhika-docmanager.vercel.app/docs

Want to test it locally? Here's the speed run:

  1. Clone the repo from GitHub
  2. Set up Supabase project (free tier)
  3. Copy .env.example to .env and fill in your credentials
  4. Run bun install && bun dev
  5. Visit http://localhost:3000/api/seed to get demo accounts
  6. Log in and start creating documents!

Demo accounts (all use password Password123!):

Or try the live app: radhika-docmanager.vercel.app

Check out the full documentation for setup details!

 

What's Special About This Project?

1. Security First

Most projects add security as an afterthought. I built it from day one. Encryption, hashing, isolation — the works!

2. No Vendor Lock-In

Your API keys, your choice. Switch providers anytime without losing data.

3. Real Enterprise Features

Multi-org support, approval workflows, audit logs, reviewer assignments — this isn't a toy project!

4. Actually Good UX

Dark mode that doesn't hurt your eyes. Clean interface. Logical workflows. I actually USED it while building it!

5. Named After Someone Special

Radhika's DocManager is named after Radhika Sharma. Built by Rohan Sharma (yes, it's me). Want to know more about Radhika? Find the secret page in my portfolio. ❤️

Rohan Sharma - Software Developer, Professional Blog Writer and UI/UX Designer

Explore the portfolio of Rohan Sharma, featuring cutting-edge software projects, insightful blogs, and creative UI/UX work.

favicon rohansrma.vercel.app

6. Built with GitHub Copilot CLI

The entire development process was supercharged by GitHub Copilot CLI; from debugging complex database queries to writing deployment scripts. It's like pair programming with an AI! 🤖

 

Why This Project for the GitHub Copilot CLI Challenge? 🏆

This challenge is all about showcasing how GitHub Copilot CLI enhances the development process, and boy, did it ever!

The Challenge: Build an AI-powered, multi-tenant document management system with enterprise-grade security.

The Reality: That's A LOT of complexity; database schemas, encryption, role hierarchies, file uploads, organization isolation, and more.

The Solution: GitHub Copilot CLI became my development companion, helping me:

  • Debug complex SQL queries and foreign key constraints
  • Generate secure encryption keys and understand crypto operations
  • Navigate git operations when managing multiple feature branches
  • Understand error messages and fix bugs faster
  • Write deployment scripts and environment configurations

The Result: A production-ready application deployed at radhika-docmanager.vercel.app with features that would normally take months to build!

Without Copilot CLI, I would have:

  • Generate the entire Supabase schema from a single prompt describing my data model
  • Create Row Level Security policies for organization isolation automatically
  • Spent hours googling obscure error messages
  • Made security mistakes in encryption implementation
  • Struggled with git conflicts during feature merges
  • Wasted time reading documentation for every command

I've even implemented most of the frontend with it. Ehehe.

Instead, I focused on building features and solving real problems while Copilot CLI handled the "how do I do this?" questions instantly.

That's the power of AI meeting the command line! 🚀

 

Final Thoughts

Building Radhika's AI DocManager was a rollercoaster. There were moments of "WHY ISN'T THIS WORKING?!" and moments of "OMG IT ACTUALLY WORKS!"

But you know what? Creating something that helps teams manage documents securely while leveraging AI (without selling their soul to Big Tech) feels pretty amazing.

If you've made it this far, thank you for reading! You're awesome! 🌟

Star the Github Repo 🌠

Try the project, break it, suggest features, report bugs, I want to hear it all!

And if you're wondering why it's called "Radhika's DocManager", it's named after Radhika Sharma, someone special whose memory inspired this project. Sometimes the best projects come from the heart. ❤️

Links & Contact

 

Try the live app and let me know what you think!

Thank youuuuuuuuuuuuuuuu for reading! ❣️

🤖 Copilot Telegram Bot: A Secure, Mobile-First Agent in Your Pocket

2026-02-15 18:19:17

This is a submission for the GitHub Copilot CLI Challenge

What I Built

copilot-telegram-bot - brings the power of GitHub Copilot to your smartphone. It transforms Telegram into a command center for your code, allowing you to architect, debug, and manage projects without ever opening a laptop.

The Problem

I often get my best coding ideas when I'm away from my desk—on the subway, in a coffee shop, or taking a walk. By the time I get to my computer, the context is lost. I needed a way to interact with my codebase securely and intelligently from my phone.

The Solution

I built a bridge between the Telegram Chat UI and GitHub Copilot CLI, powered by the github-copilot-sdk. This application embeds Copilot's agentic workflows, treating Telegram messages, taps, and image uploads as native context for the Copilot CLI.

🌟 Core Capabilities

  • ⚙️ Dual Agent Modes:
    • Plan Mode: For brainstorming high-level architecture. It uses specialized prompts to act as a System Architect.
    • Edit Mode: The classic "Hands-on" developer experience for writing code and running terminal commands.
  • 🔒 Sandboxed Workspace:
    • Project-First Workflow: Upon startup, users must select a specific project folder from their configured WORKSPACE_ROOT.
    • This ensures the agent is strictly confined to the chosen project context and cannot access unauthorized files on the host machine.
  • 👁️ Total Observability:
    • Real-time Tool Usage: The bot displays every tool the agent uses (e.g., view - index.html, report_intent - Exploring codebase). You see exactly what the agent sees.
    • Cancel Anytime: If the agent goes down a rabbit hole, a /cancel command instantly kills the process, giving you full control over the session.
  • 🛡️ Human-in-the-Loop Security (The Permission Bridge):
    • This is the core technical innovation. The bot intercepts "dangerous" tool calls from the SDK (like bash or create).
    • Instead of auto-executing, it renders a Telegram Inline Keyboard. You tap "Allow" or "Deny" instantly. It brings enterprise-grade control to a chat interface.
  • 👀 Multimodal Vision: Snap a photo of a whiteboard sketch or a UI mockup, send it to the chat, and watch Copilot convert pixels into boilerplate code.
  • 📊 Developer HUD: Every response includes a "Heads-Up Display" footer showing your current Git branch, dirty state, active model, and cost multiplier.

Available commands

Command Description
/start Open the main dashboard and project selector.
/help Show context-aware help with live status indicators.
/plan Toggle Plan Mode. (Great for "How should I build X?").
/edit Switch back to Chat Mode. (Implementation focus).
/model Swap the underlying LLM (e.g., gpt-4.1). Shows billing multipliers. Reasoning effort picker for supported models.
/context Display model context and token usage info.
/usage Display detailed session metrics — per-model token breakdown, cost, quota snapshots.
/session Show session info and workspace summary.
/share Export full session to Markdown file.
/cancel Cancel an in-progress request.
/clear Reset conversation memory.
/ls List files in current directory.
/cwd Show current working directory.

Tech Stack

  • Python 3.10+: Fully async implementation with modern Python features.
  • github-copilot-sdk (v0.1.23): The official SDK for Copilot CLI integration.
  • python-telegram-bot (v20+): A robust async wrapper for the Telegram Bot API.
  • uv: A fast and lightweight Python package manager.

Demo

The following workflow highlights a typical session, demonstrating how the bot assists with planning, coding, and project management directly from Telegram:

Start Message: The bot greets the user and prompts for project selection.

Start message

Greeting: A quick connectivity test with the model.

Greeting

Plan Mode: Switching to Plan Mode to brainstorm a game architecture.

Planning

Edit Mode: Switching back to Edit Mode to implement the plan.

Implement

Execute Commands: Committing and pushing changes to GitHub via chat.

Version Control

Multimodal Uploads: Uploading a UI sketch for analysis. Images are securely stored in a temporary session directory and auto-cleared upon session termination.

Multimodal Vision

More Implementation: I describe the desired feature in plain text. The agent analyzes the request, plans the changes, and implements the code.

Feature enhancement request

Seamless Branching & Pushing: Upon receiving user permission, the bot executes the git commands (branch creation, commit, push) and the session HUD updates instantly to reflect the new branch state.
Feature enhancement process

Model Selection: Swapping Copilot models and its reasoning effort via inline keyboard.

Model Selection

Permission Control: Approving risky operations (Human-in-the-Loop).

Permission Control1

Permission Control2

Interactive Options: Replying to agent clarification requests via buttons.

Ask User

File Management: Navigating the file system with ls and cwd.

ls cwd

Session Management: Managing active sessions via /session.

Session Info

Session Sharing: Exporting the full chat history to Markdown via /share.

Session Share

My Experience with GitHub Copilot CLI

It was genuinely fun to work with the github-copilot-sdk and get a "behind-the-scenes" look at how the Copilot CLI orchestrates agents. Building copilot-telegram-bot was an exercise in deconstructing and reconstructing the Copilot CLI experience for mobile.

Workflow Philosophy & Mobile Optimization

My experience with the Copilot CLI taught me that the "Plan before Execute" step is critical—verifying the agent's approach often saves hours of debugging later. I ported this workflow to the bot but quickly realized that standard CLI output is often too dense for a chat interface.

To solve this, I engineered specific system prompts for both Plan and Edit modes, injecting rules like Response must be PLAIN TEXT and Keep it scannable to force the model into brevity. This constrains the output to short, high-signal bullet points instead of verbose technical descriptions. Whether I'm reviewing an architectural plan or a debugging summary, the content remains readable on a phone screen while walking, maintaining the rigor of the CLI without the visual clutter of a terminal.

Exploring the SDK

I treated the Copilot CLI as a live reference implementation. Observing the raw event stream—watching how the agent decides to call tools, manage context, and handle state—was a fascinating experience in reverse-engineering. It felt like I was decoding the DNA of the CLI to rebuild it for a new platform.

UX Design & Feature Philosophy

I wanted to capture the spirit of the Copilot CLI's command design—which prioritizes context, structure, and control—and translate it into a mobile-first experience. I cherry-picked features that I felt would best enhance the UX in a chat environment:

  • Context Awareness & Control: The CLI builds trust by showing you exactly what it's doing line-by-line. To replicate this "glass box" experience, I enforced a Project-First Workflow (sandboxing the agent to a specific directory) and implemented Real-time Tool Usage Response. The user sees every file the agent reads and every command it attempts as a stream of chat responses, with the ability to /cancel immediately. This transparency, paired with the HUD footer (displaying active branch, dirty state, and model), ensures the developer maintains full situational awareness and control, just like in a terminal.
  • Mobile-First Interactions: Actions like model selection (/model with cost info) or permission approvals are converted into tap-friendly buttons to minimize typing.
  • Visual Context (Beyond Text): The standard CLI is limited to text input, but development is often visual. I utilized Telegram's native media handling to enable Multimodal Support. Users can upload images (like UI sketches or bug screenshots), which are sandboxed in a temporary server directory for the agent to analyze. This adds a visual dimension to the Copilot experience that a traditional terminal simply cannot offer.
  • Session Review: Similar to reviewing terminal logs, the /share command allows users to export the full session to Markdown, bridging the gap between quick mobile chats and deep desktop review.

Link

Github Repository: copilot-telegram-bot

Greeting

Day #1 - The beginning of the path

2026-02-15 18:18:41

Today is my first day when I start my journey into programming.Odin project helps me - I downloaded wsl2 and the basic modifications for VSC to make it easier for me to get used to

Result: I learned how to create, copy, delete files and directories, as well as change files in VSC WLS2
Time spent today: about 1 hour and 30 minutes

Schemas and Data Modelling in Power BI

2026-02-15 18:10:46

What is a Schema?

Schema refers to the logical structure of a database or data model that defines how tables are organized and related. In Power BI, schemas are used to optimize data storage, retrieval, and reporting.

Why Schema Matters in Power BI?

A schema in Power BI is crucial because it defines how data is structured, stored, and connected in a data model. A well-designed schema:

  • Enhances Performance — Optimized schemas improve query speed and report loading time.
  • Ensures Data Accuracy — Proper relationships prevent incorrect aggregations or duplications.
  • Simplifies Data Analysis — A clear schema makes it easier to create reports and dashboards.
  • Improves Scalability — A structured schema allows for easy expansion as data grows.
  • Optimizes DAX Calculations — Efficient schemas lead to better DAX performance and calculations.

Types of Schema

  1. Star schema Star schema is a mature modeling approach widely adopted by relational data warehouses. It requires modelers to classify their model tables as either dimension or fact. It is a widely used data modeling approach in Power BI for optimizing performance and simplifying relationships. It consists of:

Fact Table (Central Table) — Stores transactional data (e.g., sales, revenue, quantity).
It store observations or events, and can be sales orders, stock balances, exchange rates, temperatures, and more. A fact table contains dimension key columns that relate to dimension tables, and numeric measure columns. The dimension key columns determine the dimensionality of a fact table, while the dimension key values determine the granularity of a fact table.
For example, consider a fact table designed to store sale targets that has two dimension key columns Date and ProductKey. It's easy to understand that the table has two dimensions. The granularity, however, can't be determined without considering the dimension key values. In this example, consider that the values stored in the Date column are the first day of each month. In this case, the granularity is at month-product level.

Dimension Tables (Surrounding Tables) —
Describe business entities—the things you model. Entities can include products, people, places, and concepts including time itself. The most consistent table you'll find in a star schema is a date dimension table. A dimension table contains a key column (or columns) that acts as a unique identifier, and other columns. Other columns support filtering and grouping your data.
_
Contain descriptive attributes (e.g., Date, Product, Customer).
Fewer Joins — Uses one-to-many relationships, reducing complexity and improving query speed._

Normalization vs. denormalization

To understand some star schema concepts described in this article, it's important to know two terms: normalization and denormalization.

Normalization _ is the term used to describe data that's stored in a way that reduces repetitious data.

If, however, the sales table stores product details beyond the key, it's considered denormalized. In the following image, notice that the ProductKey and other product-related columns record the product.

*Measures
*

In star schema design, a measure is a fact table column that stores values to be summarized. In a Power BI semantic model, a measure has a different—but similar—definition. A model supports both explicit and implicit measures.
_Explicit measures
are expressly created and they're based on a formula written in Data Analysis Expressions (DAX) that achieves summarization. Measure expressions often use DAX aggregation functions like SUM, MIN, MAX, AVERAGE, and others to produce a scalar value result at query time (values are never stored in the model). Measure expression can range from simple column aggregations to more sophisticated formulas that override filter context and/or relationship propagation. For more information, read about DAX Basics in Power BI Desktop.
Implicit measures are columns that can be summarized by a report visual or Q&A. They offer a convenience for you as a model developer, as in many instances you don't need to create (explicit) measures. For example, the Adventure Works reseller sales Sales Amount column can be summarized in numerous ways (sum, count, average, median, min, max, and others), without the need to create a measure for each possible aggregation type.


Surrogate keys is a unique identifier that you add to a table to support star schema modeling. By definition, it's not defined or stored in the source data. Commonly, surrogate keys are added to relational data warehouse dimension tables to provide a unique identifier for each dimension table row.

Power BI semantic model relationships are based on a single unique column in one table, which propagates filters to a single column in a different table. When a dimension table in your semantic model doesn't include a single unique column, you must add a unique identifier to become the "one" side of a relationship. In Power BI Desktop, you can achieve this requirement by adding a Power Query index column.


Advantages of Star Schema

  • Optimized for Performance — Fewer joins mean faster queries and better report speed.
  • Simplifies DAX Calculations — Flat structure makes it easier to create measures and aggregations.
  • Enhances Data Visualization — Works seamlessly with Power BI’s data model and relationships.
  • Reduces Complexity — Easier to design, manage, and scale compared to Snowflake or Galaxy schemas.
  1. Snowflake schema is a set of normalized tables for a single business entity. For example, Adventure Works classifies products by category and subcategory. Products are assigned to subcategories, and subcategories are in turn assigned to categories. In the Adventure Works relational data warehouse, the product dimension is normalized and stored in three related tables: DimProductCategory, DimProductSubcategory, and DimProduct.

In Power BI Desktop, you can choose to mimic a snowflake dimension design (perhaps because your source data does) or combine the source tables to form a single, denormalized model table. Generally, the benefits of a single model table outweigh the benefits of multiple model tables. The most optimal decision can depend on the volumes of data and the usability requirements for the model.

Power BI loads more tables, which is less efficient from storage and performance perspectives. These tables must include columns to support model relationships, and it can result in a larger model size.
Longer relationship filter propagation chains need to be traversed, which might be less efficient than filters applied to a single table.
The Data pane presents more model tables to report authors, which can result in a less intuitive experience, especially when snowflake dimension tables contain only one or two columns.
It's not possible to create a hierarchy that comprises columns from more than one table.
When you choose to integrate into a single model table, you can also define a hierarchy that encompasses the highest and lowest grain of the dimension. Possibly, the storage of redundant denormalized data can result in increased model storage size, particularly for large dimension tables.


Advantages of Snowflake Schema

  • Less Data Redundancy — Normalized tables reduce duplication.
  • Better Data Integrity — Structured data ensures consistency.
  • Efficient for Large Datasets — Optimized for big data storage.
  • Easier Maintenance — Updates are more manageable.

Model relationships

A model relationship propagates filters applied on the column of one model table to a different model table. Filters will propagate so long as there's a relationship path to follow, which can involve propagation to multiple tables.

Relationship paths are deterministic, meaning that filters are always propagated in the same way and without random variation. Relationships can, however, be disabled, or have filter context modified by model calculations that use particular Data Analysis Expressions (DAX) functions

Data types of columns

The data type for both the "from" and "to" column of the relationship should be the same. Working with relationships defined on DateTime columns might not behave as expected. The engine that stores Power BI data, only uses DateTime data types; Date, Time, and Date/Time/Timezone data types are Power BI formatting constructs implemented on top. Any model-dependent objects will still appear as DateTime in the engine (such as relationships, groups, and so on). As such, if a user selects Date from the Modeling tab for such columns, they still don't register as being the same date, because the time portion of the data is still being considered by the engine.

Cardinality

Each model relationship is defined by a cardinality type. There are four cardinality type options, representing the data characteristics of the "from" and "to" related columns. The "one" side means the column contains unique values; the "many" side means the column can contain duplicate values.
If a data refresh operation attempts to load duplicate values into a "one" side column, the entire data refresh will fail.
The four options, together with their shorthand notations, are described in the following list:

  1. One-to-many (1:*)
  2. Many-to-one (*:1)
  3. One-to-one (1:1)
  4. Many-to-many (:)

One-to-many (and many-to-one) cardinality
The one-to-many and many-to-one cardinality options are essentially the same, and they're also the most common cardinality types.

When you configure a one-to-many or many-to-one relationship, choose the one that matches the order in which you related the columns. Consider how you would configure the relationship from the Product table to the Sales table by using the ProductID column found in each table. The cardinality type would be one-to-many, as the ProductID column in the Product table contains unique values. If you related the tables in the reverse direction, Sales to Product, then the cardinality would be many-to-one.

One-to-one cardinality
A one-to-one relationship means both columns contain unique values. This cardinality type isn't common, and it likely represents a suboptimal model design because of the storage of redundant data.

Many-to-many cardinality
A many-to-many relationship means both columns can contain duplicate values. This cardinality type is infrequently used. It's typically useful when designing complex model requirements. You can use it to relate many-to-many facts or to relate higher grain facts. For example, when sales target facts are stored at product category level and the product dimension table is stored at product level.

Cross filter direction
Single cross filter direction means "single direction", and Both means "both directions". A relationship that filters in both directions is commonly described as bi-directional.

For one-to-many relationships, the cross filter direction is always from the "one" side, and optionally from the "many" side (bi-directional). For one-to-one relationships, the cross filter direction is always from both tables. Lastly, for many-to-many relationships, cross filter direction can be from either one of the tables, or from both tables. Notice that when the cardinality type includes a "one" side, that filters will always propagate from that side.

Linux Fundamentals - Part 13: File Permissions &amp; Ownership

2026-02-15 18:10:05

File Permissions

In Linux, every file and folder has rules about:

  • Who can read it
  • Who can modify it
  • Who can run it

These rules help keep the system secure.

Understanding File Ownership

Every file has 3 types of owners:

  1. User (Owner) – The person who created the file
  2. Group – A collection of users
  3. Others – Everyone else on the system

You can check this using:

ls -l

Example output:

-rw-r--r-- 1 kerviejay sysad 1200 Feb 15 notes.txt

Let’s focus on this part:

kerviejay sysad
  • keviejay = file owner
  • learnlinux = group owner

Understanding Permission Symbols

Look at this part:

--rw-r--r--

Let's break it down:

rw-   r--    r--
|     |      |
User  Group  Others

Each set has 3 letters:

Letter Meaning
r Read
w Write
x Execute (run as program)
- No permission

So:

rw- - Owner can read and write
r-- - Group can only read
r-- - Others can only read

Easy Way to Understand Numbers (chmod 755?)

Each permission has a number:

Permission Value
r 4
w 2
x 1

You just add them.
Example:
7 = 4 + 2 + 1 = rwx
6 = 4 + 2 = rw-
5 = 4 + 1 = r-x

So when you see:

chmod 755 script.sh

It means:
Owner → 7 → rwx

Group → 5 → r-x

Others → 5 → r-x

8-Bit Music Theory: How They Made The Great Sea Feel C U R S E D

2026-02-15 18:05:53

Ever wondered how Wind Waker's "The Great Sea is Cursed" track went from chill adventure to full-on spooky? It's all thanks to some clever music tricks! They flipped the script on the iconic Great Sea theme, making it creepy with jarring tritones and clashing harmonies.

Plus, watch out for sneaky nods to Ganondorf's own theme, turning a heroic journey into something genuinely terrifying. It's a masterclass in making a familiar tune feel utterly cursed!

Watch on YouTube