Skip to content

Commit

Permalink
feat: Improve documentation (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
taorepoara committed Oct 25, 2023
1 parent 78e6f0c commit 1c25d9e
Show file tree
Hide file tree
Showing 22 changed files with 454 additions and 204 deletions.
4 changes: 2 additions & 2 deletions doc-deps.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
components:
- name: components-api
url: https://github.com/lenra-io/components-api
version: v1.0.0-beta.81
version: v1.0.0-beta.85
filePrefix: lenra-api-docs
containsVersion: true
- name: cli
url: https://github.com/lenra-io/lenra_cli
version: v1.0.0-beta.27
version: v1.0.0-beta.31
filePrefix: lenra-cli-docs
20 changes: 20 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,26 @@
"from": "^/todo-list-guide.html$",
"to": "/guides/todo-list-app.html",
"type": "permanent"
},
{
"from": "^/references/cli/commands/dev/terminal.html$",
"to": "/references/cli/commands/terminal/",
"type": "permanent"
},
{
"from": "^/references/cli/commands/dev/((index|interactive).html)?$",
"to": "/references/cli/commands/dev.html",
"type": "permanent"
},
{
"from": "^/references/cli/commands/dev/((expose|exit).html)$",
"to": "/references/cli/commands/terminal/$1",
"type": "permanent"
},
{
"from": "^/references/cli/commands/dev/reload.html$",
"to": "/references/cli/commands/reload.html",
"type": "permanent"
}
]
}
Expand Down
30 changes: 15 additions & 15 deletions src/markdown/features/data-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,34 +114,34 @@ We will implement the rest of them soon, but if you want to help you can look at

