Docs
Getting Started

Getting started

This guide walks you through setting up Celest on your development machine, and how to create a new project.

To get started with Celest, you'll need to configure your development environment so that you have Flutter and the Celest CLI installed on your machine.

  1. Install Flutter v3.29.0 or later from the official website (opens in a new tab)
  2. Download and install the Celest CLI
$ dart pub global activate celest_cli

Creating a project

Once you have the CLI installed, you can create a new project by running the following command:

$ celest init

You can run this command from within your Flutter project which will create a new celest/ directory for your project. Or you can run this in another directory to have a standalone Celest project.

Once you have a project, run celest start to start a local development environment.

$ celest start
 Celest is running on http://localhost:7777

This command will start a local server which will run in the background as you write your backend logic. As you make changes to the files in the celest/ directory, the server will hot-reload those changes so you can see them live.

To interact with the running environment, Celest will generate a Dart client which you can use in any Dart or Flutter project. This client is generated in the client/ directory of your celest/ folder. As you make changes in the local environment, this client will be updated to reflect those changes.

Example

Here is an example of a simple Celest function:

import 'package:celest/celest.dart';
 
@cloud
Future<String> sayHello(String name) async {
  print('Saying hello to $name');
  return 'Hello, $name';
}

This function can be called from a Dart project like so:

import 'package:my_project_client/my_project_client.dart';
 
Future<void> main() async {
  celest.init(environment: CelestEnvironment.local);
  final response = await celest.functions.sayHello('World');
  print(response); // Hello, World
}

Next steps

Ready to start building? Choose which part of your backend you want to work on first: