Building Backend with Flutter using Celest

Engineering

Flutter

Guide

Summary

This article explores Celest, a backend-as-a-service designed specifically for Flutter developers, facilitating the development of backend functions using Dart, the same language used for Flutter. It provides a seamless integration and eliminates the need for switching between different programming languages or tools, promoting a more streamlined development process.

Key insights:
  • Unified Language Use: Celest allows developers to build both front-end and backend in Dart, minimizing complexity and enhancing productivity by eliminating the need for multiple languages.

  • Easy Setup and Integration: Installing and integrating Celest with Flutter is straightforward, involving simple CLI commands and direct coding in Dart, which supports rapid application development.

  • Enhanced Development Features: Celest supports hot reloading and provides cloud widgets, enabling developers to iterate quickly and include common backend functionalities effortlessly.

  • Security and Access Control: It includes features for user authentication and function authorization, ensuring secure access to backend functions.

  • Support for Custom Data Types and Testing: Developers can define custom data models and write tests for their backend logic, ensuring robust and reliable backend services.

Introduction

Flutter is an open-source software development kit created by Google as a one-stop solution for building web, mobile, and desktop applications. However, when it comes to back-end development, Flutter developers often have to use multiple tools and languages which can increase project complexity and disrupt the development process. Celest aims to provide a solution for this problem by offering a backend-as-a-service specifically designed for Flutter developers.

Celest allows developers to build their backend entirely in Dart, eliminating the need for additional tooling or context switching to different programming languages. This service not only simplifies the development process but also allows seamless sharing of logic and code between Flutter applications and their backends. This article aims to provide an overview of the steps involved in order to build a backend for your Flutter application using Celest and highlight its advantages.

Installation and Setup

1. Download the Celest CLI from the official website and follow the installation instructions. 

2. Create your Flutter project.

3. Inside the Flutter project direct, run celest start from the terminal. This will create a new folder called “celest” in your project directory that contains the backend logic for the application.

Below is a table detailing the CLI commands for Celest:

CommandDescriptioncelest startCreates a new Celest projectcelest deployDeploys the Celest project to the cloudcelest upgradeUpgrades Celest CLI to the latest versioncelest uninstallUninstalls Celestcelest --helpShow all available commands for Celestcelest --versionShows the current version of Celest CLI

Creating a Function (API)

1. Navigate to the functions folder inside the newly created celest folder.

2. Create a new dart file.

3. Code away your API functions using Dart. Below is a simple example retrieved from the official website that features two functions:

Connect the Flutter application to The Cloud Functions

1. Import celest in the main.dart file:

2. Initiate celest by including celest.init() in the main function of the main. dart file.

If you’ve followed the steps above, you should be good to go. You can now utilize your back-end functions defined in the celest directory directly in the flutter by calling them using:

Additional Features

Working with custom data types: To work with user-defined data structures, you must place them in the celest/lib/models file for them to work with the backend functions.

Celest Auth: Currently, only email-based authentication via OTP is implemented. This can be used by including the following code in your application:

Authorizing your functions: By default, Celest only allows the admin to access functions. However, this can be changed by using one of the following annotations: @public (grants access to anyone on the internet) and @authenticated (grants access to authenticated users)

Writing Tests: Within the Celest/Test folder, you can create a new Dart file and define unit tests. In order to run the tests, run the following command in the terminal: dart test

Third-Party Packages: Celest supports all third-party packages that are compatible with Dart to be included in the backend functions.

Advantages of Using Celest

Integration with Flutter: Since Celest utilizes Dart, it allows developers to share logic and code between the two resulting in a more efficient development process and eliminating the need for context switching.

Hot Reloading: Celest allows developers to build cloud features locally and test them on the fly by using hot reload, which significantly improves the iteration speed.

Cloud Widgets: Celest offers a set of pre-built cloud widgets that include common backend functionalities such as authentication which can streamline the development process. The list of functionalities will continue to grow as the developers at Celest are actively updating their framework.

Separation Layer: By separating the business logic and the UI layer, Celest enables developers to add features to their backend without requiring a new version deployment to the app store. 

Dart Package Integration: Developers can take advantage of the large number of Dart packages already available and integrate them into their backend functions.

Conclusion

Celest offers a backend-as-a-service solution designed specifically for Flutter developers. By allowing the entire backend to be built using Dart, Celest streamlines development and enables seamless integration between the frontend and backend components. Key benefits include the ability to share logic and code, hot reloading for efficient iteration, pre-built cloud widgets with common functionality, and separation of business logic from the UI layer. As Celest continues to grow towards its goal of “turning every Flutter developer into a full-stack developer”, it can become an invaluable tool for Flutter developers.

References

https://celest.dev/docs/overview

https://www.ycombinator.com/companies/celest

Other Insights

Got an app?

We build and deliver stunning mobile products that scale

Got an app?

We build and deliver stunning mobile products that scale

Got an app?

We build and deliver stunning mobile products that scale

Got an app?

We build and deliver stunning mobile products that scale

Got an app?

We build and deliver stunning mobile products that scale

Our mission is to harness the power of technology to make this world a better place. We provide thoughtful software solutions and consultancy that enhance growth and productivity.

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

Book an onsite meeting or request a services?

© Walturn LLC • All Rights Reserved 2024

Our mission is to harness the power of technology to make this world a better place. We provide thoughtful software solutions and consultancy that enhance growth and productivity.

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

Book an onsite meeting or request a services?

© Walturn LLC • All Rights Reserved 2024

Our mission is to harness the power of technology to make this world a better place. We provide thoughtful software solutions and consultancy that enhance growth and productivity.

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

Book an onsite meeting or request a services?

© Walturn LLC • All Rights Reserved 2024

Our mission is to harness the power of technology to make this world a better place. We provide thoughtful software solutions and consultancy that enhance growth and productivity.

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

Book an onsite meeting or request a services?

© Walturn LLC • All Rights Reserved 2024

Our mission is to harness the power of technology to make this world a better place. We provide thoughtful software solutions and consultancy that enhance growth and productivity.

The Jacx Office: 16-120

2807 Jackson Ave

Queens NY 11101, United States

Book an onsite meeting or request a services?

© Walturn LLC • All Rights Reserved 2024