A monorepo for learning about different tools, workflows, programming languages, and anything related to software development.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Imagine a vibrant digital landscape where code languages bloom like a garden of diverse flowers. At the center of this repository, a mighty Bazel tree stands tall, its branches extending to support Python vines, C++ oaks, C# cherry blossoms, Go bamboo shoots, Javascript willow branches, and dozens of undiscovered species. The air is filled with the harmonious hum of CI/CD bees buzzing around, ensuring a seamless flow of updates.
In the background, the VS Code devcontainer rises like a futuristic tower, with its windows opening to reveal a panoramic view of the coding ecosystem within. GitHub action satellites orbit overhead, keeping a watchful eye on the repository, ready to launch into action at any moment.
The colors are bold and dynamic, reflecting the energy and versatility of your monorepo. And in the foreground, the README.md serves as a welcoming path, inviting developers to step into this lush garden of code, explore its wonders, and contribute to the ever-growing landscape.
Welcome to my personal learning repository . I use it to learn about different tools, workflows, programming languages, and anything related to software development, really. Personally, I like to have an overview of the different tools and languages and how they work together. I am getting started with DevOps and CI/CD, so I am using this repository to learn about it, mainly using dev containers, Bazel, and GitHub actions to build the monorepo. I also code in my everyday job, so I also follow specific language courses and try out examples on this repository. I believe that programmers should be able to do everything, from designing the architecture to deploying the software; and this repository can help me (and maybe you) to achieve that. I have high hopes for this repository 🤞.
This repo can be directly used as a container for development. It is based on the Ubuntu base container from the GitHub devcontainers images repo. The container includes a lot of tools to make developing much easier for beginners and forget about ci/cd. It uses a collection of Dev Container Features from the devcontainers features repo.
This repository could not have been possible without the help of the open source community. I have used a lot of open source tools and courses to learn about different topics. I have tried to include all the resources I have used in the Resources section. If you find any missing, please let me know.
If I have seen further, it is by standing on the shoulders of giants.
- Isaac Newton
You can read the commit messages to see what I have been doing. I try to keep them as descriptive as possible. I also try to keep the code as clean as possible. I am not perfect 😅 so sometimes I have to fix my own commits!
-
Install Docker on your machine.
-
Install VS Code or VS Code insiders on your machine.
-
Install git on your machine and configure it with your GitHub account.
- Click on the green
Code
button on the top right of the repository and selectOpen with Codespaces
.
Learn more about GitHub Codespaces.
-
If this is your first time using a development container, please check the getting started information on VS Code remote - setting up Remote-Containers or GitHub Docs - Creating a codespace using GitHub Codespaces.
-
Clone this repository.
git clone [email protected]:Lorite/lorite-personal-learning.git
-
Open VS Code using the VS Code workspace file (.ws.code-workspace) in the root of the repository.
cd lorite-personal-learning code .ws.code-workspace
-
Press F1 and select Remote-Containers: Reopen in Container to build and start the container. This step may take a while the first time.
-
Build something using bazel:
bazel build //src/examples/bazel-test-project-cpp:hello-world
NOTE: You can also use the
Bazel: build target
command from the VS Code extension, or theBAZEL BUILD TARGETS
from theExplorer
panel (after opening anyBUILD.bazel
file).
Some of the tools and languages included in the dev container are:
- Bazel for building and testing software of any size, quickly and reliably. This is the main and most important tool used in this repository. Some of the reasons to use bazel over other build tools are:
- Reproducibility: Bazel ensures that builds are hermetic, meaning they are isolated and deterministic.
- Speed and Efficiency: Bazel uses aggressive caching and parallel execution to speed up both incremental and clean builds. It only rebuilds what is necessary by tracking dependencies between different parts of your codebase.
- Scalability: Bazel is designed to handle large codebases across multiple repositories.
- Multi-language support: Bazel supports a wide range of programming languages out of the box.
- Community: Bazel is used and supported by many Google projects, as well as a growing number of projects in the open source community.
- Open source: Bazel is open source and maintained by a growing community of contributors.
- LLDB for debugging. This extension is used along with VS Code launch profiles and tasks that are already set up in this repo. You can try pressing F5 on any editor-opened code file. You may need to modify the location of the output file in the launch profiles manually for now.
- zsh + powerlevel10k + plugins for a better terminal experience.
- Many VS Code extensions. See .devcontainer/devcontainer.json for the full list. You can also check the section VS Code extensions for more information.
- LaTeX for writing documents.
- C++ with LLVM tools: clangd with clang-format and clang-tidy when saving files.
- C#
- Python
- pip for installing Python packages.
- Go
- JAVA
- Markdown for writing documentation. Vale is used for linting and style checking.
- Aspect Docs - Run linters and formatters under Bazel. Run
tools/lint/scripts/aspect_lint.sh //path/to:target
to run linters under Bazel. These linters and formatters are also run in the CI/CD pipeline. Runbazel run //:format
to format all the code in the repository. These steps will also be triggered by the GitHub actions when a PR is opened.
Find a collection of small projects to learn about different languages and tools. All the code can be found in the src folder.
The open source courses can be found in the courses-free folder. The courses are:
-
GitHub Skills: Learn how to use GitHub with interactive courses designed for beginners and experts. src/courses-free/github_skills
-
Microsoft Learning: Getting started with C#: Learn the basic syntax and thought processes required to build simple applications using C#. src/courses-free/microsoft_learning/000.get_started_with_csharp
-
hacking C++ - C++ Beginner's Guide: Learn modern, idiomatic C++. It is (roughly) ordered by increasing level of C++ proficiency. src/courses-free/hacking_cpp
There is also a courses-licensed folder with licensed courses but the code is not included.
The examples can be found in the examples folder. Most of the examples in my repo are really simple. For more elaborated examples, check the bazelbuild/examples repository and the depracated bazelbuild/bazel/examples folder. The examples are:
- C++ Bazel: A simple C++ project using Bazel.
- C# Bazel: A simple C# project using Bazel.
- Python flask Bazel: A simple Python flask project using Bazel.
- Java Bazel: A simple Java project using Bazel with Maven dependencies.
- Shell: A simple Shell project using Bazel.
The exercises can be found in the exercises folder. The exercises are:
-
Leetcode: LeetCode is the a platform to help you enhance your skills, expand your knowledge and prepare for technical interviews. The challenges cover a wide range of programming topics and come with a discussion forum for each problem, where users can discuss various solutions. Check the src/exercises/leetcode directory for more info on how I organize the exercises and run them in an optimal way.
-
Job interviews: A collection of exercises to prepare and asked at job interviews. Check the src/exercises/job-interviews directory and the subfolders for more info.
Bazel is used to pull most dependent repositories and build them. However, the files stay in a cache folder and are not included in the repository source code. For the sub repositories that we want to keep the files in the repository, we use the tool git-subrepo by ingydotnet. This allows us to modify the files in the subrepos and still pull from the original repository.
The folder subrepos is then used to store these repositories. The subrepos are:
-
ultimate-python: The Ultimate Python study guide for newcomers and professionals alike. src/subrepos/ultimate-python. Original repository: huangsam/ultimate-python.
GitHub Actions is a CI/CD (Continuous Integration/Continuous Deployment) service provided by GitHub. In this repository, it is used for running bazel build and bazel test on all the targets under src/. The files are also formatted automatically in a separate commit. The actions are triggered when a PR is opened and when the PR is merged. The actions are defined in the .github/workflows folder. Bazel's cache is used to speed up the builds.
As stated earlier, you can check the .devcontainer/devcontainer.json file to see al the extensions installed on the dev container by default. You can also check the workspace settings file for configuration. Remember that the workspace file must be opened in VS Code. The extensions are:
-
bazelbuild.vscode-bazel: Bazel support for VS Code. Features:
- Syntax highlighting
- Bazel Build Targets tree displays the build packages/targets in your workspace.
- CodeLens links in BUILD files to directly launch a build or test by simply clicking on the targets
- Buildifier integration to lint and format your Bazel files (requires that Buildifier be installed)
- Debug Starlark code in your .bzl files during a build (set breakpoints, step through code, inspect variables, etc.)
-
vadimcn.vscode-lldb: LLDB Debugger support for Visual Studio Code mainly for C++ and Rust. It is also usable with most compiled languages whose compiler generates compatible debugging information.
-
chrischinchilla.vale-vscode: The Vale extension for VS Code provides customizable spelling, style, and grammar checking for a variety of markup formats (Markdown, AsciiDoc, reStructuredText, HTML, and DITA). It is also used it for vocabulary and style checking in the code.
-
TODO: add missing extensions from the .devcontainer/devcontainer.json file.
See the open issues for a full list of proposed features (and known issues).
See the GitHub project for the tasks and project roadmap. The tasks are linked to the issues.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated 🙏.
This section contains the resources for DevOps, CI/CD, and programming languages. There are hundreds of other resources that I have used to learn about these topics, but I can't include them all here. I have tried to include the most important ones. Apart from the list below, there are more links and resources scattered around this repository in subfolders. Needless to say, there are very nice repositories with a lot of resources, like awesome-bazel on GitHub, so search for them if you are looking for a deeper dive into a specific topic.
- Bazel build
- Bazel GitHub repository
- Bazel bzlmod migration and Bazel Central Registry from 2024-07-22 onwards.
- Experimentations on Bazel - GitHub actions by David Bernard
- Bazel zsh terminal completion
- Alex Eagle - .bazelrc flags you should enable
- Python structuring your project by Kenneth Reitz
- Python Rules for Bazel
- Python rules for pip in Bazel
- Simple Python flask app using Bazel
- C++ reference, hacking C++, W3 schools - C++ Tutorial, ...
- C++ Rules for Bazel
- LLVM toolchain for bazel
- Clang: a C language family frontend for LLVM
- Hedron's Compile Commands Extractor for Bazel
- GoogleTest - gtest
- Google benchmark
- Google logging library (glog)
Copyright (c) Alejandro Lorite Mora ([email protected]). All rights reserved.
Licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. See LICENSE.