Skip to content

SONGS-TOOLS/songs-mobile-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Songs Mobile App

A React Native mobile app built with Expo for music discovery, sharing, and earnings tracking. This app takes inspiration from the Farcaster webapp structure in /webApp/src/app/(farcaster)/farcaster/ but is designed as a general music platform.

Architecture Overview

This mobile app replicates the webapp's structure and functionality while adapting it for native mobile interactions. The app includes music discovery, earnings tracking, song shares management, and rankings features.

Key Features

  • Home Feed: Featured songs, new releases, and recent activity
  • Earnings Dashboard: Track earnings, portfolio value, and transaction history
  • SongShares Management: View and manage owned song shares
  • Rankings: Leaderboards and trending content
  • User Authentication: Login system with wallet connection
  • Audio Playback: Native audio player integration (planned)

Project Structure

src/
├── components/           # Reusable UI components
│   ├── forms/           # Form components
│   ├── layout/          # Layout components
│   ├── media/           # Media-related components
│   └── shared/          # Shared utility components
├── contexts/            # React contexts for state management
│   └── AppContext.tsx   # Main app state and user management
├── hooks/               # Custom React hooks
├── navigation/          # Navigation configuration
│   └── BottomTabNavigator.tsx
├── screens/             # Screen components
│   ├── Home/           # Home screen with music feed
│   ├── Earnings/       # Earnings tracking
│   ├── SongShares/     # Song shares management
│   ├── Profile/        # User profile
│   └── Rankings/       # Leaderboards
├── types/              # TypeScript type definitions
├── ui-components/      # Design system components
│   ├── atoms/          # Basic UI elements
│   ├── molecules/      # Composed components
│   ├── organisms/      # Complex components
│   └── Typography.tsx  # Typography system
└── utils/              # Utility functions

Design System

Typography

The app uses a consistent typography system matching the webapp:

  • Headlines: Headline1, Headline2, Headline3, Headline4
  • Body Text: Body1, Body2, Body3
  • Colors: Consistent with webapp color scheme
  • Spacing: Mobile-optimized spacing system

Component Architecture

  • Atoms: Basic elements (buttons, inputs, typography)
  • Molecules: Composed components (cards, form groups)
  • Organisms: Complex components (navigation, forms)

Navigation Structure

The app uses bottom tab navigation matching the webapp routes:

  1. Home (/) - Main feed with featured content
  2. Earnings (/earnings) - Earnings dashboard and transactions
  3. SongShares (/songshares) - Owned song shares management
  4. Rankings (/rankings) - Leaderboards and trending

Screen Mapping

Mobile Screen Webapp Route Description
HomeScreen /farcaster Music feed with featured songs, new releases, recent activity
EarningsScreen /farcaster/earnings Earnings tracking, portfolio value, transaction history
SongSharesScreen /farcaster/songshares Song shares management and portfolio
RankingsScreen /farcaster/rankings Leaderboards and trending content

Context Architecture

AppContext

Primary state management for the entire app:

  • User Management: Authentication, profile data
  • Music Data: Songs, artists, metadata
  • Earnings Data: Portfolio, transactions, earnings
  • UI State: Dark mode, loading states

Key features:

  • Mock data for development
  • Wallet connection management
  • User authentication
  • Data refresh functionality

Development Status

✅ Completed

  • Mobile app navigation structure
  • Typography system implementation
  • Context providers (AppContext)
  • Home screen with featured content sections
  • Component cards (FeaturedSongCard, SongCard, ActivityItem)
  • Mock data infrastructure
  • Bottom tab navigation
  • Documentation

🔄 In Progress

  • Real API integration
  • User authentication system
  • Wallet connection functionality

📋 Planned

  • Audio player integration using Expo AV
  • Enhanced Earnings, SongShares, and Rankings screens
  • Real-time data updates
  • Push notifications
  • Offline support

Getting Started

Prerequisites

  • Node.js v20.15.0 (specified in .nvmrc)
  • nvm (Node Version Manager) - recommended for version management
  • Expo CLI (npm install -g @expo/cli)
  • iOS Simulator or Android Emulator

Quick Start (Recommended)

  1. Navigate to the mobile app directory:
cd mobileApp
  1. Use the automated setup script:
# This will automatically:
# - Load correct Node.js version from .nvmrc
# - Configure environment variables
# - Install dependencies  
# - Start the development server
./start.sh

Manual Setup

  1. Configure Node.js version:
# Use nvm to load the correct version
nvm use

# If version not installed, install it first
nvm install v20.15.0
nvm use v20.15.0
  1. Configure environment:
# Run environment setup
npm run setup
  1. Install dependencies:
npm install --legacy-peer-deps
  1. Start the development server:
npm start
# OR use the enhanced script
npm run dev

Available Scripts

  • npm run dev - Start with automated environment setup
  • npm run start:nvm - Start using nvm with .nvmrc
  • npm run setup - Configure environment variables
  • npm start - Standard Expo start
  • npm run android - Start for Android
  • npm run ios - Start for iOS
  • npm run web - Start web version

Running on Device/Simulator

Once the server is running:

  • Press i for iOS Simulator
  • Press a for Android Emulator
  • Press w for web version
  • Scan QR code with Expo Go app for physical device

Tech Stack

  • Framework: Expo React Native
  • Language: TypeScript
  • Navigation: React Navigation v6
  • State Management: React Context + React Query
  • Styling: StyleSheet (React Native)
  • Images: Expo Image
  • Icons: Expo Vector Icons
  • HTTP Client: TanStack Query (React Query)

Integration Points

API Integration

The app is designed to integrate with the existing backend:

  • User authentication endpoints
  • Music metadata APIs
  • Earnings and transaction APIs
  • Real-time updates via WebSocket

Wallet Integration

Planned wallet connection using:

  • WalletConnect for mobile wallets
  • Ethereum/blockchain integration
  • Transaction signing and management

Audio Integration

Planned audio playback using:

  • Expo AV for audio playback
  • Background audio support
  • Playback controls and queue management

Contributing

  1. Follow the existing code style and structure
  2. Use TypeScript for all new code
  3. Follow the component architecture (atoms/molecules/organisms)
  4. Update tests and documentation for new features
  5. Use the existing design system components

File Organization

  • Keep components small and focused
  • Use descriptive file names
  • Group related files in directories
  • Export components from index files where appropriate
  • Use TypeScript interfaces for all props and data structures

About

Mobile application for SONGS Protocol - React Native app for music fans to discover, collect, and trade song shares

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors