Skip to content

macnoblebk/NotFlix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flix

A SwiftUI iOS app for browsing trending and top-rated movies and TV shows, powered by the TMDB API with YouTube trailer playback, search, and offline downloads via SwiftData.

Features

  • Home - Browse trending and top-rated movies and TV shows with a rotating hero banner
  • Upcoming - View upcoming movie releases
  • Search - Search for movies and TV shows with debounced input and media type toggle
  • Downloads - Save titles locally with SwiftData for offline access, with swipe-to-delete
  • Trailer Playback - Watch YouTube trailers embedded in the title detail view

Screenshots

Home Upcoming Search
Home Upcoming Search

Architecture

  • SwiftUI with tab-based navigation and NavigationStack
  • SwiftData for local persistence of downloaded titles
  • @Observable view models with state-driven UI (notStarted, fetching, success, failed)
  • Concurrent networking using async let for parallel API requests
  • Reusable components - HorizontalListView and VerticalListView used across multiple screens

Project Structure

Flix/
├── FlixApp.swift                 # App entry point with SwiftData container
├── ContentView.swift             # Tab navigation (Home, Upcoming, Search, Downloads)
├── HomeView.swift                # Trending and top-rated content with hero banner
├── UpcomingView.swift            # Upcoming movies list
├── SearchView.swift              # Search with debounce and media type toggle
├── SearchViewModel.swift         # Search state management
├── DownloadView.swift            # Saved titles via SwiftData @Query
├── TitleDetailView.swift         # Title details with YouTube trailer and download
├── HorizontalListView.swift      # Horizontal scrolling poster carousel
├── VerticalListView.swift        # Vertical list with optional swipe-to-delete
├── YoutubePlayer.swift           # WKWebView wrapper for YouTube embeds
├── DataFetcher.swift             # Networking layer for TMDB and YouTube APIs
├── ViewModel.swift               # Shared view model for home, upcoming, and detail views
├── Title.swift                   # SwiftData @Model with Decodable conformance
├── YoutubeSearchResponse.swift   # YouTube API response models
├── Constants.swift               # String constants, URLs, and view modifiers
├── Errors.swift                  # Custom error types for networking and configuration
├── APIConfiguration.swift        # JSON-based API config loader
└── APIConfiguration.json         # API keys and base URLs (git-ignored)

APIs

Setup

  1. Clone the repository
  2. Create a Flix/APIConfiguration.json file with your API keys:
    {
        "tmdbBaseURL": "https://api.themoviedb.org",
        "tmdbAPIKey": "YOUR_TMDB_API_KEY",
        "youtubeBaseURL": "https://www.youtube.com/embed",
        "youtubeAPIKey": "YOUR_YOUTUBE_API_KEY",
        "youtubeSearchURL": "https://www.googleapis.com/youtube/v3/search"
    }
  3. Open Flix.xcodeproj in Xcode
  4. Build and run

Requirements

  • iOS 17+
  • Xcode 16+
  • TMDB API key
  • YouTube Data API v3 key

About

A SwiftUI iOS app for browsing trending and top-rated movies and TV shows powered by the TMDB API, with YouTube trailer playback, search, and offline downloads via SwiftData.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages