LESSONS = [
    {
        'id': 1,
        'slug': 'what-is-git',
        'title_fa': 'Git چیست؟',
        'title_en': 'What is Git?',
        'category': 'basics',
        'order': 1,
        'description_fa': 'Git یک سیستم کنترل نسخه توزیع‌شده (DVCS) است که لینوس توروالدز در سال ۲۰۰۵ برای مدیریت کد هسته لینوکس ساخت. با Git می‌توانید تاریخچه کامل تغییرات کدتان را نگه دارید، به نسخه‌های قدیمی برگردید، و با تیم همکاری کنید — بدون اینکه کارهای یکدیگر را خراب کنید.',
        'description_en': 'Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.',
        'concepts': [
            {'fa': 'ردیابی تغییرات در طول زمان', 'en': 'Track changes over time'},
            {'fa': 'برگشت به نسخه‌های قبلی', 'en': 'Revert to previous versions'},
            {'fa': 'همکاری موازی با تیم', 'en': 'Collaborate in parallel'},
            {'fa': 'مدیریت چندین نسخه پروژه', 'en': 'Manage multiple project versions'},
        ],
        'try_it': {
            'description_fa': 'اولین دستور Git را امتحان کن — نسخه نصب شده را ببین:',
            'commands': ['git --version', 'git help'],
        },
    },
    {
        'id': 2,
        'slug': 'setup',
        'title_fa': 'نصب و پیکربندی',
        'title_en': 'Setup & Config',
        'category': 'basics',
        'order': 2,
        'description_fa': 'قبل از هر چیز باید هویتت را به Git معرفی کنی. این اطلاعات در هر commit ثبت می‌شود و مشخص می‌کند چه کسی چه تغییری داده. همچنین می‌توانی ویرایشگر پیش‌فرض و رنگ خروجی را تنظیم کنی.',
        'description_en': 'Before using Git, configure your identity. This information is embedded in every commit you make.',
        'concepts': [
            {'fa': '--global یعنی برای همه پروژه‌ها روی این سیستم', 'en': '--global applies to all repos on this machine'},
            {'fa': '--local فقط برای پروژه جاری', 'en': '--local applies only to current repo'},
            {'fa': 'اطلاعات در ~/.gitconfig ذخیره می‌شود', 'en': 'Stored in ~/.gitconfig'},
        ],
        'try_it': {
            'description_fa': 'هویتت را تنظیم کن:',
            'commands': ['git config --global user.name "نام شما"', 'git config --global user.email "email@example.com"', 'git config --list'],
        },
    },
    {
        'id': 3,
        'slug': 'init-and-clone',
        'title_fa': 'ساخت و کلون ریپازیتوری',
        'title_en': 'Init & Clone',
        'category': 'basics',
        'order': 3,
        'description_fa': 'دو راه برای شروع با Git وجود دارد: یا یک ریپازیتوری جدید می‌سازی (git init) یا یک ریپازیتوری موجود را کپی می‌کنی (git clone). پوشه مخفی .git تمام تاریخچه و تنظیمات پروژه را در خود نگه می‌دارد.',
        'description_en': 'Start a new repository with git init, or copy an existing one with git clone. The .git directory holds all version history.',
        'concepts': [
            {'fa': 'git init پوشه .git می‌سازد', 'en': 'git init creates the .git directory'},
            {'fa': 'git clone کل تاریخچه را دانلود می‌کند', 'en': 'git clone downloads full history'},
            {'fa': 'origin نام پیش‌فرض remote است', 'en': 'origin is the default remote name'},
        ],
        'try_it': {
            'description_fa': 'یک ریپازیتوری جدید بساز:',
            'commands': ['git init', 'git init my-project', 'git clone https://github.com/torvalds/linux'],
        },
    },
    {
        'id': 4,
        'slug': 'add-commit',
        'title_fa': 'Stage و Commit',
        'title_en': 'Add & Commit',
        'category': 'basics',
        'order': 4,
        'description_fa': 'Git سه فضا دارد: Working Directory (فایل‌های تغییرداده‌شده)، Staging Area (آماده برای commit)، و Repository (ثبت‌شده). با git add فایل‌ها را stage می‌کنی و با git commit آن‌ها را برای همیشه در تاریخچه ثبت می‌کنی.',
        'description_en': 'Git has three states: modified (working dir), staged (index), and committed (repository). git add moves files to staging, git commit saves them permanently.',
        'concepts': [
            {'fa': 'git add . همه تغییرات را stage می‌کند', 'en': 'git add . stages all changes'},
            {'fa': 'git add -p می‌توانی بخشی از فایل را stage کنی', 'en': 'git add -p lets you stage partial changes'},
            {'fa': 'پیام commit باید واضح و توصیفی باشد', 'en': 'Commit message should be clear and descriptive'},
        ],
        'try_it': {
            'description_fa': 'فایل بساز و commit کن:',
            'commands': ['git status', 'git add README.md', 'git add .', 'git commit -m "feat: initial commit"'],
        },
    },
    {
        'id': 5,
        'slug': 'branching',
        'title_fa': 'شاخه‌بندی (Branching)',
        'title_en': 'Branching',
        'category': 'intermediate',
        'order': 5,
        'description_fa': 'Branch یعنی خط توسعه موازی. وقتی روی یک feature کار می‌کنی، یک branch جدید می‌سازی تا کد اصلی (main) را خراب نکنی. بعد از اتمام کار، branch را merge می‌کنی. این باعث می‌شود چندین توسعه‌دهنده بتوانند همزمان کار کنند.',
        'description_en': 'Branches let you develop features, fix bugs, or experiment in isolation. Create a branch, make commits, then merge back to main.',
        'concepts': [
            {'fa': 'HEAD نشانگر branch جاری است', 'en': 'HEAD points to the current branch'},
            {'fa': 'main/master branch پیش‌فرض است', 'en': 'main/master is the default branch'},
            {'fa': 'checkout -b هم می‌سازد هم سوئیچ می‌کند', 'en': 'checkout -b creates and switches in one step'},
        ],
        'try_it': {
            'description_fa': 'یک branch بساز و سوئیچ کن:',
            'commands': ['git branch', 'git branch feature/login', 'git checkout feature/login', 'git checkout -b feature/signup', 'git branch -d feature/login'],
        },
    },
    {
        'id': 6,
        'slug': 'merge-rebase',
        'title_fa': 'Merge و Rebase',
        'title_en': 'Merge & Rebase',
        'category': 'intermediate',
        'order': 6,
        'description_fa': 'دو روش برای ترکیب برنچ‌ها وجود دارد. Merge تاریخچه هر دو برنچ را حفظ می‌کند و یک commit ادغام می‌سازد — مناسب برای feature branches عمومی. Rebase تاریخچه را خطی می‌کند و انگار کارت را از ابتدا روی آخرین main نوشتی — مناسب برای نظم تاریخچه.',
        'description_en': 'Merge preserves history with a merge commit. Rebase rewrites commits on top of the target branch for a linear history.',
        'concepts': [
            {'fa': 'Merge: تاریخچه واقعی را حفظ می‌کند', 'en': 'Merge: preserves true history'},
            {'fa': 'Rebase: تاریخچه خطی و تمیز', 'en': 'Rebase: creates linear, clean history'},
            {'fa': 'هرگز روی branch عمومی rebase نکن', 'en': 'Never rebase shared/public branches'},
        ],
        'try_it': {
            'description_fa': 'merge و rebase را امتحان کن:',
            'commands': ['git merge feature/login', 'git merge --no-ff feature/login', 'git rebase main', 'git rebase --abort'],
        },
    },
    {
        'id': 7,
        'slug': 'remote',
        'title_fa': 'Remote و GitHub',
        'title_en': 'Remote & GitHub',
        'category': 'intermediate',
        'order': 7,
        'description_fa': 'Remote یک نسخه از ریپازیتوری است که روی اینترنت (مثل GitHub) زندگی می‌کند. با push تغییراتت را آپلود می‌کنی و با pull آخرین تغییرات دیگران را دریافت می‌کنی. fetch فقط دانلود می‌کند، بدون ادغام — پس می‌توانی اول بررسی کنی.',
        'description_en': 'Remotes are versions of your repo hosted on a server. push uploads, pull downloads and merges, fetch downloads without merging.',
        'concepts': [
            {'fa': 'origin نام پیش‌فرض remote است', 'en': 'origin is the conventional remote name'},
            {'fa': 'push -u tracking branch تنظیم می‌کند', 'en': 'push -u sets up tracking branch'},
            {'fa': 'pull = fetch + merge', 'en': 'pull = fetch + merge'},
        ],
        'try_it': {
            'description_fa': 'با remote کار کن:',
            'commands': ['git remote -v', 'git remote add origin https://github.com/user/repo.git', 'git push -u origin main', 'git pull origin main', 'git fetch --all'],
        },
    },
    {
        'id': 8,
        'slug': 'log-diff',
        'title_fa': 'بررسی تاریخچه',
        'title_en': 'Log & Diff',
        'category': 'advanced',
        'order': 8,
        'description_fa': 'git log تاریخچه commit‌ها را نشان می‌دهد. با فلگ‌های مختلف می‌توانی نمایش را سفارشی کنی — از یک‌خطی تا گراف رنگی. git diff تفاوت بین حالات مختلف را نشان می‌دهد: working dir، staging، یا بین دو commit.',
        'description_en': 'git log shows commit history with many display options. git diff shows differences between working dir, staging area, or commits.',
        'concepts': [
            {'fa': '--oneline هر commit را یک خط نشان می‌دهد', 'en': '--oneline shows one line per commit'},
            {'fa': '--graph ساختار branch را بصری می‌کند', 'en': '--graph visualizes branch structure'},
            {'fa': 'git diff HEAD~1 با commit قبلی مقایسه می‌کند', 'en': 'git diff HEAD~1 compares with previous commit'},
        ],
        'try_it': {
            'description_fa': 'تاریخچه را بررسی کن:',
            'commands': ['git log', 'git log --oneline', 'git log --oneline --graph --all', 'git diff', 'git diff HEAD~1', 'git show HEAD'],
        },
    },
    {
        'id': 9,
        'slug': 'undo',
        'title_fa': 'برگشت و اصلاح',
        'title_en': 'Undo & Fix',
        'category': 'advanced',
        'order': 9,
        'description_fa': 'اشتباه در Git تقریباً همیشه قابل برگشت است. reset برای لغو commit‌های local، revert برای معکوس کردن commit در تاریخچه عمومی، stash برای ذخیره موقت کارهای نیمه‌تمام، و restore برای برگشت فایل‌های تغییرداده‌شده.',
        'description_en': 'Almost everything in Git is recoverable. Use reset for local changes, revert for public history, stash to shelve work temporarily.',
        'concepts': [
            {'fa': 'reset --soft: commit را لغو کن اما تغییرات را نگه دار', 'en': 'reset --soft: undo commit but keep changes staged'},
            {'fa': 'reset --hard: همه چیز را پاک کن — خطرناک!', 'en': 'reset --hard: discard all changes — dangerous!'},
            {'fa': 'revert یک commit جدید می‌سازد — برای تاریخچه عمومی', 'en': 'revert creates new commit — safe for shared history'},
        ],
        'try_it': {
            'description_fa': 'اصلاح اشتباه را امتحان کن:',
            'commands': ['git stash', 'git stash pop', 'git reset --soft HEAD~1', 'git revert HEAD', 'git restore .'],
        },
    },
    {
        'id': 10,
        'slug': 'github-flow',
        'title_fa': 'GitHub Flow',
        'title_en': 'GitHub Flow',
        'category': 'advanced',
        'order': 10,
        'description_fa': 'GitHub Flow یک workflow ساده است: یک branch از main بساز، کار کن، push کن، Pull Request باز کن، review بگیر، و merge کن. این روش در اکثر تیم‌های حرفه‌ای استاندارد شده و مناسب برای Continuous Deployment است.',
        'description_en': 'GitHub Flow: branch from main, commit, push, open PR, review, merge. Simple and effective for teams using continuous deployment.',
        'concepts': [
            {'fa': 'همیشه از main branch بساز', 'en': 'Always branch from main'},
            {'fa': 'Pull Request فرصت code review است', 'en': 'PR is the code review checkpoint'},
            {'fa': 'بعد از merge، branch را حذف کن', 'en': 'Delete branch after merge'},
        ],
        'try_it': {
            'description_fa': 'GitHub Flow را شبیه‌سازی کن:',
            'commands': ['git checkout -b feature/dark-mode', 'git add .', 'git commit -m "feat: add dark mode toggle"', 'git push origin feature/dark-mode'],
        },
    },
]
