Skip to content

Lorite/lorite-personal-learning

Repository files navigation

Contributors Forks Stargazers Issues CC BY-NC 4.0 License LinkedIn


Logo

Lorite personal learning

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
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Fun explanation

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.

lorite-personal-learning-monorepo

Boring explanation

Welcome to my personal learning repository :bowtie:. 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 🤞.

Dev-ops-meme

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!

welcome-to-my-git-commit-history-meme

(back to top)

Getting started

Prerequisites

  1. Install Docker on your machine.

  2. Install VS Code or VS Code insiders on your machine.

  3. Install git on your machine and configure it with your GitHub account.

Try out the repository using GitHub Codespaces

  1. Click on the green Code button on the top right of the repository and select Open with Codespaces.

Learn more about GitHub Codespaces.

Installation

  1. 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.

  2. Clone this repository.

    git clone git@github.com:Lorite/lorite-personal-learning.git
  3. 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
  4. Press F1 and select Remote-Containers: Reopen in Container to build and start the container. This step may take a while the first time.

  5. 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 the BAZEL BUILD TARGETS from the Explorer panel (after opening any BUILD.bazel file).

(back to top)

Usage

Dev Container

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

Code

Find a collection of small projects to learn about different languages and tools. All the code can be found in the src folder.

Courses

The open source courses can be found in the courses-free folder. The courses are:

There is also a courses-licensed folder with licensed courses but the code is not included.

Examples

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.

Exercises

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.

    C++ Bazel GitHub-actions

  • 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.

    C++ Bazel GitHub-actions

Subrepos

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:

Continuous Integration/Continuous Deployment

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 actions are defined in the .github/workflows folder. Bazel's cache is used to speed up the builds.

VS Code extensions

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.

  • TODO: add missing extensions from the .devcontainer/devcontainer.json file.

(back to top)

Roadmap

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.

(back to top)

Contributing

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 🙏.

Resources

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.

Documenting

Bazel

Dev container

Multi-language

Python

C++

JAVA

LaTeX

(back to top)

License

Copyright (c) Alejandro Lorite Mora (a.lorite.mora@gmail.com). All rights reserved.

Licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. See LICENSE.

(back to top)

About

My little software laboratory

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published