Skip to content

Commit 0e831d8

Browse files
authored
chore(repo): Update READMEs (#220)
1 parent f5e9a1d commit 0e831d8

File tree

7 files changed

+109
-98
lines changed

7 files changed

+109
-98
lines changed

README.md

Lines changed: 41 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -9,125 +9,79 @@ Celest is the Flutter cloud platform. We enable Flutter and Dart developers to d
99

1010
And to stay up-to-date on the future of Celest, including full server-side rendered Flutter apps, join our newsletter at [celest.dev](https://www.celest.dev/#stay-up-to-date).
1111

12-
## Getting started with Celest
12+
## Getting Started
1313

14-
### Prerequisites
14+
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.
1515

16-
To use Celest in your Flutter app, you need the following prerequisites:
16+
1. Install [Flutter](https://docs.flutter.dev/get-started/install) from the official website
17+
3. [Download](https://celest.dev/download) and install the Celest CLI
1718

18-
1. Install [Flutter](https://docs.flutter.dev/get-started/install)
19-
2. Create a new Flutter project (or choose an existing one)
20-
3. [Download](https://celest.dev/docs/download) and install the Celest CLI
19+
### Creating a project
2120

22-
### Creating a Celest project
21+
Once you have the CLI installed, you can create a new project by running the following command:
2322

24-
That’s it! You are now ready to start building your backend - all in Dart!
25-
26-
Start by first creating a new Flutter project. If you have an existing Flutter project, you can use that instead. To start a new Flutter project, go to your console and run the following command.
27-
28-
```shell
29-
$ flutter create <flutter_app>
30-
```
31-
32-
Then, navigate to your new Flutter app directory.
33-
34-
```shell
35-
$ cd <flutter_app>
23+
```bash
24+
$ celest init
3625
```
26+
You can run this command from within your Flutter project which will create a new `celest/` directory for your project. Or you can run
27+
this in another directory to have a standalone Celest project.
3728

38-
Once you are in your Flutter app directory, run the following command to initialize your Celest project.
29+
Once you have a project, run `celest start` to start a local development environment.
3930

40-
```shell
31+
```bash
4132
$ celest start
33+
✓ Celest is running on http://localhost:7777
4234
```
4335

44-
Once the command executes, Celest will spin up a local environment and watch for changes made to your backend, generating a Dart client for you to test your changes.
45-
46-
The CLI will also create a folder in your project called `celest`, which will include the following files.
47-
48-
```shell
49-
flutter_app/
50-
└── celest/
51-
├── functions/ # Celest Functions folder
52-
| └── greeting.dart # Example API file
53-
├── lib/
54-
│ │── client.dart # Generated client for your Flutter app
55-
│ ├── models/ # Custom API models
56-
| | └── person.dart
57-
│ └── exceptions/ # Custom API exceptions
58-
| └── bad_name_exception.dart
59-
└── test/ # Tests for your backend
60-
```
36+
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,
37+
the server will hot-reload those changes so you can see them live.
6138

62-
To start building your serverless cloud function, navigate to the `my_celest_app/celest/functions/` folder and create a file named `<api_name>.dart`. You can create as many APIs as you want in this directory.
63-
Each file groups and organizes multiple Celest Functions of similar functionality into a namespace.
39+
To interact with the running environment, Celest will generate a Dart client which you can use in any Dart or Flutter project. This client
40+
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.
6441

65-
Celest Functions are defined as top-level functions as shown below.
42+
### Example
43+
44+
Here is an example of a simple Celest function:
6645

6746
```dart
47+
import 'package:celest/celest.dart';
48+
6849
@cloud
6950
Future<String> sayHello(String name) async {
51+
print('Saying hello to $name');
7052
return 'Hello, $name';
7153
}
72-
73-
@cloud
74-
Future<String> sayGoodbye(String name) async {
75-
return 'Goodbye, $name';
76-
}
7754
```
7855

79-
That's all you need to define your API! Now, you can connect your Flutter app to your cloud functions by using the Celest client as shown in the following example. Replace the contents of the `main.dart` file in your Flutter app to the following code-snippet.
56+
This function can be called from a Dart project like so:
8057

81-
```dart {3,7,24}
82-
import 'package:flutter/material.dart';
83-
// Import the generated Celest client
84-
import 'package:celest_backend/client.dart';
58+
```dart
59+
import 'package:my_project_client/my_project_client.dart';
8560
86-
void main() {
87-
// Initialize Celest at the start of your app
61+
Future<void> main() async {
8862
celest.init(environment: CelestEnvironment.local);
89-
runApp(const MyApp());
90-
}
91-
92-
class MyApp extends StatelessWidget {
93-
const MyApp({super.key});
94-
95-
@override
96-
Widget build(BuildContext context) {
97-
return MaterialApp(
98-
home: Scaffold(
99-
appBar: AppBar(
100-
title: const Text('Homepage'),
101-
),
102-
body: Center(
103-
child: FutureBuilder(
104-
// Call your function using the Celest client
105-
future: celest.functions.greeting.sayHello('Celest'),
106-
builder: (_, snapshot) => switch (snapshot) {
107-
AsyncSnapshot(:final data?) => Text(data),
108-
AsyncSnapshot(:final error?) =>
109-
Text('${error.runtimeType}: $error'),
110-
_ => const CircularProgressIndicator(),
111-
},
112-
),
113-
),
114-
),
115-
);
116-
}
63+
final response = await celest.functions.sayHello('World');
64+
print(response); // Hello, World
11765
}
11866
```
11967

120-
You have now set up your Celest project and integrated it into your Flutter app. Follow our [documentation](https://celest.dev/docs/functions/introduction) to learn more about using Celest Functions.
68+
## What's Next?
69+
70+
In addition to Dart cloud functions, Celest offers authentication and database services out-of-the-box. To learn more about these features,
71+
and to see what else you can do with cloud functions, visit our [docs](https://celest.dev/docs) and explore the different examples and
72+
packages available in this repo.
12173

12274
## Examples
12375

12476
[![Celest](https://github.com/celest-dev/celest/actions/workflows/examples.yaml/badge.svg)](https://github.com/celest-dev/celest/actions/workflows/examples.yaml)
12577

126-
| Example | Description |
127-
| -------------------------- | ----------------------------------------------------------------------------------------- |
128-
| [Gemini](examples/gemini/) | Uses Google's [Gemini](https://ai.google.dev/) API for chat completion. |
129-
| [OpenAI](examples/openai/) | Uses the [OpenAI](https://platform.openai.com/docs/introduction) API for chat completion. |
130-
| [Todo](examples/todo/) | A simple todo list application. |
78+
| Example | Description |
79+
| ------------------------------ | ----------------------------------------------------------------------------------------- |
80+
| [Firebase](examples/firebase/) | Showcases how to integrate Firebase Auth with Celest. |
81+
| [Gemini](examples/gemini/) | Uses Google's [Gemini](https://ai.google.dev/) API for chat completion. |
82+
| [OpenAI](examples/openai/) | Uses the [OpenAI](https://platform.openai.com/docs/introduction) API for chat completion. |
83+
| [Supabase](examples/supabase/) | Showcases how to integrate Supabase Auth with Celest. |
84+
| [Tasks](examples/tasks/) | Uses Celest Data to build a simple task tracking app with persistence. |
13185

13286
## Packages
13387

packages/celest/README.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
1-
## celest
1+
# Celest
22

3-
Celest is the Flutter cloud platform, enabling Flutter and Dart developers to define their backend infrastructure purely in Dart.
3+
Celest is the Flutter cloud platform, enabling Dart and Flutter developers to define their backend infrastructure purely in Dart.
44

5-
**This package is not intended to be used directly.** It is used by the Celest CLI to generate code for your backend. To learn more about how to use this package and integrate it with the Celest CLI, visit our [documentation](https://celest.dev/docs).
5+
Celest offers a simple and intuitive way to define cloud functions, authentication, and database services. With Celest, you can build full-stack Flutter applications with ease,
6+
all while using the same language and tools you already know.
7+
8+
## Getting Started
9+
10+
To get started with Celest, you need to install the Celest CLI. You can do this by downloading the latest release from our [website](https://celest.dev/download).
11+
12+
Once you have the CLI installed, you can create a new project by running the following command:
13+
14+
```bash
15+
$ celest init
16+
```
17+
You can run this command from within your Flutter project which will create a new `celest/` directory for your project. Or you can run
18+
this in another directory to have a standalone Celest project.
19+
20+
Once you have a project, run `celest start` to start a local development environment.
21+
22+
```bash
23+
$ celest start
24+
✓ Celest is running on http://localhost:7777
25+
```
26+
27+
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,
28+
the server will hot-reload those changes so you can see them live.
29+
30+
To interact with the running environment, Celest will generate a Dart client which you can use in any Dart or Flutter project. This client
31+
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.
32+
33+
### Example
34+
35+
Here is an example of a simple Celest function:
36+
37+
```dart
38+
import 'package:celest/celest.dart';
39+
40+
@cloud
41+
Future<String> sayHello(String name) async {
42+
print('Saying hello to $name');
43+
return 'Hello, $name';
44+
}
45+
```
46+
47+
This function can be called from a Dart project like so:
48+
49+
```dart
50+
import 'package:my_project_client/my_project_client.dart';
51+
52+
Future<void> main() async {
53+
celest.init(environment: CelestEnvironment.local);
54+
final response = await celest.functions.sayHello('World');
55+
print(response); // Hello, World
56+
}
57+
```
58+
59+
## What's Next?
60+
61+
In addition to Dart cloud functions, Celest offers authentication and database services out-of-the-box. To learn more about these features,
62+
and to see what else you can do with cloud functions, visit our [docs](https://celest.dev/docs).

packages/celest_ast/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.1.4
22

3-
- feat: Adds `Database` and `DatabaseSchema` models
3+
- feat: Adds `Database` and `DatabaseSchema` models, and corresponding resolved types.
4+
- feat: Adds additional route configuration options for functions.
45

56
## 0.1.3
67

packages/celest_ast/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: celest_ast
22
description: A structured representation of Celest project and service definitions.
3-
version: 0.1.4-wip
3+
version: 0.1.4
44
homepage: https://celest.dev
55
repository: https://github.com/celest-dev/celest/tree/main/packages/celest_ast
66

packages/celest_cloud/CHANGELOG.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
# 0.1.4-wip
2-
3-
- chore: Update protos
4-
51
# 0.1.3
62

7-
- feat: Add SMS OTP flow
3+
- chore: Update protos
4+
- chore: Use HTTP exclusively for Authentication and User APIs
85

96
# 0.1.2
107

packages/celest_cloud/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: celest_cloud
22
description: API contracts and Dart clients for the Celest Cloud platform.
3-
version: 0.1.4
3+
version: 0.1.3
44
repository: https://github.com/celest-dev/celest
55

66
environment:

services/celest_cloud_auth/pubspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: celest_cloud_auth
22
description: A Dart-native authentication and authorization service built on Celest, Cedar, and SQLite.
33
version: 0.1.0
4+
homepage: https://celest.dev
5+
repository: https://github.com/celest-dev/celest/tree/main/services/celest_cloud_auth
46

57
environment:
68
sdk: ^3.4.0

0 commit comments

Comments
 (0)