📜 Alin Li · الفصل 13

مفتوح المصدر التراخيص
Explained for Humans

التراخيص هي قواعد المشاركة. ليست مخيفة — بل قوتك الخارقة! تعلّم أيّها تختار، وما الذي تسمح به، ولماذا تهمّ.

What Are Licenses? 📖 Help Me Choose 🧭
📖 الأساسيات

ما ترخيص البرمجيات؟

Think of it as the rules that come with sharing your creation.

🍰 The Cake Analogy

Imagine you bake an amazing cake and want to share the recipe. A license is like a little note you attach that says what others can do with it:

🔒
دون ترخيص

«لن أشارك الوصفة. يمكنك فقط أكل الكعكة التي أعطيك إياها.»

📋
ترخيص MIT

«إليك الوصفة! افعل ما تشاء، فقط اذكر أنني أعددتها.»

🔄
GPL License

«إليك الوصفة! إذا عدّلتها، يجب أن تشارك نسختك أيضًا!»

🛡️
Apache License

«إليك الوصفة! استخدمها بحرية، وأعدك ألا أقاضيك.»

⚠️ Why Licenses Matter

Without a license, your code is ليس مفتوح المصدر — even if it's on GitHub! By default, copyright law means "all rights reserved." A license is what officially gives people permission to use, modify, and share your work. No license = no one can legally use your code.

⚖️ THE BIG FIVE

أهم تراخيص المصادر المفتوحة

These 5 licenses cover 95% of all open-source projects.

📘

ترخيص MIT

The most popular license in the world — simple and free!

In plain English: «افعل بشيفرتي ما تشاء. أبقِ اسمي عليها فحسب. ولست مسؤولًا إذا تعطل شيء.»

The MIT License is the simplest and most permissive open-source license. It's just 170 words long! It lets anyone use, copy, modify, merge, publish, distribute, and even sell your code — as long as they include your original copyright notice.

✅ Use commercially
✅ Modify freely
✅ Distribute
✅ Use in closed-source projects
❌ No warranty
⚡ Must include license text
Who uses MIT?

React (Meta), VS Code (Microsoft), jQuery, Ruby on Rails, Node.js, Bootstrap, Electron, and thousands more. It's the #1 most popular license on GitHub!

// هذا هو ترخيص MIT كاملًا:
Copyright (c) [year] [your name]

يُمنح بموجب هذا إذن مجاني لأي شخص
obtaining a copy of this software... to deal in the Software
without restriction... subject to the following conditions:

The above copyright notice shall be included in all copies.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
📕

GPL (GNU General Public License)

The "share-alike" license — keep it free, forever!

In plain English: «استخدم شيفرتي بحرية. لكن إذا عدّلتها وشاركتها، يجب أن تشارك شيفرتك أيضًا بموجب GPL. لا يجوز لأحد جعلها مغلقة المصدر.»

Created by Richard Stallman, the GPL is the "copyleft" license. Its key rule: if you use GPL code in your project and distribute it, your entire project must also be GPL. This ensures the code stays free forever — no company can take it, close it, and sell it.

✅ Use commercially
✅ Modify freely
✅ Distribute
❌ Can NOT make it closed-source
⚡ Must share your changes under GPL
⚡ Must include source code
Who uses GPL?

نواة Linux وWordPress وGIMP وBlender وGCC وBash وكثير من مشاريع البرمجيات الحرة الأساسية. إذا كان جزءًا من مشروع GNU، فترخيصه GPL!

⚠️ The "viral" effect: If you use GPL code in your app, your WHOLE app must become GPL. This is why some companies avoid GPL — they don't want to open their code. But this is exactly what GPL was designed to do: keep software free forever.

📗

Apache License 2.0

مثل MIT، لكن مع حماية براءات اختراع مدمجة!

In plain English: «استخدم شيفرتي بحرية، حتى في المنتجات التجارية. وأعدك أيضًا ألا أقاضيك بشأن أي براءة اختراع في هذه الشيفرة. وإذا عدّلها أحد، فعليه توضيح ما غيّره.»

Apache 2.0 is similar to MIT but adds two important things: patent protection (يمنحك المؤلف ترخيصًا لاستخدام أي براءات اختراع في الشيفرة) و change documentation (يجب أن توضّح الملفات المعدّلة أنها عُدّلت).

✅ Use commercially
✅ Modify freely
✅ Use in closed-source
✅ Patent protection
⚡ Must include license + NOTICE file
⚡ Must note changes to files
Who uses Apache 2.0?

