Skip to content

Simple Flutter Chat application for all supported platforms with gRPC and ProtocolBuffers includes server service.

License

Notifications You must be signed in to change notification settings

santiihoyos/gRPC_Chat_flutter

Repository files navigation

gRPC+ProtocolBuffers Chat by Flutter

gRPC Chat laboratory. It allows chat from each supported flutter platform: Linux, macOS, Windows, Android, iOS and Web by using gRPC and ProtocolBuffers also backend grpc microservice is written in Dart Lang. Generated Dart model files are shared with flutter app and micro-service from model package.

Native implementations

There are 2 native(Kotlin and Swift) alternatives to flutter Android and iOS builds:

gRPC_Chat_android

gRPC_Chat_iOS

Running dart microservice

cd server
dart pub get                          #use -upgrade- instead to run with latest dependencies version.  
dart run bin/main.dart localhost 8888 #Runs on localhost:8888

Run Flutter app

flutter pub get  #use -upgrade- instead to run with latest dependencies version.
flutter run      #It will ask you for platform choise.

Run Envoy L7 proxy to support gRPC on Web

To support gRPC on web we use Envoy proxy. It "convert/translate" gRPC calls to web-http2 calls from XHR. Note that it is only necessary for web.

FlutterWebApp --port_9000--> envoy proxy --port_8888--> gRPC service

FlutterNoWebApp --port_8888--> gRPC service

Installing on macOS.

brew update
brew install envoy

Note: To install it on another SO see offcial doc about it

Running

#Edit that yaml file if you use different port (default: 8888).
envoy --config-path server/setup/envoy/service_envoy.yaml

Developing

Generate Dart code from proto files

Installation guide

protoc -I. --dart_out=grpc:model/lib/data/generated/protos/ model/protos/chat.proto

About

Simple Flutter Chat application for all supported platforms with gRPC and ProtocolBuffers includes server service.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published