Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Before contributing to our documentation, please read our [style guide](STYLE_GU
The project includes a Makefile that provides shortcuts for common tasks. You can see all available commands by running:

```bash
$ make help
make help
```

This will display a list of all available commands and their descriptions. The Makefile includes commands for installation, starting the development server, creating versions, formatting markdown files, and cleaning build artifacts.
Expand All @@ -21,23 +21,23 @@ This will display a list of all available commands and their descriptions. The M
Make sure that you have Node.js installed on your computer.

```bash
$ cd serverpod_docs
cd serverpod_docs

# Using npm
$ npm install
npm install

# Or if you have Make installed, use this make command
$ make install
make install
```

### Local Development

```bash
# Using npm
$ npm start
npm start

# Or if you have Make installed, use this make command
$ make start
make start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
Expand All @@ -50,10 +50,10 @@ Make sure that the documentation is all up-to-date then run:

```bash
# Using npm
$ npm run docusaurus docs:version X.X.X
npm run docusaurus docs:version X.X.X

# Or if you have Make installed, use this make command
$ make version VERSION=X.X.X
make version VERSION=X.X.X
```

### Amend the latest version
Expand All @@ -62,10 +62,10 @@ If you need to make changes to the latest version, you can do so by removing the

```bash
# Using npm
$ npm run docusaurus docs:version X.X.X
npm run docusaurus docs:version X.X.X

# Or if you have Make installed, use this make command
$ make version VERSION=X.X.X
make version VERSION=X.X.X
```

### Add redirects
Expand All @@ -84,26 +84,26 @@ Install the `markdownlint-cli` globally, by running the following command from y

```bash
# Using npm
$ npm install -g markdownlint-cli
npm install -g markdownlint-cli

# Or if you have Make installed, use this make command
$ make install-linter
make install-linter
```

Formatting is only enforced in `/serverpod_docs/docs/` directory so therefore you only need to run the markdownlint-cli in this folder with:

```bash
# Using npm
$ markdownlint './docs/**/*.md'
markdownlint './docs/**/*.md'

# Or if you have Make installed, use this make command
$ make format
make format
```

### Manual build and deploy

To do this you need access to the Serverpod Github `serverpod.github.io` repository. Clone it next to the `serverpod_web` repo.

```bash
$ util/deploy
util/deploy
```
10 changes: 5 additions & 5 deletions docs/01-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Serverpod is tested on Mac, Windows, and Linux. Before you can install Serverpod
Check your Flutter installation by running the following command in your terminal:

```bash
$ flutter doctor
flutter doctor
```

::::
Expand All @@ -29,7 +29,7 @@ If you want to use Postgres rather than SQLite on your machine, install **[Docke
Check your Docker installation by running the following command in your terminal:

```bash
$ docker info
docker info
```

If you are using Docker Desktop and you get an error, make sure that Docker is running. You can check this by looking for the Docker icon in your system tray or taskbar. If it's not running, start Docker Desktop and try again.
Expand All @@ -41,13 +41,13 @@ If you are using Docker Desktop and you get an error, make sure that Docker is r
Serverpod is installed using the Dart package manager. To install Serverpod, run the following command in your terminal:

```txt
$ dart install serverpod_cli 3.5.0-beta.6
dart install serverpod_cli 3.5.0-beta.6
```

This command will install the Serverpod command-line interface (CLI) globally on your machine. You can verify the installation by running:

```bash
$ serverpod
serverpod
```

If everything is correctly configured, the help for the `serverpod` command is now displayed.
Expand All @@ -57,7 +57,7 @@ If everything is correctly configured, the help for the `serverpod` command is n
If the Serverpod CLI is already installed globally, deactivate it before installing or upgrading:

```txt
$ dart pub global deactivate serverpod_cli
dart pub global deactivate serverpod_cli
```

:::
Expand Down
18 changes: 9 additions & 9 deletions docs/04-get-started/01-creating-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ development:
Next, we add the Dartantic AI package as a dependency to our server. This package provides a convenient interface for working with different AI providers, including Google's Gemini API.

```bash
$ cd magic_recipe_server
$ dart pub add dartantic_ai
cd magic_recipe_server
dart pub add dartantic_ai
```

## Create a new endpoint
Expand Down Expand Up @@ -100,8 +100,8 @@ For methods to be recognized by Serverpod, they need to return a typed `Future`
Now, you need to generate the code for your new endpoint. You do this by running `serverpod generate` in the server directory of your project:

```bash
$ cd magic_recipe_server
$ serverpod generate
cd magic_recipe_server
serverpod generate
```

`serverpod generate` will create bindings for the endpoint and register them in the server's `generated/protocol.dart` file. It will also generate the required client code so that you can call your new `generateRecipe` method from your app.
Expand Down Expand Up @@ -221,16 +221,16 @@ Before you start your server, ensure no other Serverpod server is running. Also,
Let's try our new recipe app! First, start the server:

```bash
$ cd magic_recipe_server
$ docker compose up -d
$ dart bin/main.dart --apply-migrations
cd magic_recipe_server
docker compose up -d
dart bin/main.dart --apply-migrations
```

Now, you can start the Flutter app:

```bash
$ cd magic_recipe_flutter
$ flutter run -d chrome
cd magic_recipe_flutter
flutter run -d chrome
```

This will start the Flutter app in your browser:
Expand Down
18 changes: 9 additions & 9 deletions docs/04-get-started/02-models-and-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ You can use most primitive Dart types here or any other models you have specifie
To generate the code for the model, run the `serverpod generate` command in your server directory:

```bash
$ cd magic_recipe_server
$ serverpod generate
cd magic_recipe_server
serverpod generate
```

This will generate the code for the model and create a new file called `recipe.dart` in the `lib/src/generated` directory. It will also update the client code in `magic_recipe/magic_recipe_client` so you can use it in your Flutter app.
Expand Down Expand Up @@ -133,8 +133,8 @@ class RecipeEndpoint extends Endpoint {
First, we need to update our generated client by running `serverpod generate`.

```bash
$ cd magic_recipe_server
$ serverpod generate
cd magic_recipe_server
serverpod generate
```

Now that we have created the `Recipe` model we can use it in the app. We will do this in the `_callGenerateRecipe` method of the `magic_recipe_flutter/lib/main.dart` file. Let's update our `RecipeWidget` so that it displays the author and year of the recipe in addition to the recipe itself.
Expand Down Expand Up @@ -433,16 +433,16 @@ class ResultDisplay extends StatelessWidget {
First, start the server:

```bash
$ cd magic_recipe_server
$ docker compose up -d
$ dart bin/main.dart
cd magic_recipe_server
docker compose up -d
dart bin/main.dart
```

Then, start the Flutter app:

```bash
$ cd magic_recipe_flutter
$ flutter run -d chrome
cd magic_recipe_flutter
flutter run -d chrome
```

This will start the Flutter app in your browser. It should look something like this:
Expand Down
20 changes: 10 additions & 10 deletions docs/04-get-started/03-working-with-the-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ To create a migration, follow these two steps in order:
2. Run `serverpod create-migration` to create the necessary database migration.

```bash
$ cd magic_recipe_server
$ serverpod generate
$ serverpod create-migration
cd magic_recipe_server
serverpod generate
serverpod create-migration
```

Each time you run `serverpod create-migration`, a new migration file will be created in your _migrations_ folder. These step-by-step migrations provide a history of your database changes and allow you to roll back changes if needed.
Expand Down Expand Up @@ -190,8 +190,8 @@ The `insertRow` method is used to insert a new row into the database. The `find`
Like before, when you change something that has an effect on your client code, you need to run `serverpod generate`. We don't need to run `serverpod create-migrations` again because we already created a migration in the previous step and haven't done any changes that affect the database.

```bash
$ cd magic_recipe_server
$ serverpod generate
cd magic_recipe_server
serverpod generate
```

## Call the endpoint from the app
Expand Down Expand Up @@ -434,9 +434,9 @@ To run the application with database support, follow these steps in order:
First, start the database and apply migrations:

```bash
$ cd magic_recipe_server
$ docker compose up -d # Start the database container
$ dart bin/main.dart --apply-migrations # Apply any pending migrations
cd magic_recipe_server
docker compose up -d # Start the database container
dart bin/main.dart --apply-migrations # Apply any pending migrations
```

:::tip
Expand All @@ -446,8 +446,8 @@ The `--apply-migrations` flag is safe to use during development - if no migratio
Next, launch the Flutter app:

```bash
$ cd magic_recipe_flutter
$ flutter run -d chrome
cd magic_recipe_flutter
flutter run -d chrome
```

## Summary
Expand Down
6 changes: 3 additions & 3 deletions docs/06-concepts/06-database/01-connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ development:
A newly created Serverpod project has a preconfigured Docker instance with a Postgres database set up. Run the following command from the root of the `server` package to start the database:

```bash
$ docker compose up --build --detach
docker compose up --build --detach
```

To stop the database run:

```bash
$ docker compose stop
docker compose stop
```

To remove the database and __delete__ all associated data, run:

```bash
$ docker compose down -v
docker compose down -v
```

## Connecting to a custom Postgres instance
Expand Down
Loading
Loading