Skip to content

dark-side/sports_hub_ios_skeleton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sports Hub iOS

A starter project for iOS engineers who want to improve their skills according to company processes. This project serves as a learning playground for SwiftUI, navigation patterns, localization, design implementation, and AI-assisted code generation with tools like Cursor, Claude Code, GitHub Copilot, and others.

πŸ“± Overview

Sports Hub is a sports news application built with SwiftUI targeting iOS 26+. It demonstrates modern iOS development practices including:

  • Modern Swift Concurrency with @Observable (Swift 5.9+)
  • Clean Architecture (Domain, Data, Presentation layers)
  • Protocol-oriented design for testability
  • Generic navigation system
  • Environment-based configuration

πŸš€ Getting Started

Prerequisites

  • Xcode 26.0+
  • iOS 26.0+ deployment target
  • Backend server running locally

Backend Setup

Before running the app, you need to set up the backend server. Follow the instructions at:

πŸ‘‰ Sports Hub Launcher

The launcher provides a unified CLI tool to bootstrap the backend services using Podman.

git clone https://github.com/dark-side/sports_hub_launcher.git
cd sports_hub_launcher
chmod +x setup.sh
./setup.sh

Running the App

  1. Clone this repository
  2. Open Sports-Hub.xcodeproj in Xcode
  3. Ensure backend is running at http://127.0.0.1:3002
  4. Build and run (⌘R)

🎨 Design Resources

Resource Link
Figma Prototype Sports Hub General Prototype
Feature Roadmap Mobile Application Features List

πŸ“ Project Structure

Sports-Hub/
β”œβ”€β”€ Source/
β”‚   β”œβ”€β”€ Application/           # App entry point & root navigation
β”‚   β”‚   β”œβ”€β”€ Sports_HubApp.swift
β”‚   β”‚   β”œβ”€β”€ AppFlowModel.swift      # Global app state & navigation
β”‚   β”‚   β”œβ”€β”€ AppRootView.swift
β”‚   β”‚   └── MainAppFlowContentContainerView.swift
β”‚   β”‚
β”‚   β”œβ”€β”€ Common/                # Shared code across features
β”‚   β”‚   β”œβ”€β”€ Articles/
β”‚   β”‚   β”‚   β”œβ”€β”€ Domain/             # Domain models
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Article.swift
β”‚   β”‚   β”‚   β”‚   └── Comment.swift
β”‚   β”‚   β”‚   └── Data/
β”‚   β”‚   β”‚       β”œβ”€β”€ DTO/            # Network response models
β”‚   β”‚   β”‚       β”œβ”€β”€ Repositories/   # Data access layer
β”‚   β”‚   β”‚       └── Services/       # Network services
β”‚   β”‚   β”œβ”€β”€ UserProfile/
β”‚   β”‚   β”‚   β”œβ”€β”€ Domain/
β”‚   β”‚   β”‚   └── Data/
β”‚   β”‚   β”œβ”€β”€ Views/                  # Reusable UI components
β”‚   β”‚   └── NetworkError.swift
β”‚   β”‚
β”‚   β”œβ”€β”€ Features/              # Feature modules
β”‚   β”‚   β”œβ”€β”€ Home/              # Home feed & article details
β”‚   β”‚   β”œβ”€β”€ SideMenu/          # Side navigation menu
β”‚   β”‚   β”œβ”€β”€ UserProfile/       # Login, SignUp, Logout flows
β”‚   β”‚   β”œβ”€β”€ Navigation/        # Navigation models & routes
β”‚   β”‚   β”œβ”€β”€ NBA/               # NBA section (placeholder)
β”‚   β”‚   └── NFL/               # NFL section (placeholder)
β”‚   β”‚
β”‚   └── Utilities/
β”‚       └── AppConfig.swift
β”‚
β”œβ”€β”€ Resources/
β”‚   └── Assets.xcassets/
β”‚
└── Preview Content/           # SwiftUI preview helpers

πŸ—οΈ Architecture

Main Entities

Entity Description
AppFlowModel Global app state manager handling navigation, side menu, user authentication state, and modal presentations
NavigationModel<Route> Generic navigation coordinator for each feature flow (Home, NBA, NFL)
UserProfileManager Manages user authentication state and creates auth-related ViewModels
Article Domain model representing a sports article
User Domain model representing authenticated user

Data Flow

View β†’ ViewModel β†’ Repository β†’ NetworkService β†’ API
                       ↓
                    Mapper
                       ↓
                 Domain Model

Key Patterns

Pattern Implementation
Observation @Observable macro (Swift 5.9+)
Dependency Injection Protocol-based repositories
Navigation NavigationStack with typed routes
State Management Enum-based view states (idle, loading, loaded, error)
Main Actor Isolation Project-level SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor

βœ… Possible Next Tasks

UI Development

  • Develop screens according to Figma prototypes
  • Implement NBA and NFL feature screens
  • Add pull-to-refresh functionality
  • Implement infinite scroll/pagination

Data & Persistence

  • Develop cache system (URLCache, custom disk cache)
  • Add persistence layer (SwiftData, CoreData, or UserDefaults)
  • Implement offline mode support

Localization

  • Add String Catalogs for localization
  • Support English and Ukrainian languages
  • Localize date/number formatters

Architecture Experiments

  • Reimplement using TCA (The Composable Architecture)
  • Reimplement using MV (Model-View) pattern
  • Reimplement using MVVM-C (Coordinator pattern)
  • Extract feature modules into Swift Packages

Testing

  • Add unit tests for ViewModels
  • Add unit tests for Repositories and Mappers
  • Add UI tests for critical user flows
  • Implement snapshot testing

AI-Assisted Development

  • Define Cursor rules (.cursorrules) for code generation context
  • Experiment with Claude Code for feature generation
  • Create custom prompts for consistent code style

πŸ› οΈ Configuration

Build Settings

Setting Value
Deployment Target iOS 26.0
Swift Version 5.0
Default Actor Isolation MainActor
Supported Orientations Portrait only

Environment Variables

Set API_URL environment variable to override the default backend URL:

# Default: http://127.0.0.1:3002
API_URL=http://your-backend-url

πŸ“š Learning Resources


Happy coding! πŸš€

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages