Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit b70f795

Browse files
Askless was redesigned and is even better! So you can build your App and backend like a pro!
- Several bug fixes - A new way of building real-time Apps - Askless now allows you to elevate your App by adding video and audio calls to your Flutter App!
1 parent 7954e48 commit b70f795

File tree

66 files changed

+3459
-3761
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3459
-3761
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Rodrigo João Bertotti <rodrigo@wisetap.dev>
3+
Copyright (c) 2023 Rodrigo João Bertotti <rodrigo@wisetap.com>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 29 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,61 @@
1-
# Askless - server
1+
# Askless: **A coherent Node.js Backend for Flutter**
22

3-
:checkered_flag: [Português (Portuguese)](README_PORTUGUES.md)
3+
A framework to build websocket servers for Flutter Apps that lets you update your widgets in realtime by streaming data changes with WebSockets. Create your Flutter App without Firebase, with PostgreSQL, MySQL, or any database you want, handle WebSocket authentication, and quickly add audio and video calls with WebRTC!
44

5-
Framework that facilitates building servers for JavaScript and Flutter Apps
6-
allowing to:
5+
This is the server side in Node.js,
6+
**[click here to access the Askless Flutter Client](https://github.com/RodrigoBertotti/askless-flutter-client)**
77

8-
- :handshake: perform a websocket connection to exchange data that:
8+
## Built with Askless
99

10-
- :vibration_mode: supports streams on the client side in Flutter
10+
[//]: # (TODO VIDEO)
1111

12-
- :computer: supports JavaScript clients: Web and Node.js
13-
14-
- :arrow_right_hook: it retries to send data automatically in case of connectivity issues between the client and the server
15-
16-
- :label: handles multiples and identical `listen` requests from a client as a single one in the server
17-
18-
- :pencil2: create your own CRUD operations with any database you like (**C**reate, **R**ead, **U**pdate and **D**elete)
19-
20-
- :no_entry: restrict client access to CRUD operations
21-
22-
- :mega: notify in real-time clients who are listening for changes in a route, you can choose:
23-
24-
- :no_pedestrians: only specify clients will receive the data
25-
26-
- :heavy_check_mark: all clients will receive the data
27-
28-
- :lock: accept and deny connection attempts
29-
30-
This is the server side in Node.js, check also the
31-
[Flutter client](https://github.com/WiseTap/askless-flutter-client)
32-
or if you prefer the [JavaScript client](https://github.com/WiseTap/askless-js-client).
12+
## Important links
13+
* [Askless Backend in Node.js](https://github.com/RodrigoBertotti/askless) the backend side of this Flutter client
14+
* [Documentation](documentation.md)
15+
* [Askless Flutter Client](https://github.com/RodrigoBertotti/askless-flutter-client)
3316

17+
#### Examples
18+
* <sup>Level: :red_circle: :white_circle: :white_circle: :white_circle: :white_circle: </sup> [Flutter Random Numbers Example](example/chat): Random numbers are generated on the server.
19+
* <sup>Level: :red_circle: :red_circle: :white_circle: :white_circle: :white_circle: </sup> [Flutter Simple Chat Example](example/chat): Simple chat between the colors blue and green.
20+
* <sup>Level: :red_circle: :red_circle: :red_circle: :white_circle: :white_circle: </sup> [Flutter Catalog Example](example/catalog): Users adding and removing products from a catalog.
21+
* <sup>Level: :red_circle: :red_circle: :red_circle: :red_circle: :red_circle: </sup> [Flutter Chat App with MySQL or PostgreSQL + video and audio calls](https://github.com/RodrigoBertotti/flutter_chat_app_with_nodejs): A Flutter Chat App with MySQL, WebSockets, and Node.js, supports live video and audio calls streaming with WebRTC in Flutter
3422

35-
## Important links
36-
* [Server documentation](documentation/english_documentation.md)
37-
* [Getting Started (Flutter client)](https://github.com/WiseTap/askless-flutter-client/blob/master/README.md)
38-
* [Getting Started (JavaScript client)](https://github.com/WiseTap/askless-js-client/blob/master/README.md)
39-
* [chat (example)](example/chat-js): Chat between the colors blue and green.
40-
* [catalog (example)](example/catalog-ts)
23+
[//]: # (TODO ABAIXO)
24+
* [**Advanced Chat Example**](example/simple-chat-ts): A beaultiful Chat App with receiving & typing events + local storage + register & login.
4125

4226
## Getting Started
4327

44-
1 - Install
28+
1 - Install Askless
4529

4630
npm install --save askless
4731

4832
2 - Import the package
4933

50-
const askless = require("askless");
34+
import { AsklessServer } from "askless";
5135

5236
3 - Create and init the server
5337

54-
const server = new askless.AsklessServer();
55-
56-
server.init({
57-
projectName: 'tracking-ts',
58-
wsOptions : {
59-
port : 3000
60-
}
61-
});
38+
const server = new AsklessServer();
6239

63-
4 - Set the `routes` where the client will
64-
listen realtime data.
65-
The example data that the client will listen is `trackingStatus`.
66-
67-
let trackingStatus = '';
68-
69-
server.addReadRoute({
70-
route: 'product/tracking',
71-
read: async (context) => {
72-
context.respondSuccess({
73-
output: trackingStatus
74-
});
75-
},
76-
});
77-
78-
5 - Set the `routes` where the client will
79-
create, remove and update data.
80-
Call `server.notifyClients(...)` when the data changes.
81-
82-
let customerSaidCounter = 0;
83-
server.addCreateRoute({
84-
route: 'product/customerSaid',
85-
create: (async (context) => {
86-
87-
customerSaidCounter++;
88-
trackingStatus = 'Customer said: "'+context.body + '" '+ (customerSaidCounter) + " times";
89-
90-
server.notifyClients('product/tracking', {
91-
output: trackingStatus
92-
});
93-
94-
context.respondSuccess();
95-
}),
40+
server.init({
41+
wsOptions: { port : 3000 }
9642
});
9743

98-
6 - Start the server
99-
100-
server.start();
101-
102-
7 - Simulating changes of `trackingStatus` in the server
44+
4 - Check the **[documentation](documentation.md)** and create your server first App with Askless, you can also check the **[examples](#important-links)**.
10345

104-
let kmRemaining = 101;
105-
const kmRemainingTask = setInterval(() => {
106-
if(kmRemaining == 0){
107-
return clearInterval(kmRemainingTask);
108-
}
46+
5 - Start the server
10947

110-
kmRemaining--;
111-
trackingStatus = 'Product is '+kmRemaining+' km from you';
112-
113-
server.notifyClients('product/tracking', {
114-
output: trackingStatus
115-
});
116-
}, 3 * 1000);
48+
server.start();
11749

118-
8 - Discover your server url on your local network:
50+
6 - Discover your server url on your local network:
11951

12052
console.log(server.localUrl)
12153

12254
Run the server, it will print something like: `ws://192.168.?.?:3000`
12355

124-
9 - Configure the [client side in Flutter.](https://github.com/WiseTap/askless-flutter-client)
125-
12656
## Issues
12757

128-
Feel free to open a issue about:
58+
Feel free to open an issue about:
12959

13060
- :grey_question: questions
13161

@@ -139,4 +69,6 @@ Feel free to open a issue about:
13969

14070
[MIT](LICENSE)
14171

72+
## Contacting me
14273

74+

README_PORTUGUES.md

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)