Skip to content

Commit

Permalink
Add "create project" docs for cookieplone (#1714)
Browse files Browse the repository at this point in the history
* Add "create project" docs for cookieplone

* Add overlooked comma

* Rename file

* Rename file

* Remove "the" from Classic UI.
MyST syntax standard.
Clarify introduction

* Apply suggestions from code review

* Overhaul the Install index.
- promote stable releases over development pre-releases
- Move demos to end
- Replace Sphinx Design grid and cards a plain old definition list.

* Simplify introductions for create-project*

* Update meta information

* Current version of Sphinx does not support replacements in includes, so use this temporary workaround and add TODO.

* Hyphenate pre-requisite and tidy

* Update meta information

* Use narrow terminal to avoid horizontal scrolling of console.

* Add next steps to view the site. Much excite!

* Update meta information and correct Volto version

* Correct introduction

* Add terms Cookieplone and cookieplone-templates to Glossary.

* Use include for Python prerequisite

* Update docs/glossary.md

Remove documentation as a Cookieplone option

Co-authored-by: David Glick <[email protected]>

* Update docs/install/create-project-cookieplone.md

Co-authored-by: David Glick <[email protected]>

* Include corepack enable as an enumerated step, and use shell for syntax

* Avoid horizontal scrolling and anonymize path to project

* Finalize tidy and update screenshots to 2024

* Link to correct repo. See plone/cookieplone#41

* Add plone/generator-volto deprecation to Glossary

* Cannot use `@` at the start of a term in the Glossary

* Nope, `@` is fine, there was whitespace that broke the glossary.

* Add note about installing Pillow requirements. See #1712

* Update docs/glossary.md

Co-authored-by: David Glick <[email protected]>

---------

Co-authored-by: Steve Piercy <[email protected]>
  • Loading branch information
davisagli and stevepiercy authored Sep 30, 2024
1 parent a39a990 commit 5a5fb14
Show file tree
Hide file tree
Showing 12 changed files with 656 additions and 85 deletions.
19 changes: 19 additions & 0 deletions docs/_inc/_hardware-requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The hardware requirements below give a rough estimate of the minimum hardware setup needed for a Plone server.

A single Plone installation is able to run many Plone sites.

- Installation of the Plone backend and Classic UI frontend requires a minimum of 256 MB of RAM and 2GB of disk swap space.
- Installation of the Volto frontend requires a minimum of 2GB of RAM.
- After installation, running Plone requires a minimum of 256 MB RAM and 512 MB of disk swap space per Plone site.
2 GB or more RAM per Plone site is recommended.
- Minimum 512 MB hard disk space is required.
40 GB or more hard disk space is recommended.


````{warning}
{term}`Add-on` products and caching solutions may also increase RAM and disk swap space requirements.
To avoid RAM and disk swap limitations, we recommend either temporarily resizing your remote machine to accommodate the build, or build your images locally and upload them to an image store, such as [Docker Hub](https://hub.docker.com/) or [GitHub Packages](https://github.com/features/packages).
```{seealso}
[How much RAM is required to build a Volto front end?](https://community.plone.org/t/how-much-ram-is-required-to-build-a-volto-front-end/17949) and [Dealing with heap exhaustion while building Volto 17 on limited-RAM host](https://community.plone.org/t/dealing-with-heap-exhaustion-while-building-volto-17-on-limited-ram-host/18078).
```
````
24 changes: 24 additions & 0 deletions docs/_inc/_install-pillow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
``````{note}
After generating a project, then running `make install`, if you see an error message `ERROR: Failed building wheel for Pillow`, then you need to install Pillow's dependencies.
`````{tab-set}
````{tab-item} macOS
```shell
brew install zlib libjpeg
```
````
````{tab-item} Linux
```shell
apt-get zlib libjpeg
```
````
`````
You will then need to run `make install` again.
```{seealso}
See also the Pillow documentation [External Libraries](https://pillow.readthedocs.io/en/latest/installation/building-from-source.html#external-libraries) for additional libraries that you might need.
```
``````
6 changes: 6 additions & 0 deletions docs/_inc/_install-python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Installing Python is beyond the scope of this documentation.
However, it is recommended to use a Python version manager, {term}`pyenv`, that allows you to install multiple versions of Python on your development environment without destroying your system's Python.
% TODO: uncomment this line after upgrading to plone-sphinx-theme and latest Sphinx which supports replacements inside includes.
% Plone requires Python version {SUPPORTED_PYTHON_VERSIONS}.

Plone requires Python version 3.8, 3.9, 3.10, 3.11, or 3.12.
Binary file modified docs/_static/plone-classic-ui-landing-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/plone-classic-ui-site-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/plone-home-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/plone-login-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ Cookiecutter
A command-line utility that creates projects from cookiecutters (project templates), for example, creating a Python package project from a Python package project template.
[See Cookiecutter's documentation](https://cookiecutter.readthedocs.io/en/stable/).
Cookieplone
```{versionadded} Volto 18.0.0-alpha.43
```

[Cookieplone](https://github.com/plone/cookieplone) is the method to create a Plone project.
You can use Cookieplone to build a backend add-on, a new Volto add-on, or a full project with both backend and frontend.
Cookieplone simplifies the process using robust Cookiecutter templates from {term}`cookieplone-templates`.

cookieplone-templates
[`cookieplone-templates`](https://github.com/plone/cookieplone-templates) is a collection of templates used by {term}`Cookieplone`.

@plone/generator-volto
plone/generator-volto
```{deprecated} Volto 18.0.0-alpha.43
```

[@plone/generator-volto](https://www.npmjs.com/package/@plone/generator-volto) is deprecated in favor of {term}`Cookieplone` since Volto 18.0.0-alpha.43.
See {ref}`upgrade-18-cookieplone-label`.

cookiecutter-plone-starter
[cookiecutter-plone-starter](https://github.com/collective/cookiecutter-plone-starter/) is a framework for jumpstarting Plone 6 projects quickly.

Expand Down
229 changes: 229 additions & 0 deletions docs/install/create-project-classic-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
---
myst:
html_meta:
"description": "Create a Plone project with Classic UI (stable release)"
"property=og:description": "Create a Plone project with Classic UI (stable release)"
"property=og:title": "Create a Plone project with Classic UI (stable release)"
"keywords": "Plone, Plone 6, Classic UI, create, project, install, cookiecutter, Cookieplone"
---


(create-a-project-classic-ui-label)=

# Create a project with Classic UI (stable release)

This chapter describes how you can create a web application using the current **stable release** version of Plone with **Classic UI** for the frontend, while having full control over its development and deployment.

```{seealso}
For other installation options, see {doc}`/install/index`.
```


## System requirements

Plone 6 has both hardware requirements and software pre-requisites.


### Hardware requirements

```{include} /_inc/_hardware-requirements.md
```

### Pre-requisites for installation

```{include} ../volto/contributing/install-operating-system.md
```

- Python {SUPPORTED_PYTHON_VERSIONS}
- {term}`pipx`
- {term}`GNU make`
- {term}`Git`


#### Python

```{include} /_inc/_install-python.md
```


#### pipx

Install {term}`pipx`.

```shell
pip install pipx
```


#### Make

```{include} ../volto/contributing/install-make.md
```


#### Git

```{include} ../volto/contributing/install-git.md
```


## Generate the project

After satisfying the pre-requisites, generate the project.

```shell
pipx run cookieplone backend_addon
```

You will be presented with a series of prompts.
You can accept the default values in square brackets (`[default-option]`) by hitting the {kbd}`Enter` key, or enter your preferred values.
For ease of documentation, we will use the default values.

```{tip}
See the cookiecutter's README for how to [Use options to avoid prompts](https://github.com/collective/cookiecutter-plone-starter/?tab=readme-ov-file#use-options-to-avoid-prompts).
```

```{important}
For {guilabel}`Project Slug`, you must not use any of the Plone core package names listed in [`constraints.txt`](https://dist.plone.org/release/6.0-latest/constraints.txt).
Note that pip normalizes these names, so `plone.volto` and `plone-volto` are the same package.
```

```console
% pipx run cookieplone backend_addon
╭─────────────────────────────────── cookieplone ────────────────────────────────────╮
│ │
│ .xxxxxxxxxxxxxx. │
│ ;xxxxxxxxxxxxxxxxxxxxxx; │
│ ;xxxxxxxxxxxxxxxxxxxxxxxxxxxx; │
│ xxxxxxxxxx xxxxxxxxxx │
│ xxxxxxxx. .xxxxxxxx │
│ xxxxxxx xxxxxxx: xxxxxxx │
│ :xxxxxx xxxxxxxxxx xxxxxx: │
│ :xxxxx+ xxxxxxxxxxx +xxxxx: │
│ .xxxxx. :xxxxxxxxxx .xxxxx. │
│ xxxxx+ ;xxxxxxxx +xxxxx │
│ xxxxx +xx. xxxxx. │
│ xxxxx: .xxxxxxxx :xxxxx │
│ xxxxx .xxxxxxxxxx xxxxx │
│ xxxxx xxxxxxxxxxx xxxxx │
│ xxxxx .xxxxxxxxxx xxxxx │
│ xxxxx: .xxxxxxxx :xxxxx │
│ .xxxxx ;xx. ... xxxxx. │
│ xxxxx+ :xxxxxxxx +xxxxx │
│ .xxxxx. :xxxxxxxxxx .xxxxx. │
│ :xxxxx+ xxxxxxxxxxx ;xxxxx: │
│ :xxxxxx xxxxxxxxxx xxxxxx: │
│ xxxxxxx xxxxxxx; xxxxxxx │
│ xxxxxxxx. .xxxxxxxx │
│ xxxxxxxxxx xxxxxxxxxx │
│ ;xxxxxxxxxxxxxxxxxxxxxxxxxxxx+ │
│ ;xxxxxxxxxxxxxxxxxxxxxx; │
│ .xxxxxxxxxxxxxx. │
│ │
╰────────────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────────────────── Plone Addon ────────────────────────────────────╮
│ Creating a new Plone Addon │
╰────────────────────────────────────────────────────────────────────────────────────╯
[1/7] Addon Title (Addon):
[2/7] A short description of your addon (A new addon for Plone):
[3/7] Author (Plone Community):
[4/7] Author E-mail ([email protected]):
[5/7] GitHub Username or Organization (collective):
[6/7] Python package name (collective.addon):
[7/7] Support headless Plone?
1 - Yes
2 - No
Choose from [1/2] (1):
-> Initialize Git repository
╭───────────────────────────── New addon was generated ──────────────────────────────╮
│ │
│ Addon │
│ │
│ Now, enter the repository run the code formatter with: │
│ │
│ make format │
│ │
│ start coding, and push to your organization. │
│ │
│ Sorry for the convenience, │
│ The Plone Community. │
│ │
│ https://plone.org/ │
╰────────────────────────────────────────────────────────────────────────────────────╯
```


## Install the project

Change to your project directory.

```shell
cd collective.addon
```

To install the project's dependencies, use the following command.

```shell
make install
```

This will take a few minutes.
☕️

When the process completes successfully, it will exit with no message.

```{include} /_inc/_install-pillow.md
```


## Start Plone

To start Plone, issue the following command.

```shell
make start
```

The Plone backend server starts up and emits messages to the console.

```console
2024-09-25 16:47:15,699 INFO [chameleon.config:39][MainThread] directory cache: /<path-to-project>/instance/var/cache.
2024-09-25 16:47:16,387 WARNING [ZODB.FileStorage:412][MainThread] Ignoring index for /<path-to-project>/instance/var/filestorage/Data.fs
2024-09-25 16:47:16,508 INFO [plone.restapi.patches:16][MainThread] PATCH: Disabled ZPublisher.HTTPRequest.ZopeFieldStorage.VALUE_LIMIT. This enables file uploads larger than 1MB.
2024-09-25 16:47:17,018 INFO [plone.volto:23][MainThread] Aliasing collective.folderish classes to plone.volto classes.
2024-09-25 16:47:17,760 INFO [Zope:42][MainThread] Ready to handle requests
Starting server in PID 20912.
2024-09-25 16:47:17,772 INFO [waitress:486][MainThread] Serving on http://[::1]:8080
2024-09-25 16:47:17,772 INFO [waitress:486][MainThread] Serving on http://127.0.0.1:8080
```

You can stop the site with {kbd}`ctrl-c`.


## Create Classic UI Plone site

While the Plone backend server is running, open a browser and visit the following URL.

http://localhost:8080

```{image} /_static/plone-classic-ui-landing-page.png
:class: figure
:alt: Plone Classic UI landing page
```

Click the button {guilabel}`Create Classic UI Plone site` to do exactly that.

Use the username and password of `admin` to authenticate.
You will be redirected to the Create a Plone site page.

```{image} /_static/plone-classic-ui-site-page.png
:class: figure
:alt: Plone Classic UI site page
```

Enter values for {guilabel}`Path identifier`, {guilabel}`Title`, {guilabel}`Language`, and {guilabel}`Default timezone`.
The default values are usually good.

Click the button {guilabel}`Create Plone site`.

You will be redirected to the Plone site you just created.
Loading

0 comments on commit 5a5fb14

Please sign in to comment.