项目介绍

Build Your Own X 是 GitHub 上最受欢迎的学习资源之一,由 CodeCrafters 团队维护。这个仓库汇集了大量精心编写的分步指南,帮助开发者通过从零开始重新创建各种技术来深入理解其工作原理。

正如著名物理学家理查德·费曼所说:"我无法创造的,我就无法理解。" 这个项目正是基于这一理念,鼓励开发者通过动手实践来掌握编程技术。无论你是初学者还是资深开发者,这里都有适合你的教程。

项目信息详情
维护者CodeCrafters, Inc.
GitHub Stars474,008+
教程类别30+ 个技术领域
编程语言涵盖 C, C++, Python, JavaScript, Go, Rust, Java 等 20+ 种语言
许可证CC0 (公共领域)

教程分类

项目涵盖了以下技术领域,每个领域都有多个高质量的分步教程:

3D 渲染器

学习光线追踪、光栅化等图形学核心技术,使用 C++、JavaScript、Python 等语言实现。

AI 模型

从零构建大语言模型(LLM)、扩散模型、RAG文档搜索系统。

区块链 / 加密货币

使用 Go、Python、JavaScript、Rust 等语言实现区块链和加密货币系统。

数据库

从简单数据库到 Redis 克隆,涵盖 B+Tree、SQL、KV 存储等核心概念。

Docker 容器

了解 Linux 容器的工作原理,用 Go、Python 甚至 Shell 脚本实现容器化。

游戏开发

从俄罗斯方块到 RPG,从 2D 到 3D,使用多种语言和引擎开发游戏。

Git 版本控制

通过实现 Git 来深入理解版本控制系统的内部原理。

神经网络

从感知器到卷积网络,从 OCR 到音乐生成,全面理解深度学习。

操作系统

从引导程序到内核,从内存管理到多任务,构建你自己的操作系统。

编程语言

实现解释器、编译器、垃圾回收器,理解编程语言的本质。

Web 服务器

用 Python、Node.js、C#、PHP 等语言从零构建 HTTP 服务器。

更多领域

还包括:Bot、命令行工具、模拟器、前端框架、物理引擎、正则引擎、搜索引擎、Shell、文本编辑器等。

精选教程推荐

  • Ray Tracing in One Weekend (C++) — 一个周末就能完成的光线追踪渲染器,图形学入门经典
  • LLMs from Scratch (Python) — 从零实现大语言模型,深入理解 GPT 架构
  • Building Blockchain in Go — 用 Go 语言逐步构建区块链,理解共识机制
  • Let's Build a Simple Database (C) — 从零实现一个简单数据库,理解 B-Tree 和页面存储
  • Writing an OS in Rust — 用 Rust 编写操作系统,涵盖内存管理、中断处理等
  • Crafting Interpreters (Java) — 构建编程语言解释器的权威教程
  • Build your own React (JavaScript) — 重新实现 React 核心,理解虚拟 DOM 和 Fiber 架构
  • Neural Networks: Zero to Hero (Python) — Andrej Karpathy 的神经网络系列教程
  • Build Your Own Redis (C++ / Go) — 从零构建 Redis,掌握高性能存储系统设计
  • Build Your Own Text Editor (C) — 从终端控制到文本编辑的完整实现

如何使用

使用 Build Your Own X 非常简单,按照以下步骤即可开始你的学习之旅:

  • 第一步:选择感兴趣的领域 — 浏览项目目录,找到你想深入了解的技术领域
  • 第二步:选择编程语言 — 每个领域通常有多种语言的教程,选择你熟悉或想学习的语言
  • 第三步:跟随教程动手实践 — 打开教程链接,按照步骤编写代码,不要只是阅读
  • 第四步:扩展和改进 — 完成基础教程后,尝试添加新功能或优化性能
  • 第五步:分享你的成果 — 将项目分享到 GitHub,帮助其他学习者
# 克隆仓库到本地 git clone https://github.com/codecrafters-io/build-your-own-x.git # 浏览 README 寻找感兴趣的教程 cd build-your-own-x # 选择教程后,按照链接中的步骤开始实践

支持的编程语言

语言教程数量热门领域
Python30+神经网络、区块链、数据库、Bot、Web服务器
JavaScript30+前端框架、游戏、区块链、编程语言
C25+操作系统、数据库、Shell、文本编辑器
C++20+3D渲染器、游戏、模拟器、物理引擎
Go15+区块链、Docker、数据库、命令行工具
Rust10+操作系统、Web浏览器、文本编辑器、命令行工具
Java8+编程语言、游戏、3D渲染器
Ruby6+区块链、Git、游戏
C#8+游戏、增强现实、数据库、Web服务器
其他多种Haskell, Nim, Kotlin, TypeScript, Scala 等

