Skip to content

Commit 9f79e04

Browse files
authored
Merge branch 'main' into deployment-polish-3
2 parents db72081 + b1cacff commit 9f79e04

8 files changed

Lines changed: 153 additions & 122 deletions

File tree

-255 KB
Loading
155 KB
Loading
155 KB
Loading

docs/plone-deployment/project-edit.md

Lines changed: 72 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,98 @@
11
---
22
myst:
33
html_meta:
4-
"description": "A comprehensive guide on customizing and enhancing your Plone project for deployment."
5-
"property=og:description": "Learn how to edit, customize, and enhance your Plone project for optimal deployment."
6-
"property=og:title": "Customizing Your Plone Project for Deployment"
7-
"keywords": "Edit, Plone, Project, Add-ons, Volto, OAuth, GitHub"
4+
"description": "How to edit, customize, and enhance your Plone project for optimal deployment"
5+
"property=og:description": "How to edit, customize, and enhance your Plone project for optimal deployment"
6+
"property=og:title": "Customize your Plone project for deployment"
7+
"keywords": "edit, Plone, project, add-ons, Volto, OAuth, GitHub"
88
---
99

10-
# Customize Your Project
10+
# Customize your project
11+
12+
[Please fill this form](https://forms.gle/npDRESAud4ntDnUz7).
1113

1214
Plone offers a wealth of features right out of the box. You can extend these capabilities using {term}`TTW` modifications, such as creating new content types, altering the default workflow, or configuring the top-level navigation. For additional functionalities not covered by Plone, you can either develop your own solutions or integrate existing add-ons.
1315

1416
## Project packages
1517

16-
A Plone project is composed by, at least, a backend Python package and a frontend ReactJS package. These packages, generated for you during the creation of the codebase, are responsible for configuring the project and integrating third-party add-ons.
18+
A Plone project is composed by, at least, a backend Python package and a frontend React package. These packages, generated for you during the creation of the code base, are responsible for configuring the project and integrating third-party add-ons.
1719

1820
The packages for this training are:
1921

20-
- **ploneconf2025.core**: Package metadata located at `backend/pyproject.toml` and code at `backend/src/ploneconf2025/core`.
21-
- **volto-ploneconf2025-core**: Package metadata located at `frontend/packages/volto-ploneconf2025-core/package.json` and code at `frontend/packages/volto-ploneconf2025-core/src`.
22+
`ploneconf2025.core`
23+
: Package metadata located at {file}`backend/pyproject.toml` and code at {file}`backend/src/ploneconf2025/core`.
24+
25+
`volto-ploneconf2025-core`
26+
: Package metadata located at {file}`frontend/packages/volto-ploneconf2025-core/package.json` and code at {file}`frontend/packages/volto-ploneconf2025-core/src`.
2227

23-
## Integrating Add-ons
28+
## Integrate add-ons
2429

25-
Both Plone Frontend and Backend in your project support add-on integration. Add-ons can be specific to either the Frontend or Backend, or they can be collaborative packages enhancing both components.
30+
Both Plone frontend and backend in your project support add-on integration. Add-ons can be specific to either the frontend or backend, or they can be collaborative packages enhancing both components.
2631

27-
- **Plone Backend Add-ons**: These are Python packages available on PyPI. [Awesome Plone](https://github.com/collective/awesome-plone) offers a curated list of these add-ons.
28-
- **Plone Frontend Add-ons**: Written in JavaScript or TypeScript, these are released as NPM packages. Check out [Awesome Volto](https://github.com/collective/awesome-volto) for a collection of Frontend add-ons.
32+
Plone backend add-ons
33+
: These are Python packages available on PyPI.
34+
[Awesome Plone](https://github.com/collective/awesome-plone) offers a curated list of these add-ons.
2935

30-
### Changing the default theme
36+
Plone frontend add-ons
37+
: Written in JavaScript or TypeScript, these are released as npm packages.
38+
Check out [Awesome Volto](https://github.com/collective/awesome-volto) for a collection of frontend add-ons.
39+
40+
### Change the default theme
3141

3242
We'll illustrate the process of integrating an add-on named `Volto Light Theme`, which provides a new theme for Volto. This add-on is composed by a frontend component, named `@kitconcept/volto-light-theme`, and a backend component named `kitconcept.voltolighttheme`.
3343

34-
#### Backend: Incorporating a New Dependency
44+
#### Backend: incorporate a new dependency
3545

3646
First, we need to add the package as a dependency on the Python project by editing {file}`backend/pyproject.toml` and append `kitconcept.voltolighttheme` to the `dependencies` section. This will ensure the add-on will be available to Python.
3747

38-
Then we tell Zope to load the add-on run-time configurations by editing {file}`backend/src/ploneconf2025/core/dependencies.zcml` and append `kitconcept.voltolighttheme`
48+
```{code-block} toml
49+
:emphasize-lines: 6
50+
:caption: {file}`backend/pyproject.toml`
51+
52+
dependencies = [
53+
"Products.CMFPlone==6.1.3",
54+
"plone.api",
55+
"plone.restapi",
56+
"plone.volto",
57+
"kitconcept.voltolighttheme",
58+
]
59+
```
3960

40-
And, if we want to have this add-on installed when we create a new website, edit {file}`backend/src/ploneconf2025/core/profiles/default/metadata.xml` and append `kitconcept.voltolighttheme`
61+
Then we tell Zope to load the add-on run-time configurations by editing {file}`backend/src/ploneconf2025/core/dependencies.zcml` and append `kitconcept.voltolighttheme`.
62+
63+
```{code-block} xml
64+
:emphasize-lines: 6
65+
:caption: {file}`backend/src/ploneconf2025/core/dependencies.zcml`
66+
67+
<?xml version="1.0" encoding="utf-8"?>
68+
<configure xmlns="http://namespaces.zope.org/zope">
69+
<include package="plone.restapi" />
70+
<include package="plone.volto" />
71+
<include package="plone.app.caching" />
72+
<include package="kitconcept.voltolighttheme" />
73+
</configure>
74+
```
75+
76+
And, if we want to have this add-on installed when we create a new website, edit {file}`backend/src/ploneconf2025/core/profiles/default/metadata.xml` and append `profile-kitconcept.voltolighttheme:default`.
77+
78+
```{code-block} xml
79+
:emphasize-lines: 8
80+
:caption: {file}`backend/src/ploneconf2025/core/profiles/default/metadata.xml`
81+
82+
<?xml version="1.0" encoding="utf-8"?>
83+
<metadata>
84+
<version>1000</version>
85+
<dependencies>
86+
<dependency>profile-plone.volto:default</dependency>
87+
<dependency>profile-plone.app.caching:default</dependency>
88+
<dependency>profile-plone.app.caching:with-caching-proxy</dependency>
89+
<dependency>profile-kitconcept.voltolighttheme:default</dependency>
90+
</dependencies>
91+
</metadata>
92+
```
4193

4294

43-
#### Frontend: Incorporating a New Dependency
95+
#### Frontend: incorporate a new dependency
4496

4597
Edit {file}`frontend/packages/volto-ploneconf2025/package.json` and append `@kitconcept/volto-light-theme` to the `addons` and `dependencies` sections, as shown below:
4698

@@ -88,7 +140,7 @@ git commit -m "Add Volto Light Theme"
88140
git push
89141
```
90142

91-
## Updating the behaviors for the Plone Site
143+
## Update behaviors for the Plone site
92144

93145
To ensure the behaviors manually applied to the Plone Site persist after the site is re-created, we need to add them via Generic Setup.
94146

@@ -115,7 +167,7 @@ Create a new file {file}`backend/src/ploneconf2025/core/profiles/default/types/P
115167
</object>
116168
```
117169

118-
## Modifying the default content
170+
## Modify the default content
119171

120172
As you can see, the default content available just after the site creation is generic, but we can change that as well.
121173

@@ -126,7 +178,7 @@ cd backend
126178
make update-example-content
127179
```
128180

129-
Now, if you run `git status` you should see changes to files under `backend/src/ploneconf2025/core/setuphandlers/examplecontent`. This is location where `plone.exportimport` will look for the content to be to your Plone site upon creation.
181+
Now, if you run `git status` you should see changes to files under {file}`backend/src/ploneconf2025/core/setuphandlers/examplecontent`. This is the location where `plone.exportimport` will look for the content to be for your Plone site upon creation.
130182

131183
Now we are going to add these changes to our repository by running:
132184

docs/plone-deployment/project-new.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ make install
133133

134134
This process will take a few minutes. Once completed, a success message will appear. Both the frontend and backend in their respective directories will be built.
135135

136-
For the frontend, the Node.js version will be used that you activated in the previous chapter with `nvm use --lts`. For the backend Python version, uv will check a `requires-python` key in the {file}`pyproject.toml` file. Or you can create a {file}`.python-version` file in the {file}`backend` folder.
136+
For the frontend, the Node.js version will be used that you activated in the previous chapter with `nvm use --lts`. For the backend Python version, uv will check a `requires-python` key in the {file}`pyproject.toml` file.
137137

138138
Putting too specific Node.js and Python versions in the scaffolded project setup can cause other issues.
139139
That's why the project generator gives hints for versions with ranges or `LTS`. But it is your own choice and responsibility to check for the correct major versions of both programming languages are active and available before you run `make install` in the project root or frontend and backend subdirectories for the first time.

docs/plone-deployment/project-start.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,82 @@
11
---
22
myst:
33
html_meta:
4-
"description": "Guidance on initiating your new project locally"
5-
"property=og:description": "Step-by-step instructions to start your Plone project on your local machine."
6-
"property=og:title": "Launching Your Plone Project Locally"
7-
"keywords": "Plone, Deployment, Ansible, Docker, GitHub, Local Development"
4+
"description": "Guide to start your Plone project on your local machine"
5+
"property=og:description": "Guide to start your Plone project on your local machine"
6+
"property=og:title": "Guide to start your Plone project on your local machine"
7+
"keywords": "Plone, deployment, Ansible, Docker, GitHub, local development"
88
---
99

10-
# Start the Project
10+
# Start the project
1111

12-
The {term}`cookieplone` equips you with essential tools to initiate a local development environment. {doc}`project-new` offers two methods to launch your project: manually starting the Backend and Frontend servers, or utilizing a Docker Compose stack.
12+
{term}`Cookieplone` equips you with essential tools to initiate a local development environment. {doc}`project-new` offers two methods to launch your project: manually starting the backend and frontend servers, or utilizing a Docker Compose stack.
1313

14-
## Running Local Servers
14+
## Run local servers
1515

16-
This method requires two terminals as both Backend and Frontend operate in "foreground mode". It's optimal for local development due to its swift change and restart cycle. However, accessing each server on their internal ports can lead to CORS issues in real-world deployments.
16+
This method requires two terminal sessions, as both backend and frontend operate in "foreground mode". It's optimal for local development due to its swift change and restart cycle. However, accessing each server on their internal ports can lead to CORS issues in real-world deployments.
1717

18-
### Starting the Backend
18+
### Start the backend
1919

2020
Navigate to the project's root folder and execute:
2121

2222
```shell
2323
make backend-start
2424
```
2525

26-
This command initiates the Backend server. Upon successful startup, you'll observe:
26+
This command initiates the backend server. Upon successful startup, you'll observe:
2727

2828
```console
2929
... INFO [waitress:486][MainThread] Serving on http://127.0.0.1:8080
3030
```
3131

32-
Indicating the server is operational and awaiting requests on port 8080. Visit http://localhost:8080 to explore.
32+
The above indicates that the server is operational and awaiting requests on port 8080. Visit http://localhost:8080 to explore.
3333

3434
```{figure} _static/start_backend_localhost.png
35-
:alt: Backend server initiation at http://localhost:8080
35+
:alt: Backend server initiation at `http://localhost:8080`
3636
37-
Backend server initiation at http://localhost:8080
37+
Backend server initiation at `http://localhost:8080`
3838
```
3939

4040

41-
### Starting the Frontend
41+
### Start the frontend
4242

4343
In a new terminal at the project root, execute:
4444

4545
```shell
4646
make frontend-start
4747
```
4848

49-
The Frontend initiation takes longer due to the initial codebase compilation for both the NodeJS server as the browser javascript bundles. A successful startup displays:
49+
The frontend initiation takes longer, due to the initial code base compilation for both the Node.js server for the browser JavaScript bundles. A successful startup displays:
5050

51-
```
51+
```console
5252
🎭 Volto started at 0.0.0.0:3000 🚀
5353
```
5454

55-
Signifying the Frontend server is active on port 3000. Access it via http://localhost:3000.
55+
The above signifies that the frontend server is active on port 3000. Access it via http://localhost:3000.
5656

5757
```{figure} _static/start_frontend_localhost.png
58-
:alt: Frontend server initiation at http://localhost:3000
58+
:alt: Frontend server initiation at `http://localhost:3000`
5959
60-
Frontend server initiation at http://localhost:3000
60+
Frontend server initiation at `http://localhost:3000`
6161
```
6262

6363
```{note}
6464
Default credentials: **admin/admin**.
6565
```
6666

67-
## Stopping the servers
67+
## Stop the servers
6868

6969
In both terminals, press {kbd}`Ctrl-C`.
7070

71-
## Running Docker Compose
71+
## Run Docker Compose
7272

73-
Docker Compose is suitable for reviewing your development progress or exploring the project. It comprises four services: {term}`Traefik` web server, Frontend, Backend, and a `Postgres` database, mimicking a production environment.
73+
Docker Compose is suitable for reviewing your development progress or exploring the project. It comprises four services: {term}`Traefik` web server, frontend, backend, and a PostgreSQL database, mimicking a production environment.
7474

7575
```{note}
76-
A secondary Backend route, `/ClassicUI`, mirrors `http://localhost:8080/Plone`. It's secured with Basic Authentication, default credentials being **admin/admin**.
76+
A secondary backend route, `/ClassicUI`, mirrors `http://localhost:8080/Plone`. It's secured with basic authentication, default credentials being **admin/admin**.
7777
```
7878

79-
### Starting the Stack
79+
### Start the Stack
8080

8181
Ensure port 80 is free, then initiate the stack with:
8282

@@ -94,41 +94,41 @@ Verify the stack's operational status with:
9494
make stack-status
9595
```
9696

97-
Initially, the Frontend may display an **(unhealthy)** status due to the absence of a created Plone site.
97+
Initially, the frontend may display an **(unhealthy)** status due to the absence of a created Plone site.
9898

99-
### Creating a New Plone Site
99+
### Create a new Plone site
100100

101-
Initiate a new Plone site within the Docker Compose Stack by executing:
101+
Initiate a new Plone site within the Docker Compose stack by executing:
102102

103103
```shell
104104
make stack-create-site
105105
```
106106

107-
Re-run `make stack-status`, and both Backend and Frontend should now display a **(healthy)** status.
107+
Re-run `make stack-status`, and both backend and frontend should now display a **(healthy)** status.
108108

109-
### Accessing the Site
109+
### Accessing the site
110110

111111
Your website is accessible at http://ploneconf2025.localhost.
112112

113113
```{figure} _static/start_stack_localhost.png
114-
:alt: Accessing the site at http://ploneconf2025.localhost
114+
:alt: Accessing the site at `http://ploneconf2025.localhost`
115115
116-
Accessing the site at http://ploneconf2025.localhost
116+
Accessing the site at `http://ploneconf2025.localhost`
117117
```
118118

119-
### Updating the Codebase
119+
### Updating the code base
120120

121121
For codebase modifications, re-run `make stack-start` to rebuild the affected containers, ensuring your site's behavior aligns with the updates.
122122

123-
### Stopping the Stack
123+
### Stop the stack
124124

125-
To halt the stack while preserving site data, execute:
125+
To stop the stack while preserving site data, execute:
126126

127127
```shell
128128
make stack-stop
129129
```
130130

131-
### Removing the Stack
131+
### Removing the stack
132132

133133
To dismantle the stack and erase all site data, use:
134134

docs/plone-deployment/server-setup.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
---
22
myst:
33
html_meta:
4-
"description": "Step-by-step guide to setting up a Plone deployment server."
5-
"property=og:description": "Easily set up a Plone deployment server with Ansible, Docker, and Docker Swarm."
6-
"property=og:title": "Efficient Plone Deployment Server Setup"
7-
"keywords": "Plone, Deployment, Server, Setup, Ansible, Docker, Docker Swarm"
4+
"description": "Set up a Plone deployment server with Ansible, Docker, and Docker Swarm"
5+
"property=og:description": "Set up a Plone deployment server with Ansible, Docker, and Docker Swarm"
6+
"property=og:title": "Set up your Plone deployment server"
7+
"keywords": "Plone, deployment, server, setup, Ansible, Docker, Docker Swarm"
88
---
99

10-
# Setting Up Your Plone Deployment Server
10+
# Set up your Plone deployment server
1111

12-
Your Plone project's generated codebase includes a {file}`/devops/ansible` folder, equipped with tools for provisioning and setting up a basic server installation. We'll utilize **Ansible** for automation, **Docker** for containerization, and **Docker Swarm** for enhanced scalability and availability.
12+
Your Plone project's generated code base includes a {file}`/devops/ansible` folder, equipped with tools for provisioning and setting up a basic server installation. We'll utilize **Ansible** for automation, **Docker** for containerization, and **Docker Swarm** for enhanced scalability and availability.
1313

14-
## Navigating to Devops
14+
## Navigating to `devops`
1515

1616
Start by changing your directory to {file}`devops/ansible`:
1717

1818
```shell
1919
cd devops/ansible
2020
```
2121

22-
## Configuring the Environment
22+
## Configure the environment
2323

2424
Create a new {file}`.env` file by copying the content from the existing `.env_dist` file:
2525

@@ -42,17 +42,17 @@ STACK_NAME=ploneconf2025-<your-github-username>-tangrama-com-br
4242
The {file}`.env` file is listed in {file}`.gitignore` to prevent pushing environment-specific configurations to the repository.
4343
```
4444

45-
## Installing Ansible
45+
## Install Ansible
4646

4747
Run the following command to create a Python 3 virtual environment and install Ansible with its dependencies:
4848

4949
```shell
5050
make install
5151
```
5252

53-
## Configuring the Inventory
53+
## Configure the inventory
5454

55-
Update the {file}`devops/ansible/inventory/hosts.ym` file with the appropriate server details:
55+
Update the {file}`devops/ansible/inventory/hosts.yml` file with the appropriate server details:
5656

5757
```yaml
5858
---
@@ -70,8 +70,7 @@ cluster:
7070
```
7171
7272
73-
74-
## Initiating Server Setup
73+
## Initiate server setup
7574
7675
With the correct information in {file}`devops/ansible/inventory/hosts.yml`, test the connection to the server with:
7776

@@ -87,7 +86,7 @@ uv run ansible-playbook playbooks/setup.yml
8786

8887
This command executes the Ansible playbook {file}`devops/playbooks/setup.yml` performing tasks like installing base packages, creating a user, setting up SSH, and initializing Docker Swarm on the remote server:
8988

90-
## Verifying Remote Server Access
89+
## Verify remote server access
9190

9291
You should now be able to SSH into the remote server as both **root** and **plone** users:
9392

0 commit comments

Comments
 (0)