Skip to content

Commit 455a81f

Browse files
committed
doc: Update the readme.md file
1 parent 0967552 commit 455a81f

File tree

4 files changed

+122
-89
lines changed

4 files changed

+122
-89
lines changed

README.md

Lines changed: 103 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,161 @@
1-
# :bird: flutter_feathersjs :bird:
1+
<div align="center">
2+
<h1>FlutterFeathersJs</h1>
3+
<br>
24

5+
![FlutterFeathersJs](doc/ff-663x181.png)
36

4-
:rocket: **We're are working on the next release of this Project: 🎯 Version 5.0.0*
7+
<br> <br>
8+
>
9+
> `The road to the feathersjs headquarters https://feathersjs.com/`
10+
>
11+
>
12+
<br> <br>
13+
</div>
514
6-
See our roadmap here: https://github.com/Dahkenangnon/flutter_feathersjs.dart/issues/52
7-
8-
------------------
915

1016

1117
[![GitHub Repo stars](https://img.shields.io/github/stars/dahkenangnon/flutter_feathersjs.dart?label=github%20stars)](https://github.com/dahkenangnon/flutter_feathersjs)
1218
[![pub version](https://img.shields.io/pub/v/flutter_feathersjs)](https://pub.dev/packages/flutter_feathersjs)
1319
[![GitHub last commit](https://img.shields.io/github/last-commit/dahkenangnon/flutter_feathersjs.dart)](https://github.com/dahkenangnon/flutter_feathersjs)
20+
[![GitHub license](https://img.shields.io/github/license/dahkenangnon/flutter_feathersjs.dart)](./LICENSE)
21+
1422

15-
<p align="center">
16-
<br>
17-
Communicate with your feathers js server from flutter app with unbelieved ease and make happy your customers.
18-
<br><br><br>
19-
`Feathers js is a node framework for real-time applications and REST APIs.`
20-
</p>
2123

24+
FlutterFeathersJs is a Flutter package designed to simplify the development of real-time applications using the FeathersJS Node framework. It provides an intuitive API and seamless integration between Flutter and FeathersJS, empowering developers to build powerful and responsive real-time applications with ease.
2225

26+
## Features
2327

24-
<br>
28+
- **Effortless Integration**: Seamlessly connect your Flutter frontend with your FeathersJS backend using FlutterFeathersJs's simple and straightforward API.
29+
- **Real-Time Communication**: Utilize FeathersJS's real-time capabilities to create dynamic and interactive Flutter applications.
30+
- **Authentication Support**: Authenticate users using email/password or tokens, ensuring secure communication between your Flutter app and FeathersJS server.
31+
- **Socket.io or REST Client**: Choose between Socket.io or REST client to suit your project's needs and communication preferences.
32+
- **Event Handling**: Leverage FeathersJS's event-driven architecture to handle real-time events and updates efficiently.
33+
- **Scalable and Reliable**: Benefit from FeathersJS's scalability options and FlutterFeathersJs's robust design to build reliable real-time applications.
2534

26-
## Simple to use
35+
## Installation
2736

28-
### 1. Install it
37+
To start using FlutterFeathersJs, add it to your project's `pubspec.yaml` file:
2938

3039
```yaml
31-
# Please see https://pub.dev/packages/flutter_feathersjs/install
32-
flutter_feathersjs: ^lastest
40+
dependencies:
41+
flutter_feathersjs: ^latest_version
3342
```
3443
35-
### 2. Import it
44+
Replace `latest_version` with the latest version of FlutterFeathersJs available on [pub.dev](https://pub.dev/packages/flutter_feathersjs).
3645

37-
```dart
38-
// Import it
39-
import 'package:flutter_feathersjs/flutter_feathersjs.dart';
46+
Then, run the following command in your project's root directory:
4047

48+
```bash
49+
flutter pub get
4150
```
4251

43-
### 3. Initialize it as single instance
52+
## Getting Started
4453

45-
```dart
54+
To get started with FlutterFeathersJs, follow these steps:
4655

56+
1. Import the FlutterFeathersJs package into your Flutter project:
4757

48-
//your api baseUrl
49-
const BASE_URL = "https://your-feathersjs-server.com";
58+
```dart
59+
import 'package:flutter_feathersjs/flutter_feathersjs.dart';
60+
```
5061

51-
// Init it globally across your app, maybe with get_it or something like that
52-
FlutterFeathersjs flutterFeathersjs = FlutterFeathersjs()..init(baseUrl: BASE_URL);
62+
2. Initialize FlutterFeathersJs as a single instance:
5363

54-
// Authenticate with email/password
55-
var response = await flutterFeathersjs.authenticate(userName: user["email"], password: user["password"]);
56-
print(response);
64+
```dart
65+
const BASE_URL = "https://your-feathersjs-server.com";
5766
58-
// ReAuthenticated with token
59-
var response = await flutterFeathersjs.reAuthenticate();
60-
print(response);
67+
// Use tools like get_it to initialize FlutterFeathersJs globally across your app
68+
FlutterFeathersjs flutterFeathersjs = FlutterFeathersjs()..init(baseUrl: BASE_URL);
69+
```
6170

62-
// Get authenticated user
63-
var response = await flutterFeathersjs.user();
71+
3. Authenticate a user using email/password:
6472

65-
```
73+
```dart
74+
var response = await flutterFeathersjs.authenticate(userName: user["email"], password: user["password"]);
75+
76+
print(response);
77+
```
78+
79+
4. Re-authenticate with a token:
80+
81+
```dart
82+
var response = await flutterFeathersjs.reAuthenticate();
83+
print(response);
84+
```
85+
86+
5. Get the authenticated user:
87+
88+
```dart
89+
var response = await flutterFeathersjs.user();
90+
print(response);
91+
```
6692

67-
### 4. Configure and use only socketio or rest client
93+
For more detailed usage examples and API documentation, please refer to the [FlutterFeathersJs documentation](https://pub.dev/documentation/flutter_feathersjs/latest/).
6894

95+
## Configure and Use Socket.io or REST Client
96+
97+
To configure and use either the Socket.io or REST client, follow the examples below:
98+
99+
### Socket.io Client
69100

70101
```dart
102+
FlutterFeathersjs socketIOClient = FlutterFeathersjs();
71103
72-
// Standalone socket io client
73-
FlutterFeathersjs socketIOClient = FlutterFeathersjs();
104+
IO.Socket io = IO.io(BASE_URL);
74105
75-
// Socket.io client
76-
IO.Socket io = IO.io(BASE_URL);
77-
socketIOClient.configure(FlutterFeathersjs.socketioClient(io));
106+
socketIOClient.configure(FlutterFeathersjs.socketioClient(io));
78107
79-
// Auth socketio client
108+
// Authenticate with Socket.io client
109+
var response = await socketIOClient.authenticate(userName: user["email"], password: user["password"]);
80110
81-
var response = await socketIOClient.authenticate(userName: user["email"], password: user["password"]);
82-
print(response);
111+
print(response);
83112
84-
// ReAuth socketio client
85-
var reAuthResponse = await socketIOClient.reAuthenticate();
86-
87-
// Create a message using socketio standalone client
88-
var ioResponse = await socketIOClient.service('messages').create({"text": 'A new message'});
113+
// Re-authenticate with Socket.io client
114+
var reAuthResponse = await socketIOClient.reAuthenticate();
89115
90-
// Get the authenticated user
91-
var userResponse = await socketIOClient.user();
116+
// Create a message using Socket.io standalone client
117+
var ioResponse = await socketIOClient.service('messages').create({"text": 'A new message'});
92118
119+
// Get the authenticated user
120+
var userResponse = await socketIOClient.user();
93121
```
94122

95-
```dart
96123

97-
//StandAlone rest client
98-
FlutterFeathersjs restClient = FlutterFeathersjs();
99-
Dio dio = Dio(BaseOptions(baseUrl: BASE_URL));
100-
restClient.configure(FlutterFeathersjs.restClient(dio));
101124

125+
### REST Client
126+
127+
```dart
128+
FlutterFeathersjs restClient = FlutterFeathersjs();
102129
103-
// Authenticate user using rest client
104-
var response = await restClient.authenticate( userName: user["email"], password: user["password"]);
105-
print(response);
130+
Dio dio = Dio(BaseOptions(baseUrl: BASE_URL));
106131
107-
// Reauthenticate user using rest client
108-
var reAuthResponse = await restClient.reAuthenticate();
132+
restClient.configure(FlutterFeathersjs.restClient(dio));
109133
110-
// Call service
111-
var restResponse = await restClient.service('messages').create({"text": 'A new message'});
134+
// Authenticate user using REST client
135+
var response = await restClient.authenticate(userName: user["email"], password: user["password"]);
112136
137+
print(response);
113138
114-
// Get the authenticated user
115-
var user = await restClient.user();
139+
// Re-authenticate user using REST client
140+
var reAuthResponse = await restClient.reAuthenticate();
116141
142+
// Call service using REST client
143+
var restResponse = await restClient.service('messages').create({"text": 'A new message'});
117144
145+
// Get the authenticated user
146+
var user = await restClient.user();
118147
```
119148

120-
**You're ready to go: 3, 2, 1 :rocket:**
149+
## Contributing
121150

122-
## Support
151+
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please create a new issue on the [issue tracker](https://github.com/Dahkenangnon/flutter_feathersjs.dart/issues). Pull requests are also appreciated.
123152

124-
Please email to **dah.kenangnon (at) gmail (dot) com** if you have any questions or comments or business support.
153+
Before contributing, please review our [contribution guidelines](CONTRIBUTING.md).
125154

126-
## Contributing
155+
## License
156+
157+
This project is licensed under the [MIT License](LICENSE).
158+
159+
---
127160

128-
Please feel free to contribute to this project by opening an issue or creating a pull request.
161+
If you find FlutterFeathersJs useful, consider giving it a star on [GitHub](https://github.com/Dahkenangnon/flutter_feathersjs.dart) and sharing it with your friends and colleagues. Happy coding!

doc/ff-663x181.png

43.4 KB
Loading

pubspec.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ packages:
55
dependency: transitive
66
description:
77
name: async
8-
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
8+
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
99
url: "https://pub.dev"
1010
source: hosted
11-
version: "2.10.0"
11+
version: "2.11.0"
1212
boolean_selector:
1313
dependency: transitive
1414
description:
@@ -21,10 +21,10 @@ packages:
2121
dependency: transitive
2222
description:
2323
name: characters
24-
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
24+
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
2525
url: "https://pub.dev"
2626
source: hosted
27-
version: "1.2.1"
27+
version: "1.3.0"
2828
clock:
2929
dependency: transitive
3030
description:
@@ -37,10 +37,10 @@ packages:
3737
dependency: transitive
3838
description:
3939
name: collection
40-
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
40+
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
4141
url: "https://pub.dev"
4242
source: hosted
43-
version: "1.17.0"
43+
version: "1.17.1"
4444
dio:
4545
dependency: "direct main"
4646
description:
@@ -103,10 +103,10 @@ packages:
103103
dependency: transitive
104104
description:
105105
name: js
106-
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
106+
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
107107
url: "https://pub.dev"
108108
source: hosted
109-
version: "0.6.5"
109+
version: "0.6.7"
110110
json_bridge:
111111
dependency: "direct main"
112112
description:
@@ -127,10 +127,10 @@ packages:
127127
dependency: transitive
128128
description:
129129
name: matcher
130-
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
130+
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
131131
url: "https://pub.dev"
132132
source: hosted
133-
version: "0.12.13"
133+
version: "0.12.15"
134134
material_color_utilities:
135135
dependency: transitive
136136
description:
@@ -143,18 +143,18 @@ packages:
143143
dependency: transitive
144144
description:
145145
name: meta
146-
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
146+
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
147147
url: "https://pub.dev"
148148
source: hosted
149-
version: "1.8.0"
149+
version: "1.9.1"
150150
path:
151151
dependency: transitive
152152
description:
153153
name: path
154-
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
154+
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
155155
url: "https://pub.dev"
156156
source: hosted
157-
version: "1.8.2"
157+
version: "1.8.3"
158158
path_provider:
159159
dependency: transitive
160160
description:
@@ -292,10 +292,10 @@ packages:
292292
dependency: transitive
293293
description:
294294
name: test_api
295-
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
295+
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
296296
url: "https://pub.dev"
297297
source: hosted
298-
version: "0.4.16"
298+
version: "0.5.1"
299299
typed_data:
300300
dependency: transitive
301301
description:
@@ -329,5 +329,5 @@ packages:
329329
source: hosted
330330
version: "1.0.0"
331331
sdks:
332-
dart: ">=2.18.0 <3.0.0"
332+
dart: ">=3.0.0-0 <4.0.0"
333333
flutter: ">=3.3.0"

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_feathersjs
2-
description: Communicate with your feathers js server from flutter app with unbelieved ease and make happy your customers.
3-
version: 4.1.5
2+
description: Real-Time Flutter Apps, Powered by FeathersJS.
3+
version: 4.1.6
44
homepage: https://github.com/Dahkenangnon/flutter_feathersjs.dart
55
repository: https://github.com/Dahkenangnon/flutter_feathersjs.dart
66
documentation: https://feathersjs.dah-kenangnon.com/

0 commit comments

Comments
 (0)