常见问题

这个项目适合编程初学者吗?
部分教程适合初学者,但大多数教程需要一定的编程基础。建议先掌握至少一门编程语言的基础语法后再开始。你可以从较简单的项目(如命令行工具、模板引擎)开始,逐步挑战更复杂的项目。
需要安装什么软件才能开始?
取决于你选择的教程和编程语言。通常你需要安装对应语言的编译器或解释器(如 Python、Node.js、GCC 等)以及一个代码编辑器(如 VS Code)。每个教程通常会在开头说明所需的环境配置。
完成一个教程通常需要多长时间?
时间因教程复杂度而异。简单的项目(如正则引擎、模板引擎)可能只需几个小时,而复杂的项目(如操作系统、编译器)可能需要数周甚至数月。建议合理安排时间,每天坚持一点进度。
我可以把完成的项目用于商业目的吗?
这个仓库本身使用 CC0 许可证(公共领域),但各个教程的代码可能有不同的许可证。建议查看具体教程的许可证信息。不过,通过教程学到的知识和自己编写的代码通常可以自由使用。
如何为这个项目做贡献?
你可以通过提交 Pull Request 来添加新的教程链接,或者创建 Issue 来推荐优质教程。确保推荐的教程是高质量的分步指南,而不仅仅是概念介绍。详情请查看项目的贡献指南。
有中文版的教程吗?
仓库中的教程链接主要为英文,但部分教程有社区翻译的中文版本。此外,许多中国开发者也创建了中文版的"从零构建"教程。你可以在 GitHub 上搜索相关的中文资源。

社区议题

以下是该项目当前开放的 Issue(按评论数排序),共 98 条,标题已翻译为中文供参考。

