You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An advanced guide to the Layer5 Academy architecture, multi-repository workflow, and development best practices for platform contributors.
5
+
An advanced guide to the Layer5 Academy architecture, multi-repository workflow, and development best practices for contributors.
6
6
categories: [Academy]
7
7
---
8
8
9
-
This guide explores the multi-repository architecture, explains the role of each core component, and provides practical workflows for theme development, local testing, and end-to-end validation with Layer5 Cloud.
9
+
This guide walks you through the Layer5 Academy platform's multi-repository architecture. You will learn the role of each core component and master the practical workflows for theme development, local testing, and end-to-end validation with Layer5 Cloud.
10
10
11
11
## The Multi-Repository Model
12
12
13
-
The [Layer5 Academy platform](https://cloud.layer5.io/academy) is built on a "separation of concerns" architecture. Instead of a single monolithic repository, we use a multi-repository model where content, presentation (theme), and build configurations are managed independently. This approach keeps the system modular, simplifies maintenance, and allows teams to work on different parts of the platform concurrently.
13
+
The [Layer5 Academy platform](https://cloud.layer5.io/academy) is built on a "separation of concerns" architecture. Instead of a single monolithic repository, we use a multi-repository model where content, style, and build configurations are managed independently. This approach keeps the system modular, simplifies maintenance, and allows teams to work on different parts of the platform concurrently.
14
14
15
15
At a high level, the `academy-theme` provides the visual style for content from repositories like `academy-example`, and the `academy-build` repository acts as the central factory, assembling everything into the final website.
16
16
17
-
> [layer5-academy](https://github.com/layer5io/layer5-academy) repository hosts all official learning paths and courses published by Layer5. It serves as a feature-complete reference.
17
+
## Core Repositories
18
18
19
-
## A Deep Dive into the Core Repositories
20
-
21
-
The Layer5 Academy platform is composed of several core repositories, each with a distinct purpose.
19
+
The Layer5 Academy platform is composed of several core repositories.
This repository is the "skin" for the entire Academy. It controls the website's design, including all the layouts, colors, and fonts.
26
24
25
+
Content repositories automatically import this theme as a Go Module. As a content creator, you do not need to fork or clone this repository; your academy will use these styles by default.
This is the "starter kit" for anyone new to creating Academy content. It provides a pre-configured site that new organizations can fork to get started quickly.
30
30
31
-
> [Learn How](../cloud/academy/creating-your-learning-path/index.md) to create your own learning path
31
+
> [Learn How](../creating-your-learning-path/) to create your own learning path
32
32
33
-
The workflow in this repository is designed to act as a "gatekeeper" for new content. When you create a new GitHub Release, it triggers the following process:
33
+
This content repository doesn't build the final website itself. Instead, it uses an automated workflow to act as a "gatekeeper" for new content. When you create a new GitHub Release, it triggers the following process:
34
34
35
35
1.**Sanity Check**: It first runs a local build to ensure the new content has no fundamental errors that would break the site.
36
36
@@ -44,62 +44,64 @@ This request effectively says: "A new version of content is ready for this organ
44
44
45
45
**This is the central hub of the entire system.** It contains the main Hugo configuration for the production build and uses Go Modules to manage the versions of all content modules and the `academy-theme`.
46
46
47
-
This repository is the **"assembly factory"** and the central hub of the entire system. It holds the master plan for building the final website.
48
-
49
-
When triggered, its automated process acts like a master assembly line:
47
+
When its workflow is triggered, an automated process acts like a master assembly line:
50
48
51
49
1.**Collects Parts**: It begins by gathering all the necessary components—`academy-theme` and all the course content from the various content repositories.
52
50
53
51
2.**Assembles the Website**: Next, it combines everything. It applies the theme's design to all the course content, building a single, complete website.
54
52
55
53
3.**Deploys Online**: Finally, it takes the newly built website and automatically pushes it to the cloud platform, making the updates live for everyone to see.
This final push to the meshery-cloud master branch is what makes the updated Academy site go live.
59
-
{{< /alert >}}
60
-
61
55
## Developer Workflows
62
56
63
-
### When to Use Local Development and Previewing
64
-
65
-
Use these workflows for rapid development and iteration on your local machine.
57
+
### How to Develop and Preview Locally
66
58
67
-
#### How to Preview Content Changes
59
+
Use this workflow for rapid local development and iteration. If you're only changing Markdown files and want a fast preview loop, run these commands within a content repository (such as `layer5-academy`):
68
60
69
-
If you're only changing Markdown files and want a fast preview loop, run these commands from within a content repository (such as `academy-example`):
61
+
{{< alert type="info" title="layer5-academy as an Example" >}}
62
+
We'll use [layer5-academy](https://github.com/layer5io/layer5-academy) for these examples because it hosts all official Layer5 learning paths. It serves as a feature-complete reference, allowing you to see how a complex, real-world content repository is structured.
63
+
{{< /alert >}}
70
64
71
65
1.`go mod tidy`: Cleans up and verifies Go module dependencies.
72
-
2.`make setup`: Installs necessary tools and modules defined in the `Makefile`.
66
+
2.`make setup`: Installs necessary tools and modules.
73
67
3.`make site`: Starts the local Hugo development server.
74
68
75
69
You can then view your content by navigating to `http://localhost:1313/academy`.
76
70
77
-
####How to Develop the Academy Theme
71
+
### How to Develop the Academy Theme
78
72
79
-
When you need to modify the `academy-theme` and see its effect on real content, you'll use the `go mod replace` directive:
73
+
If you need to modify the `academy-theme` and see its effect on real content, you'll use the `go mod replace` directive:
80
74
81
75
1.**Modify the Theme**: Make your code changes in your local clone of the `academy-theme` repository.
82
-
2.**Redirect the Dependency**: In the `go.mod` file of the content repository you're using for previewing (e.g., `academy-example`), add a `replace` directive to point Hugo to your local theme directory:
76
+
2.**Redirect the Dependency**: In the `go.mod` file of the content repository you're using for previewing (e.g., `layer5-academy`), add a `replace` directive to point Hugo to your local theme directory:
3.**Relaunch the Server**: Run `make site` again. The local server will now use your local theme code, allowing you to see your changes instantly.
80
+
3.**Apply Changes and Relaunch**: Run `go mod tidy` to apply the `replace` directive you just added. Then, restart the server with `make site`. The local server will now use your local theme code, allowing you to see your changes instantly.
87
81
88
-
### When to Use End-to-End Testing with Layer5 Cloud
82
+
### How to Use End-to-End Testing with Layer5 Cloud
89
83
90
-
The previous steps are the same: use the replace directive in your `go.mod` file to point to the local version of either the example or the theme repository, depending on what you want to test.
84
+
Use this workflow for end-to-end testing that mirrors the production environment. This is the ultimate way to verify your changes work correctly within the Layer5 Cloud UI before they go live:
91
85
92
-
Use this workflow to ensure your changes work correctly within the final Layer5 Cloud environment:
86
+
All steps in this section should be performed from the root of your local `academy-build` repository.
93
87
94
-
1.**Build Locally**: From the root of the `academy-build` repository, run the command to build the entire Academy site. This fetches all remote content modules and the theme:
88
+
1.**Prepare Local Dependencies**: If you're testing local changes from other repositories (like a theme or content module), edit the `go.mod` file in `academy-build` to point to your local versions using a replace directive:
2.**Build Locally**: Run the command to build the entire Academy site. This fetches all remote content modules and the theme:
95
95
```bash
96
96
make academy-dev
97
97
```
98
-
2.**Sync with Cloud**: After the build completes, run the following command to sync the generated static files with the Layer5 Cloud staging environment:
98
+
99
+
3.**Sync with Cloud**: After the build completes, run the following command to sync the generated static files with the Layer5 Cloud staging environment:
99
100
```bash
100
101
make sync-with-cloud
101
102
```
102
-
3.**Preview on Staging**: Your changes will be available on the [staging environment](https://staging-cloud.layer5.io/) within approximately 10 minutes.
103
+
104
+
4.**Preview on Staging**: Your changes will be available on the [staging environment](https://staging-cloud.layer5.io/) within approximately 10 minutes.
103
105
104
106
{{< alert type="warning" title="Local vs. Cloud Discrepancies" >}}
105
107
The local preview (`make site`) is excellent for rapid development, but it is **not** a 100% accurate representation of the final product. The Cloud UI acts as a wrapper around the Academy content, which can introduce subtle differences. These are often caused by CSS class conflicts or variations in JavaScript execution within the larger application.
@@ -116,3 +118,9 @@ make academy-prod
116
118
```
117
119
118
120
This command generates the final static files in the `public/` directory. You can inspect the generated HTML and JSON files here to diagnose build-time issues before deploying.
121
+
122
+
### Best Practices
123
+
124
+
1.**Keep Dependencies Clean**: After testing with local replace directives in your `go.mod` file, always remember to remove them and run `go mod tidy` before committing your changes. This prevents accidental check-ins of local paths.
125
+
2.**Test Incrementally**: Start with local development for rapid iteration, then progress to holistic builds, and finally test in the staging environment.
126
+
3.**Version Control**: Always commit your changes to version control before testing in staging to ensure you can track and revert changes if needed.
0 commit comments