Playground server-client Android app using gRPC and protocol buffers

Overview

gRPC Playground

The goal of this app is to connect to a server, exchange information using the gRPC protocol and lastly retrieve some mocked credentials issued by the server.

The App fulfills the following criteria:

  • A user can create an account by registering to the app using their email, username etc
  • After the user has logged in/registered they can request to retrieve certain credential info from server by tapping on the "Get Credentials" Button in the home screen
  • There is a basic caching mechanism that stores the credentials received from the server for offline use.
  • User can unregister any time. Their stored credentials will be deleted forever.

Tech stack used.

This app features the following technologies and coding practices.

  • gRPC and protocol buffers
  • Proto Datastore for local caching
  • Koin for Dependency Injection
  • Gradle Kotlin DSL scripts
  • Clean architecture principles (domain, data, presentation)
  • Coroutines for asynchronous calls. Suspending functions and Flows
  • A slightly customized MVVM approach. I use ViewModels with StateFlows that emit sealed classes as states. The UI decides what to do based on the state received.
  • Material Components library

Running the App

Simply open the project in Android studio. Do not forget to Modify the ServerConfig.kt file in order to add your own IP and port number to which the server will be running on. After you build the project, launch the app module on Android Studio as usual.

Running the Server

In order to run the server just execute the following gradle task:

./gradlew :server:grpcServer

The above task will first generate the required protocol buffer classes and also run the server all together.

Alternatively you can click the little "Play" icon on the main() function residing in Main.kt file within the server module through Android Studio. This will also run the server as long as the proto classes have been generated upfront.

Future goals and improvements

  • Improve error handling. Provide more meaningful error messages e.g. for network failures
  • Unit tests? Ain't nobody got time for tests.
  • Use some form of encryption to store user's credentials.
  • Refactor some parts and make general improvements to the code base.
  • Migrate to jetpack Compose?
  • And More I guess.

Screenshots

credentialsScreen credentialDetails userProfile

You might also like...
kotlin.runCatching playground with retrofit

runCachingPlayground In this repository I have tried some tricks to handle exceptions in a more kotlin way. I have made http calls with Retrofit2 in d

Playground for Vault Integration

Vault Lab This is playground for spring-booter to test integrating with Vault the Hashi-Corp product. Secret-Engines that are available now: Transit :

A complex of libraries and starters for organizing long-polling-based interaction between the client and the server.

A complex of libraries and starters for organizing long-polling-based interaction between the client and the server.

Common - Packet Definition between Client and Server

CheaTank common A simple game aimed at developing a cheat client and suppressing

HQ OpenAPI Specification and Client & Server SDK Generators

HQ-API HQ OpenAPI Specification and Client & Server SDK Generators Cloning Github Repository Get access to Flocktory team in Github Adding a new SSH k

A server which delivers client configuration settings to an end-user over http.

RuneTopic HTTP Server A server which delivers client configuration settings to an end-user over http. Setup Guide You can host a http server with Dock

KTor-Client---Android - The essence of KTor Client for network calls

KTor Client - Android This project encompasses the essence of KTor Client for ne

🌱 A test implementation of a Minecraft server using RESTful API taking advantage of the interoperability between Kotlin and Java.

🌱 Norin A test implementation of a Minecraft server using RESTful API taking advantage of the interoperability between Kotlin and Java. This project

Mock up social media android application created to interact with a backend Java server using GraphQL.

The Community Board Project Authorship: author: dnglokpor date: may 2022 Project Summary: The Community Board Project consists of a Java Spring Boot b

Owner
Thanos Psaridis
Software Engineer. Kotlin and Java enthusiast.
Thanos Psaridis
Kotlin & Java class for gRPC client

jvm-minter-grpc-class Kotlin & Java class for gRPC client Use @TODO Разное Добавление git subtree add --prefix node-grpc-gateway https://github.com/Mi

Aleksey Kukhnovets 2 May 26, 2022
GRPC client for the Provenance Blockchain

GRPC client for the Provenance Blockchain Tip: Refer to the Cosmos Proto Docs and Provenance Blockchain Proto Docs for client interface definitions. M

Provenance Blockchain, Inc. 5 Dec 6, 2022
Kotlin microservices with REST, and gRPC using BFF pattern. This repository contains backend services. Everything is dockerized and ready to "Go" actually "Kotlin" :-)

Microservices Kotlin gRPC Deployed in EC2, Check it out! This repo contains microservices written in Kotlin with BFF pattern for performing CRUD opera

Oguzhan 18 Apr 21, 2022
Kotlin implementation of WalletConnect v2 protocol for Android applications

WalletConnect V2 - Kotlin Kotlin implementation of WalletConnect v2 protocol for

WalletConnect 92 Jan 6, 2023
Aplicação Micronaut GRPC utilizando Kotlin e arquitetura Hexagonal

micronaut-grpc-demo Aplicação Micronaut GRPC utilizando Kotlin e arquitetura Hexagonal #Baixando e configurando um container Postgres: Postgres: docke

Paulo César de Souza 0 Nov 15, 2021
grpc stream fullstack example(spring+kotlin / next.js + typescript)

grpc-stream-fullstack chat application build with grpc named qhat Prerequisites server sync .proto files on src/main/proto/grpc/qhat/ $ ./gradlew sync

Dave Kwon 5 Nov 14, 2022
Simulate the running route of each player on the playground, and can be timed with a stopwatch

PathView (Simulate the running route of each player on the playground, and can be timed with a stopwatch) Generally speaking, high frequency and dense

Old Driver 5 Jun 11, 2022
Allowing server admins to backdoor their own server!

DiscordBackdoorBot Allowing server admins to backdoor their own server! What does Discord Backdoor Bot do? Discord Backdoor bot allows the bot owner t

Awesomemoder316 1 Jun 8, 2022
Jambeez-server - Jambeez server with kotlin

jambeez-server How to start Start your own server with: docker pull ghcr.io/jamb

null 5 Apr 2, 2022
Playground UI Compose in Desktop Apps

caravan-kotlin-desktop-compose Project Learning Jetpack Compose on Desktop Aplication Request Data Retrofit Version Release This Is Latest Release $ve

Faisal Amir 15 Dec 8, 2022