编号 议题标题(中文翻译 / 英文原文) 创建日期 评论
#739 What are the difficulty levels of each of these 教程? What 应该 I know before trying any of these?
What are the difficulty levels of each of these tutorials? What should I know before trying any of these?
2022-06-06 30
#1427 构建 your own payment gateway from scratch
Build your own payment gateway from scratch
2025-05-04 6
#548 如何 构建 your own Uber-for-X App
How to build your own Uber-for-X App
2020-10-30 5
#1280 Using dart to 构建 版本 control
Using dart to build version control
2024-11-15 4
#1272 构建 a web 服务器 in assembly
Build a web server in assembly
2024-10-26 4
#1118 构建 your own disassembler?
Build your own disassembler?
2024-08-01 4
#1026 Not really an issue : Website
Not really an issue : Website
2024-03-30 5
#860 BitTorrent Protocol from scratch (with inline Node.js scripts)
BitTorrent Protocol from scratch (with inline Node.js scripts)
2023-03-02 4
#714 损坏 链接
Broken link
2022-04-15 4
#703 构建 your own AI
Build your own AI
2022-02-21 4
#579 A complete webapp with no frameworks
A complete webapp with no frameworks
2021-02-02 4
#1623 添加 Java: 实现 a RESTful Web API with Spring Boot (Web 服务器 Section)
Add Java: Implementing a RESTful Web API with Spring Boot (Web Server Section)
2025-11-26 3
#1466 构建 your own billing/payments system
Build your own billing/payments system
2025-06-26 3
#1015 [添加] Game JavaScript: How I Remade 2048
[Add] Game JavaScript: How I Remade 2048
2024-02-23 3
#762 Inacessible 链接 to a Voxel Engine video
Inacessible link to a Voxel Engine video
2022-07-04 3
#721 Any good 链接 to learn 如何 make APIs?
Any good link to learn how to make APIs?
2022-04-21 3
#631 Android Webview 教程
Android Webview Tutorial
2021-06-10 3
#594 What 会 SQLite look like if written in Rust?
What would SQLite look like if written in Rust?
2021-02-18 3
#578 Submission: 构建 Your Own Text Compression Utility From Scratch
Submission: Build Your Own Text Compression Utility From Scratch
2021-02-01 3
#577 Creating a Twitter Bot in Go
Creating a Twitter Bot in Go
2021-02-01 3
#1630 Rust Roguelike
Rust Roguelike
2025-12-10 2
#1599 添加 Table of Contents to README for easier navigation
Add Table of Contents to README for easier navigation
2025-10-31 2
#1531 "Rust: Hecto: 构建 your own text editor in Rust" 链接 is 不正确
"Rust: Hecto: Build your own text editor in Rust" link is incorrect
2025-08-13 2
#1390 添加 a complete guide 如何 创建 vpn service
Add a complete guide how to create vpn service
2025-03-18 2
#1016 Code a simple P2P blockchain in Go!
Code a simple P2P blockchain in Go!
2024-02-23 5
#998 [添加] Python: 如何 构建 a Serverless Slack App using Python and AWS SAM
[Add] Python: How to Build a Serverless Slack App using Python and AWS SAM
2024-01-28 2
#978 Creating your very own 搜索 engine from scratch using Java
Creating your very own search engine from scratch using Java
2023-12-30 2
#960 Building your own Compiler using C#
Building your own Compiler using C#
2023-11-16 1
#918 [添加] Building an OS
[Add] Building an OS
2023-07-14 2
#907 Learn x86-64 assembly by writing a GUI from scratch (gaultier.github.io)
Learn x86-64 assembly by writing a GUI from scratch (gaultier.github.io)
2023-06-02 2
#883 There is a high lack of Rust projects.
There is a high lack of Rust projects.
2023-04-21 2
#799 构建 your own Multithreaded Web 服务器 in Rust
Build your own Multithreaded Web Server in Rust
2022-08-28 2
#780 LinuxFromScratch seems cospicuous in its absence
LinuxFromScratch seems cospicuous in its absence
2022-07-20 2
#627 tranformer from scratch in pytorch
tranformer from scratch in pytorch
2021-05-30 2
#377 添加 "Let's Write a Brainfuck Compiler" (JavaScript)
Added "Let's Write a Brainfuck Compiler" (JavaScript)
2019-09-26 2
#1683 损坏 链接 for neural network OCR
broken link for neural network OCR
2026-03-07 1
#1673 X
X
2026-02-23 1
#1645 how does one use this repo to learn programming ?
how does one use this repo to learn programming ?
2025-12-29 1
#1612 损坏 链接 for "Python:构建 a Reddit bot"
Broken Link for "Python:Build a Reddit bot"
2025-11-14 1
#1580 损坏 链接: "CSS: A 搜索 engine in CSS" under '构建 your own 搜索 Engine'
Broken link: "CSS: A search engine in CSS" under 'Build your own Search Engine'
2025-10-19 1
#1524 构建 your own Reddit bot domain is 损坏
Build your own Reddit bot domain is broken
2025-08-04 1
#1494 Blockchain Fundamentals and Integrated Node Service - 构建 your own X
Blockchain Fundamentals and Integrated Node Service - Build your own X
2025-07-01 1
#1431 如何 study from codecrafters website
How to study from codecrafters website
2025-05-11 1
#1391 Hardware 教程
Hardware Tutorials
2025-03-21 1
#1312 构建 your own proxy service
Build your own proxy service
2025-01-07 1
#1295 Weather command-line app in Dart
Weather command-line app in Dart
2024-12-09 1
#1292 Complexity level of projects
Complexity level of projects
2024-12-03 1
#1275 Writing a tiny x86 bootloader" website 安全 certification has expired
Writing a tiny x86 bootloader" website security certification has expired
2024-11-06 1
#1271 构建 a NoSQL 数据库 using Go
Build a NoSQL Database using Go
2024-10-26 1
#1133 添加 To-Do CLI Application that written in C++
Add To-Do CLI Application that written in C++
2024-08-21 1
#1080 构建 your own 搜索 engine in Javascript
Build your own search engine in Javascript
2024-06-27 1
#1079 链接 dead: 错误 correction fountain code
Link dead: Error correction fountain code
2024-06-27 1
#1022 Go 教程 submission
Go tutorial submission
2024-03-17 1
#1018 构建 your own compiler web 服务器 using nodejs
Build your own compiler web server using nodejs
2024-03-03 1
#975 The 教程 "JavaScript: 构建 GIT - Learn GIT" has not finished yet
The tutorial "JavaScript: Build GIT - Learn GIT" has not finished yet
2023-12-21 1
#877 [添加] Write your own Virtual Machine in 62 lines of Ada
[Add] Write your own Virtual Machine in 62 lines of Ada
2023-04-09 1
#866 [添加] Neural Networks and Deep Learning
[Add] Neural Networks and Deep Learning
2023-03-10 1
#826 React Clone 教程
React Clone Tutorial
2022-11-29 1
#760 Submission: 构建 your own GPT
Submission: Build your own GPT
2022-06-30 1
#756 Submission: Making the Virtual DOM. Faster.
Submission: Making the Virtual DOM. Faster.
2022-06-20 1
#724 Virtual machine in C 链接 not available
Virtual machine in C link not available
2022-04-23 1
#708 spencertipping/shell-教程
spencertipping/shell-tutorial
2022-03-15 1
#704 Web 服务器
Web server
2022-02-23 1
#666 构建 your own Minecraft cheat 客户端 in fabric 1.17.1
Build your own Minecraft cheat client in fabric 1.17.1
2021-10-19 1
#658 构建 your own VPN using a Cloud Host or A Raspberry Pi
Build your own VPN using a Cloud Host or A Raspberry Pi
2021-09-28 1
#653 添加 Ray Tracing in One Weekend
Add Ray Tracing in One Weekend
2021-09-10 1
#621 Building K-means clustering algorithm from scratch
Building K-means clustering algorithm from scratch
2021-05-01 1
#604 Rust Book - Final Project: Writing a Multithreaded Web 服务器
Rust Book - Final Project: Writing a Multithreaded Web Server
2021-03-21 1
#567 创建 Your Own Compiler
Create Your Own Compiler
2021-01-31 1
#498 Building a Slack Bot in Javascript
Building a Slack Bot in Javascript
2020-06-30 1
#482 构建 your own redux from scratch
Build your own redux from scratch
2020-05-24 1
#480 [ 教程 ] Writing a simple 数据库 in Rust
[ Tutorial ] Writing a simple database in Rust
2020-05-20 1
#467 Good to have 教程 链接 on building your own framework.
Good to have tutorial links on building your own framework.
2020-04-14 1
#415 构建 an 8-bit computer by Ben Eater
Build an 8-bit computer by Ben Eater
2019-11-23 1
#385 添加 "I wrote my module bundler"
Adding "I wrote my module bundler"
2019-10-16 1
#365 [Game] Pac Go - Pac Man clone 教程 for the terminal written in Go
[Game] Pac Go - Pac Man clone tutorial for the terminal written in Go
2019-07-25 1
#347 Probabilistic machine learning algorithm in R 教程
Probabilistic machine learning algorithm in R tutorial
2019-04-04 1
#325 A Web 服务器 in C
A Web Server in C
2019-03-01 6
#1680 FileShot.io – Open-source zero-knowledge 文件 sharing (构建 your own 版本)
FileShot.io – Open-source zero-knowledge file sharing (build your own version)
2026-03-03 0
#1679 Suggest: 构建 your own zero-knowledge 文件 sharing service (AES-256-GCM + URL fragment key)
Suggest: Build your own zero-knowledge file sharing service (AES-256-GCM + URL fragment key)
2026-03-03 0
#1671 Python: 构建 a reddit bot
Python: Build a reddit bot
2026-02-18 0
#1658 I don't think tokio.rs' "构建 your own redis" 应该 be included in the "构建 your own 数据库 section". It's more of a async rust programming 教程.
I don't think tokio.rs' "Build your own redis" should be included in the "Build your own database section". It's more of a async rust programming tutorial.
2026-01-17 0
#1653 添加 "构建 your own anime char renderer on WebGPU from scratch"
Add "Build your own anime char renderer on WebGPU from scratch"
2026-01-07 0
#1642 添加 "Creating a Machine Learning Library from Scratch in Python"
Add "Creating a Machine Learning Library from Scratch in Python"
2025-12-28 0
#1604 Ethernet Frame Analyzer in Python
Ethernet Frame Analyzer in Python
2025-11-06 0
#1595 请求 for Language 服务器 (LSP)
Request for Language Server (LSP)
2025-10-29 0
#1588 There 应该 be a 构建-your-own-cmake, who's gonna do it?
There should be a build-your-own-cmake, who's gonna do it?
2025-10-27 0
#1585 [添加] Building a Web App... in Assembly?! A CGI Proof of Concept
[Add] Building a Web App... in Assembly?! A CGI Proof of Concept
2025-10-24 0
#1577 outdated Telegram Bot with Js
outdated Telegram Bot with Js
2025-10-12 0
#1571 链接 Dead for "C: Handmade Hero"
Link Dead for "C: Handmade Hero"
2025-10-05 0
#1568 Building a game with python and arcade library
Building a game with python and arcade library
2025-10-05 0
#1566 构建 your own AMP (E.G. New Relic)
Build your own AMP (E.G. New Relic)
2025-10-02 0
#1562 构建 your own fan control software
Build your own fan control software
2025-09-24 0
#1539 Learning Transformer Models
Learning Transformer Models
2025-08-19 0
#1523 The Java Voxel Engine 教程 video nolonger exists
The Java Voxel Engine Tutorial video nolonger exists
2025-08-03 0
#1507 "R: 构建 A Cryptocurrency Trading Bot with R", The 页面 takes us to a 404 错误
"R: Build A Cryptocurrency Trading Bot with R", The page takes us to a 404 error
2025-07-08 0
#1495 构建 an MCP 客户端 and 服务器 from scratch
Build an MCP client and Server from scratch
2025-07-01 0
#1464 添加 Two New Tools – Advanced 图片 Steganography and Infinity Apk Scanner
Add Two New Tools – Advanced Image Steganography and Infinity Apk Scanner
2025-06-26 0