This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename `lib/model` -> `lib/models` and `networking/apis` -> `networking/api` * Update error handling to work with gRPC codes * Setup proto dir structure * Implement grpc_handler.dart * Add (de-)serialization from/to proto * Implement `fetchUser()` gRPC method in `user_handler.dart` and update `user_viewmodel.dart` * Add doc * Fix args & linting in model_generator.dart * Update dependencies * Update README.md * Update `routes.dart` to automatically configure root url * Update doc * Add `setup_grpc.sh`
- Loading branch information
1 parent
f4c4a60
commit 7b0b295
Showing
41 changed files
with
3,395 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Information | ||
The `api` directory contains handlers like `api_handler.dart`, `auth_handler.dart`, and `user_handler.dart` which are responsible for handling API calls related to different functionalities of the application. The `gocast` and `google` directories contain protobuf files generated from the `.proto` files which are used for serializing structured data. | ||
|
||
The `api/gocast` directory contains protobuf files for the GoCast API, and the `api/google` directory contains protobuf files for Google's well-known types. These protobuf files are used by the `grpc_handler.dart` to make API calls._ | ||
|
||
|
||
> __NOTE__: _Currently using HTTP for the login, but ideally all other endpoints are called using gRPC. To get an idea how this looks like and what the endpoint definitions are check out our ***[Postman Collection](https://documenter.getpostman.com/view/31343920/2s9YeBdszX)*** and out current ***[protofile](https://github.com/TUM-Dev/gocast/blob/IPraktikum-dev/api_v2/api_v2.proto)***._ | ||
# Setup | ||
|
||
To setup the protobuf files, follow the steps below: | ||
|
||
Make sure to have protoc installed: | ||
|
||
``` | ||
brew install grpc protobuf | ||
``` | ||
|
||
``` | ||
dart pub global activate protoc_plugin | ||
export PATH="$PATH:$HOME/.pub-cache/bin" | ||
curl -o proto/gocast/api_v2.proto https://raw.githubusercontent.com/TUM-Dev/gocast/IPraktikum-36-user-endpoints/api_v2/api_v2.proto | ||
protoc --dart_out=grpc:lib/base/networking/api -I./proto google/protobuf/timestamp.proto google/protobuf/empty.proto proto/gocast/api_v2.proto | ||
``` | ||
|
||
> __Source__: https://github.com/TUM-Dev/Campus-Flutter#updating-the-proto-files-of-the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.