Skip to content

Commit

Permalink
feat: Adapt the document to the release and add JSON views doc (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
taorepoara authored Oct 24, 2023
1 parent 4de115a commit 81be5f6
Show file tree
Hide file tree
Showing 27 changed files with 1,269 additions and 378 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Lenra's documentation web site

## Development

To launch the server in dev mode, run the following commands:

```bash
Expand Down
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.85
version: v1.0.0-beta.88
filePrefix: lenra-api-docs
containsVersion: true
- name: cli
url: https://github.com/lenra-io/lenra_cli
version: v1.0.0-beta.31
version: v1.1.0
filePrefix: lenra-cli-docs
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
},
{
"from": "^/todo-list-guide.html$",
"to": "/guides/todo-list-app.html",
"to": "/guides/apps/lenra-todo-list.html",
"type": "permanent"
},
{
Expand All @@ -108,6 +108,11 @@
"from": "^/references/cli/commands/dev/reload.html$",
"to": "/references/cli/commands/reload.html",
"type": "permanent"
},
{
"from": "^/guides/todo-list-app.html$",
"to": "/guides/apps/lenra-todo-list.html",
"type": "permanent"
}
]
}
Expand Down
9 changes: 8 additions & 1 deletion src/markdown/features/data-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@ Lenra Data system is based on Mongo.

There is two ways to handle data in Lenra:
- in the listeners: you can use the [API](#api) to manage your data
- in the views: you can use the [View component](/references/components-api/components/view.html) to adapt your application interface
- in the views: you can use the [View component](../references/components-api/components/view.html) to adapt your application interface


## @me

The `@me` value is a special string that represents the current user.
It can be used for document manipulation and queries.

To use it, you just need to set the `@me` value to a field of the document as done in our templates (see [the create a template from scratch guide](../guides/create-from-scratch.html) to better understand how to use it).

## API

To manage the data in your application, you can utilize our REST API.
Expand Down
12 changes: 10 additions & 2 deletions src/markdown/features/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@ You can utilize path parameters for your routes. For instance, you can use these
"view": {
"type": "view",
"name": "bookPage",
"find": {
"type": "book",
"query": {
"id": "@route.id"
}
}
}
}
]
```

By using the `:id` parameter, the route `/books/:id` will match any route. The value for `:id` can then be fetched from inside of the view by doing as follows.
By using the `:id` parameter, the route `/books/:id` will match any route.
The value for `:id` can be used in the view query as you can see in the example above by prefixing the variable name by `@route.`.
The `:id` parameter can also be fetched from inside of the view by doing as follows.

- You have to specify to the view that you want to use context values. (In this example let's consider that the view is under the path /myView/:id)

Expand All @@ -72,7 +80,7 @@ export default function (data, props, context) {
}
```
# Navigating to a route
## Navigating to a route
You can navigate to any route that is defined in the `lenraRoutes` property in the app manifest. To do that, you have to call the specific listener action `@lenra:navTo`. Here is an example of a button using this listener.
Expand Down
46 changes: 27 additions & 19 deletions src/markdown/getting-started/create-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Create a project
---

## New project
## New Lenra app

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

Expand All @@ -12,10 +12,20 @@ Once the [Lenra CLI is installed](./install.html), you can use it to create a ne
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" target="_blank"}here](https://github.com/search?q=topic%3Alenra+topic%3Atemplate&sort=stargazers&type=repositories).
You can find the list of [{:rel="noopener" target="_blank"}available templates on GitHub](https://github.com/search?q=topic%3Alenra+topic%3Atemplate&sort=stargazers&type=repositories).

{:#templates}
- ![JavaScript](/img/languages/javascript.svg)
- ![TypeScript](/img/languages/typescript.svg)
- ![Rust](/img/languages/rust.svg)
- ![Python](/img/languages/python.svg)
- {:.soon}
![PHP](/img/languages/php.svg)
- {:.soon}
![Elixir](/img/languages/elixir.svg)

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.
Pass a list of GitHub topics to find the list of corresponding templates (for example the language you want to use).
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.

Expand All @@ -30,19 +40,6 @@ Once the [Lenra CLI is installed](./install.html), you can use it to create a ne
lenra dev
```

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

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

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

- ### from **scratch**

Expand All @@ -51,10 +48,21 @@ Once the [Lenra CLI is installed](./install.html), you can use it to create a ne
[{:.btn.link}Read the specific guide for that](../guides/create-from-scratch.html)
## Start **developing**
## 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.
Make sure you've understood the [Lenra principles](./principles.html) before starting since Lenra is a bit different from classic frameworks.

### Features

One of the most important thing to know with Lenra is how to [manage data](../features/data-management.html).

Find all the features you need for your app in the [{:.btn.link.lenra-icon-arrow-right}features list](../features/)

### Guides

There is also [some guides](../guides/) that can explain you the next steps for creating your app.

<!-- TODO: add showcase app when it's ready -->
[{:.btn.link.lenra-icon-arrow-right}Look at our todo list app guide](../guides/todo-list-app.html)
You should look at our [{:.btn.link.lenra-icon-arrow-right}app guides](../guides/apps/)
35 changes: 30 additions & 5 deletions src/markdown/getting-started/deploy-app.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
---
name: Deploy your app
---

When your application is ready to be shared with others you might find interest into deploying it to the online platform.

## Prerequisites

If you don't have a Lenra app yet, you can [create one](./create-project.html).

Before deploying your app, you need to create a git repository for it.
This repo will have to be accessible from the internet, you can use GitHub, GitLab, BitBucket or any other git hosting service.
You can use a private repository, but you will need to follow [our dedicated guide](../guides/use-private-repository.html).

Make sure your app is working in production mode locally (using [the Lenra CLI](./install.html)) before deploying it by running the following command in your app directory:

```bash
# Build the app for production
lenra build --production
# Start the app previously built
lenra start
```

You can then test your app by opening [http://localhost:4000](http://localhost:4000) in your browser or starting your custom client.

## Deploy your app

Create an account on [{:rel="noopener" target="_blank"}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.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.
You can share this application by changing its visibility to `public` in the settings and sending the link to people (which should look close to **app.lenra.io/app/f6279d6a-3b71-4520-a7f8-0f7b28700de9**).

Once your application is fully deployed on our servers, it will be accessible by clicking the `See my application` button.
This will open a new tab with the application running on the Lenra client (still in beta).

You can configure an external client to have advanced customisation on the UI of your app.
Look at [the corresponding guide](../guides/create-client.html) to configure your clients.

You also can configure the access to your application by reading [the corresponding guide](../guides/manage-access.html).
17 changes: 8 additions & 9 deletions src/markdown/getting-started/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ docker compose --version

{:.or}
- ### using **cargo**
Simply install the latest package using the [{:rel="noopener" target="_blank"}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:
Simply install the latest package using the [{:rel="noopener" target="_blank"}cargo CLI](https://doc.rust-lang.org/cargo/getting-started/installation.html):

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

For more installation instructions, you can directly check the CLI repository.
Expand All @@ -39,21 +38,21 @@ docker compose --version
- ### using **the binary**
<details id="download-linux" open><summary class="lenra-icon-linux">Lenra for Linux</summary>

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

- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener" target="_blank"}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" target="_blank"}lenra-linux-aarch64](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-linux-aarch64)

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

- [{:.btn.link.lenra-icon-download target="_blank" rel="noopener" target="_blank"}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" target="_blank"}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" target="_blank"}lenra-windows-x86_64.exe](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-windows-x86_64.exe)
<!-- - [{:.btn.link.lenra-icon-download target="_blank" rel="noopener" target="_blank"}lenra-windows-aarch64.exe](https://github.com/lenra-io/lenra_cli/releases/latest/download/lenra-windows-aarch64.exe) -->

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

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

</details>

Expand Down
Loading

0 comments on commit 81be5f6

Please sign in to comment.