Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note about what the options are for loco new in the Getting Started Doc #795

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
21 changes: 21 additions & 0 deletions docs-site/content/docs/getting-started/tour/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@ You'll have:
* `async` for background workers. Learn about workers configuration [async vs queue](@/docs/processing/workers.md#async-vs-queue) in the _workers_ section.
* client-side asset serving configuration. This means your backend will serve as API and will also serve your static client-side content.

<div class="infobox">
If you'd like to know more about the options the `loco new` command provides, here's a quick rundown.
If not, feel free to skip this side-note and continue on to the next part.

* For the built-in starter templates, the options are:
* `lightweight-service` which is aimed to be minimal and only has controllers and views. Choosing this option will not include the selection options for database, background workers, or asset serving.
* `Rest API` which has the DB connection and user auth, but does not include views (no asset serving option later on).
* `SaaS app` which comes with the DB connection and user auth, as well as views and templating. It uses Tera for server-side rendering in `assets/views/` and React for client-side in `frontend/`.

* For DB providers you can choose `Sqlite` or `Postgres`, both options are supported in `loco`. This option and the following options are not available when you choose the `lightweight-service` template.

* For the background worker type, your options are:
* `Async` which spawns workers in-process using the `tokio` async runtime.
* `Queue` which spawns workers using `redis` as a queue. Does not use the same process because it uses `redis`.
* `Blocking` which spawns workers synchronously in the same process, and blocks until they are completed. Use caution when choosing this option as it will block the entire thread.

* Finally, if you chose the `SaaS app` template above, you have two options to choose from for how your assets will be served. These options set different configuration options, and can be changed after with little effort. The options are:
* `Server` - Which is intended to work when you want to use server-side rendered views. It serves your static assets from the `assets/static/` directory using the `/static` route.
* `Client` - Which is intended to work with the provided `frontend/` client-side rendered app. It serves your static assets from the `frontend/dist/` directory using the `/` route.
* **Note**: This option only changes the relevant section in the `config/development.yml` file, so not only can you easily change it later (by commenting/uncommenting the relevant blocks), but you can set it up to use both if your needs require it.
</div>

Now `cd` into your `myapp` and start your app by running `cargo loco start`:

Expand Down
Loading