Android - peer-network/peer_backend GitHub Wiki

๐Ÿค– Android App โ€” Peer Network

This page documents the Android client for Peer Network, built in Kotlin with a modern modular architecture.


๐Ÿ“ฑ Project Overview

  • Built using Jetpack Compose (no XML)
  • Clean modular structure with data, domain, remote, and ui layers
  • Uses Kotlin Coroutines and Flow for reactive state management
  • Connects to the backend GraphQL API (Apollo)
  • Handles authentication, posting, wallet, profile โ€” with more features in development

๐Ÿงฑ Tech Stack

Layer Tech / Tool
Language Kotlin
UI Framework Jetpack Compose
State Management Kotlin Flow + ViewModel
Networking Apollo GraphQL
Token Storage SharedPreferences
Build System Gradle (modular setup)
Architecture Clean Architecture (Modular)

โœ… Implemented Features

  • User authentication (register, login, logout)
  • Profile editing (username, bio, image)
  • Content feed: create, read, comment on posts
  • Follow/block users
  • Wallet screen with balance and activity

๐Ÿšซ Not Yet Implemented

  • โŒ Real-time messaging (chat system not integrated)
  • โŒ Push notifications
  • โŒ Token transfer from wallet
  • โŒ Referral logic on registration

โš™๏ธ Backend Integration

  • All operations use GraphQL via Apollo client
  • Token (JWT) is stored securely in SharedPreferences
  • referralUuid is passed when available during registration
  • GraphQL schema code is generated automatically for type safety

๐Ÿงช Testing

  • Manual testing is currently used for most flows
  • CI test integration with backend is planned
  • Some modules are structured for future unit testing (domain and data layers)

๐Ÿ“ Project Structure

peer_android_frontend/

โ”œโ”€โ”€ app/                    # Main application module (entry point)

โ”œโ”€โ”€ blog/                   # Feature module: blog
โ”‚   โ”œโ”€โ”€ data/               # Repositories, data sources
โ”‚   โ”œโ”€โ”€ domain/             # Use cases, domain models
โ”‚   โ”œโ”€โ”€ remote/             # Remote API handling (Apollo)
โ”‚   โ””โ”€โ”€ ui/                 # UI layer (Composables, ViewModels)

โ”œโ”€โ”€ core/                   # Shared code across all modules
โ”‚   โ”œโ”€โ”€ common/             # Common utilities, base classes
โ”‚   โ”œโ”€โ”€ remote/             # Shared network code
โ”‚   โ””โ”€โ”€ ui/                 # Shared UI components, themes, styles

โ”œโ”€โ”€ media/                  # Media handling (images/videos)
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ””โ”€โ”€ ui/

โ”œโ”€โ”€ persistence/            # Local storage & persistence logic
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ domain/
โ”‚   โ”œโ”€โ”€ local/              # SharedPreferences, etc.

โ”œโ”€โ”€ social/                 # Friends, chat, follow system
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ domain/
โ”‚   โ”œโ”€โ”€ remote/
โ”‚   โ””โ”€โ”€ ui/

โ”œโ”€โ”€ user/                   # Auth, profile, user info
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ domain/
โ”‚   โ”œโ”€โ”€ remote/
โ”‚   โ””โ”€โ”€ ui/

โ”œโ”€โ”€ wallet/                 # Token display & wallet interaction
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ domain/
โ”‚   โ”œโ”€โ”€ remote/
โ”‚   โ””โ”€โ”€ ui/

๐Ÿ““ Related Pages