| Operator | Description |
|==========|=============|
| [{:target="_blank" rel="noopener"}$eq](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) | Matches values that are equal to a specified value. |
| [{:target="_blank" rel="noopener"}$ne](https://www.mongodb.com/docs/manual/reference/operator/query/ne/) | Matches all values that are not equal to a specified value. |
| [{:target="_blank" rel="noopener"}$gt](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) | Matches all values that are not equal to a specified value. |
| [{:rel="noopener"}$eq](https://www.mongodb.com/docs/manual/reference/operator/query/eq/) | Matches values that are equal to a specified value. |
| [{:rel="noopener"}$ne](https://www.mongodb.com/docs/manual/reference/operator/query/ne/) | Matches all values that are not equal to a specified value. |
| [{:rel="noopener"}$gt](https://www.mongodb.com/docs/manual/reference/operator/query/gt/) | Matches all values that are not equal to a specified value. |
|
| [{:target="_blank" rel="noopener"}$gte](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) | Matches values that are greater than or equal to a specified value. |
| [{:target="_blank" rel="noopener"}$lt](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) | Matches values that are less than a specified value. |
| [{:target="_blank" rel="noopener"}$lte](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) | Matches values that are less than or equal to a specified value. |
| [{:target="_blank" rel="noopener"}$in](https://www.mongodb.com/docs/manual/reference/operator/query/in/) | Matches any of the values specified in an array. |
| [{:target="_blank" rel="noopener"}$nin](https://www.mongodb.com/docs/manual/reference/operator/query/nin/) | Matches none of the values specified in an array. |
| [{:rel="noopener"}$gte](https://www.mongodb.com/docs/manual/reference/operator/query/gte/) | Matches values that are greater than or equal to a specified value. |
| [{:rel="noopener"}$lt](https://www.mongodb.com/docs/manual/reference/operator/query/lt/) | Matches values that are less than a specified value. |
| [{:rel="noopener"}$lte](https://www.mongodb.com/docs/manual/reference/operator/query/lte/) | Matches values that are less than or equal to a specified value. |
| [{:rel="noopener"}$in](https://www.mongodb.com/docs/manual/reference/operator/query/in/) | Matches any of the values specified in an array. |
| [{:rel="noopener"}$nin](https://www.mongodb.com/docs/manual/reference/operator/query/nin/) | Matches none of the values specified in an array. |

#### Logical

| Operator | Description |
|==========|=============|
| [{:target="_blank" rel="noopener"}$and](https://www.mongodb.com/docs/manual/reference/operator/query/and/) | Joins query clauses with a logical `AND` returns all documents that match the conditions of both clauses. |
| [{:target="_blank" rel="noopener"}$or](https://www.mongodb.com/docs/manual/reference/operator/query/or/) | Inverts the effect of a query expression and returns documents that do *not* match the query expression. |
| [{:target="_blank" rel="noopener"}$not](https://www.mongodb.com/docs/manual/reference/operator/query/not/) | Joins query clauses with a logical `NOR` returns all documents that fail to match both clauses. |
| [{:target="_blank" rel="noopener"}$nor](https://www.mongodb.com/docs/manual/reference/operator/query/nor/) | Joins query clauses with a logical `OR` returns all documents that match the conditions of either clause. |
| [{:rel="noopener"}$and](https://www.mongodb.com/docs/manual/reference/operator/query/and/) | Joins query clauses with a logical `AND` returns all documents that match the conditions of both clauses. |
| [{:rel="noopener"}$or](https://www.mongodb.com/docs/manual/reference/operator/query/or/) | Inverts the effect of a query expression and returns documents that do *not* match the query expression. |
| [{:rel="noopener"}$not](https://www.mongodb.com/docs/manual/reference/operator/query/not/) | Joins query clauses with a logical `NOR` returns all documents that fail to match both clauses. |
| [{:rel="noopener"}$nor](https://www.mongodb.com/docs/manual/reference/operator/query/nor/) | Joins query clauses with a logical `OR` returns all documents that match the conditions of either clause. |

#### Element

| Operator | Description |
|==========|=============|
| [{:target="_blank" rel="noopener"}$exists](https://www.mongodb.com/docs/manual/reference/operator/query/exists/) | Matches documents that have the specified field. |
| [{:target="_blank" rel="noopener"}$type](https://www.mongodb.com/docs/manual/reference/operator/query/type/) | Selects documents if a field is of the specified type. |
| [{:rel="noopener"}$exists](https://www.mongodb.com/docs/manual/reference/operator/query/exists/) | Matches documents that have the specified field. |
| [{:rel="noopener"}$type](https://www.mongodb.com/docs/manual/reference/operator/query/type/) | Selects documents if a field is of the specified type. |

#### Array

| Operator | Description |
|==========|=============|
| [{:target="_blank" rel="noopener"}$all](https://www.mongodb.com/docs/manual/reference/operator/query/all/) | Matches arrays that contain all elements specified in the query. |
| [{:rel="noopener"}$all](https://www.mongodb.com/docs/manual/reference/operator/query/all/) | Matches arrays that contain all elements specified in the query. |
99 changes: 57 additions & 42 deletions src/markdown/getting-started/create-project.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,60 @@
---
name: Create a project
---

## Create a **new Lenra project**

Once the Lenra CLI is downloaded, you can use it to create a new Lenra app from a template.

To create a new Lenra project you can just run the `lenra new` command. This command takes two parameters, the app template name ([see the available templates](#createwithyourfavoritelanguage)) and an optional target directory (if not defined, the project will be created in the current directory).

```bash
# new app from javascript template in a new 'my-app' directory
lenra new javascript my-app
# move to the new app dir
cd my-app
# initialize git versionning
git init
# start your app
lenra dev
```



## Create with your **favorite language**

{:#templates}
- [![JavaScript](/img/languages/javascript.svg)](https://github.com/lenra-io/template-javascript)
- [![TypeScript](/img/languages/typescript.svg)](https://github.com/lenra-io/template-typescript)
- [![Rust](/img/languages/rust.svg)](https://github.com/lenra-io/template-rust)
- [![Python](/img/languages/python.svg)](https://github.com/lenra-io/template-python)
- [![V-lang](/img/languages/v-lang.svg)](https://github.com/lenra-io/template-v)
- {:.soon}
[![Java SpringBoot](/img/languages/spring.svg)](https://github.com/lenra-io/template-java-springboot)
- {:.soon}
[![PHP](/img/languages/php.svg)](https://github.com/lenra-io/template-php)
- {:.soon}
[![Elixir](/img/languages/elixir.svg)](https://github.com/lenra-io/template-elixir)
- {:.soon}
[![Ruby on Rails](/img/languages/ruby-on-rails.svg)](https://github.com/lenra-io/template-ruby-on-rails)
- {:.soon}
[![Swift](/img/languages/swift.svg)](https://github.com/lenra-io/template-swift)
- {:.soon}
[![Go](/img/languages/go-lang.svg)](https://github.com/lenra-io/template-go)
- {:.soon}
[![C#](/img/languages/c-sharp.svg)](https://github.com/lenra-io/template-csharp)

## New project

Once the [Lenra CLI is installed](./install.html), you can use it to create a new Lenra app.

{:.or}
- ### from **a template**

Creating an app from a template is the easiest way to start.
The Lenra templates are just git repositories with a basic app that implements the Lenra app API.

You can find the list of available templates [{:rel="noopener"}here](https://github.com/search?q=topic%3Alenra+topic%3Atemplate&sort=stargazers&type=repositories).

To create a new Lenra project you can just run the [`lenra new` command](../references/cli/commands/new.html).
Pass a list of GitHub topics to find the list of corresponding templates.
If none is specified, the CLI will let you choose in the full list.
You also can specify the name of a target directory for the new app with the `--path` option.

```bash
# new app from javascript template in a new 'my-app' directory
lenra new javascript --path my-app
# move to the new app dir
cd my-app
# initialize git versionning
git init
# start your app
lenra dev
```

#### Maintained by the **Lenra team**

We have created a few templates to help you start your next project.

{:#templates}
- [{:.btn rel="noopener"}![JavaScript](/img/languages/javascript.svg)](https://github.com/lenra-io/template-javascript)
- [{:.btn rel="noopener"}![TypeScript](/img/languages/typescript.svg)](https://github.com/lenra-io/template-typescript)
- [{:.btn rel="noopener"}![Rust](/img/languages/rust.svg)](https://github.com/lenra-io/template-rust)
- [{:.btn rel="noopener"}![Python](/img/languages/python.svg)](https://github.com/lenra-io/template-python)
- {:.soon}
[{:.btn rel="noopener"}![PHP](/img/languages/php.svg)](https://github.com/lenra-io/template-php)
- {:.soon}
[{:.btn rel="noopener"}![Elixir](/img/languages/elixir.svg)](https://github.com/lenra-io/template-elixir)

- ### from **scratch**

If you don't find a template that fits your needs or you want to better understand how it works, you can create a new Lenra app from scratch.
[{:.btn.link}Read the specific guide for that](../guides/create-from-scratch.html)
## Start **developing**
Now that you have a new Lenra app project, you can start developing it.
Be shure you've understand the [Lenra principles](../guides/principles.html) before starting.


[{:.btn.link.lenra-icon-arrow-right}Look at our todo list app guide](../guides/todo-list-app.html)
2 changes: 1 addition & 1 deletion src/markdown/getting-started/deploy-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Create an account on [dev.lenra.io](https://dev.lenra.io).
You will be asked for a token to join our developer platform as our platform is in private beta phase.
We will be sending you one as soon as possible.
After successfully completing this step you will be redirected to the creation of your first project, just enter a name and the URL of the app git repository.
For private repositories, follow [our dedicated guide](../guides/use-private-repository.md).
For private repositories, follow [our dedicated guide](../guides/use-private-repository.html).

Then you simply click `Publish my application` at the top right corner, your application will be sent to Lenra's servers and deployed to be accessible directly for the Lenra Store.
Once your application is fully deployed on our servers, it will be accessible by clicking the `See my application` button.
Expand Down
42 changes: 10 additions & 32 deletions src/markdown/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,22 @@ description: Start creating Lenra applications.
icon: play-circle
---

## Get to know **Lenra**

Lenra is an open source framework to create your app using any language, and deploy it without any Ops scale, built on ethical values.
Our framework is based on four parts: data, views, listeners, and users.


{:#framework.colored-blocks}
- {:.red.lenra-icon-database}

### Data
Without data, there is no app. That's why our framework starts with data. We believe that data should be simple and easy to understand.
- {:.green.lenra-icon-grid}

### Views
The views are what the user sees and interacts with. It should be clear and concise. It should be easy to use and navigate.
- {:.blue.lenra-icon-users}

### Users
They are the ones who will use our apps and benefit from them. We believe that all apps should be designed with the user in mind.
- {:.yellow.lenra-icon-bell}

### Listeners
Listeners are what make an app interactive. They listen for user input and then respond accordingly.

{:.btn.primary}
[Discover Lenra principles](/getting-started/principles.html)

## Start to **create**

{:.colored-blocks}
- {:.yellow}
- {:.blue}

### Principles
Understand the principles of Lenra and how it works.

{:.btn.link.lenra-icon-arrow-right}
[Let’s go](/getting-started/principles.html)
- {:.red}

### Install
Discover the prerequisites, download what you need.

{:.btn.link.lenra-icon-arrow-right}
[Let’s go](/getting-started/install.html)
- {:.red}
- {:.yellow}

### Create
Get to know the cli and the directory structure.
Expand All @@ -50,7 +28,7 @@ Our framework is based on four parts: data, views, listeners, and users.
- {:.green}

### Deploy
Deploy your application and show your customers what you are capable of.
Deploy your Lenra application and show your customers what you are capable of.

{:.btn.link.lenra-icon-arrow-right}
[Let’s go](/getting-started/deploy-app.html)
73 changes: 52 additions & 21 deletions src/markdown/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,73 @@ position: 1

First of all, you have to install [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git), [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/) (standalone version is prefered) on your computer.

## Install Lenra CLI using **cargo**
Use the next commands to check if you have the right version installed:
ni
```bash
# Any git version is fine
git --version
# A mimimum of 2.0.0 is required for docker-compose
docker-compose --version
```

Simply install the latest package using the cargo-cli.
You also could have the Docker Compose plugin but there is a [bug when displaying logs](https://github.com/docker/compose/issues/10179), so we recommend you to use the standalone version.

```bash
cargo install lenra_cli@~1.0.0-beta.0
# A mimimum of 2.0.0 is required
docker compose --version
```

For more installation instructions, you can directly check the CLI repository.
## Install Lenra CLI

{:.or}
- ### using **cargo**
Simply install the latest package using the [{:rel="noopener"}cargo CLI](https://doc.rust-lang.org/cargo/getting-started/installation.html) and since we are still in beta, you'll have to define the version.
The next command will install the latest beta version:

```bash
cargo install lenra_cli@~1.0.0-beta.0
```

For more installation instructions, you can directly check the CLI repository.

[{:.btn.primary}Check the CLI repository](https://github.com/lenra-io/lenra_cli)
[{:.btn.link.lenra-icon-arrow-right rel="noopener"}Check the CLI repository](https://github.com/lenra-io/lenra_cli)
- ### using **the binary**
<details id="download-linux" open><summary class="lenra-icon-linux">Lenra for Linux</summary>

## Install Lenra CLI using **the binary**
- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-linux-x86_64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-linux-x86_64.tar.gz)

<details id="download-linux" open><summary class="lenra-icon-linux">Lenra for Linux</summary>
- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-linux-aarch64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-linux-aarch64.tar.gz)

- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-linux-x86_64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-linux-x86_64.tar.gz)
</details>
<details id="download-windows"><summary class="lenra-icon-windows">Lenra for Windows</summary>

- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-linux-aarch64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-linux-aarch64.tar.gz)
- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-windows-x86_64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-windows-x86_64.tar.gz)
<!-- - [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-windows-aarch64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-windows-aarch64.tar.gz) -->

</details>
<details id="download-windows"><summary class="lenra-icon-windows">Lenra for Windows</summary>
</details>
<details id="download-macos"><summary class="lenra-icon-apple">Lenra for MacoS</summary>

- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-windows-x86_64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-windows-x86_64.tar.gz)
<!-- - [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-windows-aarch64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-windows-aarch64.tar.gz) -->
- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-macos-x86_64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-macos-x86_64.tar.gz)
- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-macos-aarch64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-macos-aarch64.tar.gz)

</details>
<details id="download-macos"><summary class="lenra-icon-apple">Lenra for MacoS</summary>
</details>

- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-macos-x86_64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-macos-x86_64.tar.gz)
- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener"}lenra-macos-aarch64.tar.gz](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-macos-aarch64.tar.gz)
Download the latest binary, unpack it where you want and update your $PATH environment variable to use it.

</details>
For unix based system users, you can use the next command to add it to your $PATH temporarily:

Download the latest binary, unpack it where you want and update your $PATH
```bash
export PATH="/my/path/to/lenra_cli:$PATH"
```

For windows users, you can use the next command to add it to your $PATH temporarily:

```bash
set PATH="C:\my\path\to\lenra_cli;%PATH%"
```

Check your installation using the next command:

```bash
export PATH="/my/path/to/lenra_cli:$PATH"
```
lenra --version
```
Loading

0 comments on commit 1c25d9e

Please sign in to comment.