07 — Product, gRPC, and the development loop

Goal

Understand the app you are building and verify the required tools before writing the shared API.

What you are building

Field Notes is a team task app. The Flutter mobile app calls a Go service. The service stores projects and tasks and pushes changes to connected clients. The system grows in slices: one fetch call, a Flutter screen, create/update/list, database, stream, then security and deployment.

Step 1: Verify your tools

Install Flutter from docs.flutter.dev and run:

flutter --version
flutter doctor

Install protoc using the official protobuf compiler instructions, then check protoc --version. Install the Go code generators:

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

On Windows, ensure $(go env GOPATH)\bin is on PATH. In PowerShell, add it for the current terminal with:

$env:Path += ";$(go env GOPATH)\bin"

Install the Dart generator:

dart pub global activate protoc_plugin

Ensure Pub's global executable directory is on PATH; the location is printed by dart pub global list or your Dart SDK documentation. Restart the terminal after PATH changes. Verify that protoc-gen-go, protoc-gen-go-grpc, and protoc-gen-dart resolve from PATH.

Step 2: Create the Flutter app

From the repository root (field-notes), run:

flutter create flutter_app
cd flutter_app
flutter run

Choose an emulator/device when asked. You should see the starter counter app. Stop it with Ctrl+C. This confirms Flutter works before networking enters the picture.

Step 3: Understand the request path

When the learner taps a task, Flutter calls a generated Dart stub. The stub serializes a protobuf request and sends it over an HTTP/2 gRPC channel. Go's gRPC runtime dispatches the request to a registered handler. The handler calls application logic and returns a protobuf response; Flutter receives it as a Dart object.

Think of gRPC as a typed conversation contract. The .proto file describes the messages and operations; code generators turn that description into language-specific types. The server and client can be written in different languages because both follow the same wire contract. HTTP/2 is the transport underneath, while gRPC adds method names, message framing, status codes, deadlines, metadata, and streaming behavior.

Generated code removes repetitive encoding and networking work, but it does not make an application correct by itself. The Go handler still validates input and enforces access; Flutter still handles loading, failure, and reconnect states. The course keeps those responsibilities visible.

Checkpoint

Write down the output of go version, flutter --version, and protoc --version. Confirm the Dart and Go generator commands are discoverable. Don't move to code generation until all four tools are available.

Troubleshooting

  • protoc-gen-go: program not found: add Go's bin directory to PATH, open a fresh terminal, and retry.
  • protoc-gen-dart: program not found: activate protoc_plugin and add Pub's executable directory to PATH.
  • Flutter can't find a device: open an emulator in Android Studio or connect a physical device and accept its USB debugging prompt.

results matching ""

    No results matching ""