Skip to main content

Command-line and server apps

All things relating to command-line and server apps.

This page points to tools and documentation that can help you develop command-line and server apps.

Tools

#
DartPad

Handy for both beginners and experts, DartPad lets you try out language features and dart:* APIs.

Dart SDK

Install the Dart SDK to get the core Dart libraries and tools.

Server architectures and frameworks

#

Dart supports multiple backend architectures depending on your application requirements:

Architecture / framework Best suited for Key advantages Data and persistence
Cloud Functions for Firebase Serverless HTTP and callable APIs, backends for Flutter apps Shared code with Flutter, zero server management, fast AOT cold starts Cloud Firestore and Cloud Storage via firebase_admin_sdk
Serverpod Full-stack applications, backends for Flutter apps Built-in authentication, file storage, server functions, and code generation PostgreSQL and Redis databases (built-in ORM and migrations)
Dart Frog Fast REST APIs, modular microservices Minimalistic routing, dependency injection, built on Shelf Database agnostic
Shelf Custom web servers, composable middleware Lightweight primitive, modular architecture Database agnostic

For more tools and IDE plugins, see the Tools page. For additional options, see #server packages on pub.dev.

Building serverless backends with Cloud Functions for Firebase

#

Write Cloud Functions for Firebase using Dart to enable full-stack development, reuse code between your client and backend, and respond to Firebase triggers. Dart Cloud Functions compile ahead-of-time (AOT) to native binaries that deploy directly to Google Cloud infrastructure, delivering fast cold-start performance with minimal memory overhead.

To get started, see the Cloud Functions for Firebase documentation.

Firebase Functions package

The core package to write backend functions and APIs in Dart.

Firebase Admin SDK package

Access Firebase services securely from backend servers or Cloud Functions. Use it to manage data, send notifications, or verify authentication tokens.

Firebase Functions for Dart repository

GitHub repository with quickstart guides, examples, and source code.

Sharing code between Flutter apps and Dart backends

#

When you use Dart for both your Flutter client and Firebase backend, you can organize your workspace into a monorepo or multi-package structure with a shared package:

my_project/
├── packages/
│   ├── app/           # Flutter frontend application
│   ├── functions/     # Cloud Functions for Firebase in Dart
│   └── shared/        # Shared models, DTOs, and validation logic

By placing data classes, JSON serialization logic, and validation rules in package:shared, any change to your data models propagates across both client and server, keeping your frontend and backend synchronized.

Samples

#
A simple Dart HTTP server
A Dart HTTP server that uses Cloud Firestore

More resources

#
Dart API

API reference for dart:* libraries.

dart:io documentation

Shows how to use the major features of the dart:io library. You can use the dart:io library in command-line scripts, servers, and non-web Flutter apps.

Using Google Cloud

Guides and documentation on Google Cloud products that Dart servers can use, such as Cloud Run.

Using Google APIs

Resources to help you use Firebase and Google client APIs from a Dart app.