Android ‏(Google)، وKubernetes، وTensorFlow، وSwift ‏(Apple)، وApache HTTP Server، وKafka، وHadoop. تفضّله الشركات الكبرى بسبب بند براءات الاختراع!

📘

BSD License (2-clause & 3-clause)

The original academic freedom license

In plain English: «افعل ما تشاء. احتفظ بإشعار حقوق النشر الخاص بي. ولا تستخدم اسمي للترويج لنسختك.» يشبه MIT كثيرًا، لكنه آتٍ من الوسط الأكاديمي (Berkeley).

BSD came from the University of California, Berkeley. The 2-clause version is almost identical to MIT. The 3-clause adds a "no endorsement" rule: you can't say "Berkeley approves this" unless they actually do.

✅ Use commercially
✅ Modify freely
✅ Use in closed-source
⚡ Keep copyright notice
⚡ No endorsement (3-clause)
Who uses BSD?

FreeBSD, OpenBSD, NetBSD operating systems, Nginx, PostgreSQL (similar), and many university research projects. macOS and PlayStation OS are based on BSD!

📙

Creative Commons (CC)

ليس للشيفرة — لكل ما عداها! الفن والموسيقى والكتابة والتعليم.

In plain English: «Creative Commons للمحتوى غير البرمجي: الصور والموسيقى والفيديوهات والمستندات والمواد التعليمية. تختار القواعد باستخدام عناصر بسيطة!»

CC licenses use a mix-and-match system with 4 building blocks:

👤
BY (Attribution)
يجب ذكر المصدر
🔄
SA (Share-Alike)
Same license for remixes
🚫
NC (غير تجاري)
لا كسب للمال
🔒
ND (دون اشتقاق)
التغييرات غير مسموحة

The most open CC license is CC0 (الملك العام — دون أي قيود إطلاقًا!) و CC BY (يكفي ذكر المصدر). تستخدم ويكيبيديا CC BY-SA.

Who uses CC?

Wikipedia (CC BY-SA), Khan Academy, Flickr photos, MIT OpenCourseWare, many YouTube creators, and this Alin Li course! CC is the standard for open educational resources.

📊 جنبًا إلى جنب

جدول مقارنة التراخيص

See all licenses at a glance!

Feature MIT GPL v3 Apache 2.0 BSD
Commercial use✅ Yes✅ Yes✅ Yes✅ Yes
التعديل والتوزيع✅ Yes✅ Yes✅ Yes✅ Yes
Use in closed-source✅ Yes❌ No!✅ Yes✅ Yes
يجب مشاركة التغييرات❌ No⚠️ YES!❌ No❌ No
حماية براءات الاختراع❌ No✅ Yes✅ Yes❌ No
Keep copyright notice✅ Yes✅ Yes✅ Yes✅ Yes
تدوين التغييرات❌ No✅ Yes✅ Yes❌ No
ComplexitySimpleComplexمتوسطSimple
الطول~170 words~5,600 words~4,200 words~200 words
Best for...أقصى حريةKeeping code free foreverEnterprise + patentsمشاريع أكاديمية
🧭 تفاعلي

أي ترخيص ينبغي أن تستخدم؟

Answer 3 questions and we'll recommend the perfect license!

🧭 مساعد اختيار الرخصة

1️⃣ هل يمكن للشركات استخدام شيفرتك في منتجات مغلقة المصدر (احتكارية)؟
2️⃣ هل تريد حماية من دعاوى براءات الاختراع؟
3️⃣ ما مدى بساطة الترخيص التي تريدها؟
🛠️ دليل التنفيذ

كيفية إضافة ترخيص إلى مشروعك

It takes literally 2 minutes!

1

Go to choosealicense.com

GitHub's tool makes it easy to pick the right license with a comparison.

2

Create a LICENSE file

In the root of your project, create a file named LICENSE أو LICENSE.md

3

الصق نص الترخيص

Copy the full license text and replace [year] and [author] with your information.

4

Done! You're open source! 🎉

GitHub will automatically detect your license and show a badge on your repo. On GitHub, you can even add a license when creating a new repo — just select it from the dropdown!

🧠 اختبر نفسك

اختبار التراخيص!

لنرَ إن كنت قد فهمت التراخيص!

1. إذا لم تكن للشيفرة على GitHub رخصة، فهل يمكنك استخدامها؟

2. أي ترخيص يلزمك بمشاركة تعديلاتك بالترخيص نفسه؟

3. أي ترخيص يمنحك حماية من دعاوى براءات الاختراع؟

4. ماذا تعني «الحقوق المتروكة»؟

5. Which license is best for a school project you want everyone to use freely?

6. Creative Commons licenses are best for...