Independent Submission
Implementation Report: 2610-2.4
Category: Experimental
I. S. Hudzaifah
Bandung, Indonesia
2025

← Section 2, Implementations

Implementation Report: gokop

Abstract

A cooperative ride-hailing platform for Bandung, with rides, parcel delivery and transit. It runs on event-driven Go microservices over Kafka and MongoDB, with two Flutter apps and self-hosted maps.

See Tech Stack and Architecture.

Status of This Implementation

This is an experimental implementation. It may change or break without notice.

Tech Stack

Backend12 Go microservices, gRPC between services
EdgeREST (chi) and WebSockets in a gateway service
EventsKafka, Avro, Confluent Schema Registry
DatabaseMongoDB replica set, 2dsphere geo indexes
Payments dataPostgreSQL with PostGIS
Cache and fan-outRedis pub/sub
Rider and driver appsFlutter (BLoC)
Admin portalRemix, Tailwind
Landing pageReact, Express, Drizzle
MapsValhalla routing, Nominatim geocoding, Tegola tiles from OSM, MapLibre
TransitGTFS, OpenTripPlanner, a GTFS builder
PaymentsXendit e-wallets
Calls and pushLiveKit, Firebase Cloud Messaging
InfrastructureGCP, Terraform, GKE Autopilot, Docker Compose, Traefik
CI/CDCloud Build, Artifact Registry
ObservabilityOpenTelemetry, Prometheus, Grafana, Loki, Jaeger

1. Overview

gokop is a ride-hailing platform run as a cooperative. Drivers keep 100% of their fares, riders pay a monthly membership, and a share of the profits goes back to active members every quarter. It covers car and bike rides, parcel delivery and public transit, starting in Bandung.

gokop rider app

Figure 1: The rider app. Booking a ride on the map with car and bike prices, transit options that mix Gokop Ride with buses and angkot, and promos.

It is an early-stage startup project. Over about nine months it grew to seven repositories: two mobile apps, a Go backend, an admin portal, a landing page, infrastructure, and a tool for building transit feeds. That added up to more than 2,500 commits.

gokop cooperative features

Figure 2: The cooperative side. A driver’s wallet with cooperative earnings, and the proposal board where members vote on what the cooperative does next.

2. Architecture

The backend is a Go monorepo of twelve services: gateway, auth, user, driver, ride, payment, notification, call, shipment, maps, admin and transit routing. They share about 126 gRPC calls defined in Protobuf. Mobile apps talk only to the gateway, over REST and WebSockets. Behind it, services call each other over gRPC and react to each other through Kafka.

A ride request shows how the pieces fit:

1. rider app ──REST──▶ gateway ──gRPC──▶ ride
2. ride ──Kafka: ride.requested──▶ driver
3. driver ──$nearSphere──▶ MongoDB   (nearest online drivers)
4. driver ──pub/sub──▶ gateway ──WebSocket──▶ driver app
5. driver app accepts ──Kafka: driver.accepted──▶ ride
6. ride ──gRPC stream──▶ gateway ──WebSocket──▶ rider app

The driver service widens its search radius if nobody nearby accepts, up to three attempts. Payment is authorized through Xendit before the ride request goes out, so a driver is only offered rides that are already paid for.

Live location works as a stream. The driver app sends GPS positions over a WebSocket, even when the app is in the background. The gateway forwards them to the driver service on a two-way gRPC stream. The driver service stores them in MongoDB with a geospatial index and publishes them to Kafka as Avro. Riders see the car move through a ride-event stream that the gateway pushes back out over their own WebSocket.

3. Events and Data

Kafka carries about 40 topics across rides (ride.requested, ride.completed, …), drivers (driver.locations, driver.accepted, …), parcels (shipment.pickup.completed, …), users and maps. Messages are Avro, with schemas held in the Confluent Schema Registry, so a producer cannot quietly break its consumers.

MongoDB, as a replica set, is the main store, with one set of collections per service. Driver positions use 2dsphere indexes for “nearest driver” queries. PostgreSQL with PostGIS holds payment records, OpenStreetMap data for map tiles, and transit data. Redis handles caching and the per-user pub/sub channels that fan offers and updates out to connected apps.

4. Maps and Transit

Instead of paying for a maps API on every request, the platform runs its own map stack built on OpenStreetMap data for Java. Valhalla handles routing and travel times, Nominatim handles geocoding, and Tegola serves vector tiles from PostGIS with incremental updates. The apps draw everything with MapLibre.

For transit, a separate GTFS builder lets a person draw routes, stops and timetables on a map and export a valid GTFS feed. The first feed was Bandung’s Metro Jabar Trans BRT corridor 2, with 31 stops and 20 trips. That feed, together with OpenStreetMap, builds an OpenTripPlanner graph for journeys that combine rides and transit.

5. Infrastructure and Operations

Everything runs on Google Cloud in the Jakarta region. Cloud Build builds the ten service images in parallel into Artifact Registry. The backend runs as containers behind Traefik with automatic TLS. Terraform manages the public landing page on GKE Autopilot: a deployment, ingress, managed certificate and a CPU-based autoscaler.

Observability was part of the design from the start. Every service sends OpenTelemetry traces to Jaeger, logs go to Loki, and metrics go to Prometheus. Grafana has ten dashboards, from WebSocket health to business KPIs. The monitoring plan is built around written targets: a ride request should answer within 1 second at p99, payment authorization within 3 seconds, and driver matching within 90 seconds at p95.

HudzaifahExperimental[Page 1]