Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/06-concepts/12-file-uploads.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: File upload handling in Serverpod uses cloud storage providers (GCP, S3, Cloudflare R2) or the database, with server-generated upload descriptions and client-side verification.
---

# Uploading files

Serverpod has built-in support for handling file uploads. Out of the box, your server is configured to use the database for storing files. This works well for testing but may not be performant in larger-scale applications. You should set up your server to use Google Cloud Storage or S3 in production scenarios.
Expand Down Expand Up @@ -55,7 +59,7 @@ Future<bool> verifyUpload(Session session, String path) async {

### Client-side code

To upload a file from the app side, first request the upload description. Next, upload the file. You can upload from either a `Stream` or a `ByteData` object. If you are uploading a larger file, using a `Stream` is better because not all of the data must be held in RAM memory. Finally, you should verify the upload with the server.
To upload a file from the app side, first request the upload description. Next, upload the file. You can upload from either a `Stream` or a `ByteData` object. If you are uploading a larger file, using a `Stream` is better because not all of the data must be held in RAM. Finally, you should verify the upload with the server.

```dart
var uploadDescription = await client.myEndpoint.getUploadDescription('myfile');
Expand All @@ -78,7 +82,7 @@ In a real-world app, you most likely want to create the file paths on your serve

## Accessing stored files

It's possible to quickly check if an uploaded file exists or access the file itself. If a file is in a public storage, it is also accessible to the world through an URL. If it is private, it can only be accessed from the server.
You can check if a file exists or retrieve it directly from your server. Files in public storage are also accessible via URL; private files can only be accessed from the server.

To check if a file exists, use the `fileExists` method.

Expand Down
6 changes: 5 additions & 1 deletion docs/06-concepts/13-health-checks.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: Health checks in Serverpod expose Kubernetes-style HTTP endpoints (/livez, /readyz, /startupz) for liveness, readiness, and startup probing, with support for custom health indicators and metrics.
---

# Health checks

Serverpod provides a complete health check system that allows you to monitor the health of your server and your dependencies through Kubernetes-style HTTP endpoints (`/livez`, `/readyz`, `/startupz`) - each with a specific purpose that helps orchestrators (like Kubernetes) make informed decisions about container lifecycle and traffic routing.
Expand Down Expand Up @@ -182,7 +186,7 @@ Independently from the health check endpoints, Serverpod also collects health me

### Adding custom metrics

Sometimes it is helpful to add custom health metrics. This can be for monitoring external services or internal processes within your Serverpod. To set up your custom metrics, you must create a `HealthCheckHandler` and register it with your Serverpod.
Add custom health metrics to monitor external services or internal processes. To set up your custom metrics, you must create a `HealthCheckHandler` and register it with your Serverpod.

```dart
// Create your custom health metric handler.
Expand Down
12 changes: 5 additions & 7 deletions docs/06-concepts/20-shared-packages.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: Shared packages in Serverpod let you define models usable in both server and client code, depending only on serverpod_serialization with no server-only dependencies.
---

# Shared packages

Shared packages let you define models and logic that can be safely imported in both server and client code. They contain the models and the protocol file, depend exclusively on the `serverpod_serialization` package, and have no server-only dependencies. This makes them ideal for data structures that need to be used across your full stack—for example, DTOs, API request/response shapes, or domain models that flow between Flutter and your Serverpod backend with their custom logic.
Expand All @@ -6,12 +10,6 @@ Models and the protocol file are generated in the shared package's own directory

## Setup

To create a shared package, follow the steps below.

:::info
Currently, the setup of shared packages is manual. In the future, a command will be added to the Serverpod CLI to allow an easy setup.
:::

### Create the shared package

Create a new Dart package (e.g., `my_shared_package`) with a minimal `pubspec.yaml`:
Expand Down Expand Up @@ -111,7 +109,7 @@ dependencies:
path: ../my_shared_package
```

Now you are ready to use the shared package in your server and client code!
You are now ready to use the shared package in your server and client code.

## Using shared models

Expand Down
17 changes: 9 additions & 8 deletions docs/06-concepts/21-security-configuration.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
description: Security configuration in Serverpod lets you enable TLS/SSL directly on the server or configure the client to trust a certificate, using SecurityContextConfig.
---

# Security Configuration

:::info

In a **production environment**, TLS termination is **normally handled by a load balancer** or **reverse proxy** (e.g., Nginx, AWS ALB, or Cloudflare).
However, Serverpod also supports setting up **TLS/SSL directly on the server**, allowing you to provide your own certificates if needed.
In a production environment, TLS termination is normally handled by a load balancer or reverse proxy (e.g., Nginx, AWS ALB, or Cloudflare).
However, Serverpod also supports setting up TLS/SSL directly on the server, allowing you to provide your own certificates if needed.

:::

Serverpod supports **TLS/SSL security configurations** through the **Dart configuration object**.
To enable SSL/TLS, you must pass a **`SecurityContextConfig`** to the `Serverpod` constructor.

## Server Security Configuration
Comment thread
Swiftaxe marked this conversation as resolved.

To enable SSL/TLS in Serverpod, configure the `SecurityContextConfig` and pass it to the `Serverpod` instance.
To enable TLS/SSL, pass a `SecurityContextConfig` to the `Serverpod` constructor.

### Dart Configuration Example

Expand All @@ -35,11 +36,11 @@ Serverpod(

## Client Security Configuration

When connecting to a **Serverpod server over HTTPS**, the client must be configured to trust the server's certificate.
When connecting to a Serverpod server over HTTPS, the client must be configured to trust the server's certificate.

### Dart Configuration Example

To enable SSL/TLS when using the Serverpod client, pass a **`SecurityContext`** to the `Client` constructor.
To enable SSL/TLS, pass a `SecurityContext` to the `Client` constructor.

```dart
final securityContext = SecurityContext()
Expand Down
12 changes: 6 additions & 6 deletions docs/06-concepts/22-experimental.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
description: Experimental features in Serverpod are opt-in additions with unstable APIs, including diagnostic event handlers for exception monitoring and shutdown task registration.
---

# Experimental features

:::warning
Be cautious when using experimental features in production environments, as their stability is uncertain and they may receive breaking changes in upcoming releases.
:::

"Experimental Features" are cutting-edge additions to Serverpod that are currently under development or testing or whose API is not yet stable.
These features allow developers to explore new functionalities and provide feedback, helping shape the future of Serverpod.
However, they may not be fully stable or complete and are subject to change.

Experimental features are disabled by default, i.e. they are not active unless the developer opts-in.
Experimental features are opt-in additions to Serverpod. They are disabled by default; enable them through the `experimentalFeatures` argument on the `Serverpod` constructor or via `config/generator.yaml`.

:::note
To make the LSP server understand the usage of experimental flags and avoid complaints about unknown syntax on model files, configure experimental features in the `config/generator.yaml` file. See the [configuration documentation](configuration#experimental-features) for more details.
Expand Down Expand Up @@ -51,7 +51,7 @@ they do not allow any behavior-changing action such as suppressing exceptions or

### Setup

This feature is enabled by providing one ore more `DiagnosticEventHandler` implementations
Comment thread
Swiftaxe marked this conversation as resolved.
This feature is enabled by providing one or more `DiagnosticEventHandler` implementations
to the Serverpod constructor's `experimentalFeatures` specification.

Example:
Expand Down
Loading