chore: scaffold the Serverpod 4 build
Deviations from a stock `serverpod create`:
- Dropped Flutter web support, for two reasons:
- Appflowy editor had issues in the past, potentially related to the
Flutter-Web IME bridge. Upstream has also open bugs in relation to
that:
- AppFlowy-IO/appflowy-editor#1029 [Bug][Web] Unwanted space on click
and overall space bugs (open)
- AppFlowy-IO/appflowy-editor#782 [Bug] Editor auto-scrolling when
pressing space too quickly if placed inside a scrollable (open)
- Offline-first is a required feature. serverpod_offline_sync's SQLite
support in browsers, maybe via sqlite3.wasm + OPFS, is not
documented.
- SDK constraints raised to ^3.13.0, instead of ^3.12.2, so enjoy the
newest language features.
- Pinned to Flutter 3.47.4 via FVM.
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
commit
e17d99fa51
1 changed files with 17563 additions and 0 deletions
51
halkyon_learn_server/lib/server.dart
Normal file
51
halkyon_learn_server/lib/server.dart
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import 'package:serverpod_auth_idp_server/core.dart';
|
||||
import 'package:serverpod_auth_idp_server/providers/email.dart';
|
||||
import 'package:serverpod_cloud_storage/serverpod_cloud_storage.dart';
|
||||
|
||||
import 'src/generated/serverpod.dart';
|
||||
|
||||
/// The starting point of the Serverpod server.
|
||||
void run(List<String> args) async {
|
||||
// Initialize Serverpod. The generated Serverpod class is already connected
|
||||
// with your project's generated code.
|
||||
final pod = Serverpod(args);
|
||||
|
||||
// Initialize authentication services for the server.
|
||||
// Token managers will be used to validate and issue authentication keys,
|
||||
// and the identity providers will be the authentication options available for users.
|
||||
pod.initializeAuthServices(
|
||||
tokenManagerBuilders: [
|
||||
// Use JWT for authentication keys towards the server.
|
||||
JwtConfigFromPasswords(),
|
||||
],
|
||||
identityProviderBuilders: [
|
||||
// Configure the email identity provider for email/password authentication.
|
||||
// The default setup works with Serverpod Cloud without configuration. In
|
||||
// development the verification codes are logged to the console, and in
|
||||
// staging and production they are sent through the Serverpod Cloud email
|
||||
// service. If you want to use a custom provider for sending emails, use
|
||||
// `EmailIdpConfigFromPasswords`.
|
||||
ServerpodCloudEmailIdpConfig(
|
||||
appDisplayName: 'halkyon_learn',
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
// Configure cloud storage.
|
||||
// This setup works with Serverpod Cloud without extra configuration.
|
||||
// If you want to use a custom provider for cloud storage, replace these
|
||||
// with your preferred provider.
|
||||
pod.addCloudStorage(
|
||||
await ServerpodCloudProvider.private(
|
||||
fallback: () => DatabaseCloudStorage('private'),
|
||||
),
|
||||
);
|
||||
pod.addCloudStorage(
|
||||
await ServerpodCloudProvider.public(
|
||||
fallback: () => DatabaseCloudStorage('public'),
|
||||
),
|
||||
);
|
||||
|
||||
// Start the server.
|
||||
await pod.start();
|
||||
}
|
||||
Loading…
Reference in a new issue