WhoSings Goal of the game: Choose the artist that sings a specific line of lyrics, winning points for every correct choice

Related tags

Games WhoSings
Overview

WhoSings

Goal of the game:

Choose the artist that sings a specific line of lyrics, winning points for every correct choice.

Installation

To run the project, clone the repo, and run pod install from the root directory first.

pod install

Architecture

WhoSings is based on my personal library RxComposableArchitecture that is inspired by The Composable Architecture.

RxComposableArchitecture is a modern Rx library for building applications in a consistent way, with composition and testing.

Usually developers come to Functional Reactive Programming whith just in mind the idea of "reactive", or that everything is a stream of data. Basically it's true but there is a caveat. In fact we should remember that we are working in functional world, which means that we should keep in mind some principle as: the state immutability and composition.

State immutability is a misleading concept. Obviously the state should mutate, in fact our aim is to transform informations. But we must do it in a consistent way. And this is where comes from the idea of the Composable Architecture.

Every feature is defined by some types and values that model your domain:

  • State: A type that describes the data your feature needs to perform its logic and render its UI.
  • Action: A type that represents all of the actions that can happen in your feature, such as user actions, http requests, access to a DB and more.
  • Environment: A type that holds any dependencies the feature needs, such as API clients, analytics clients, and more.
  • Reducer: A function that describes how to evolve the current state of the app to the next state given an action. The reducer is also responsible for returning any effects that should be run, such as API requests, which can be done by returning an Effect value.
  • Store: The runtime that actually drives your feature. You send all user actions to the store so that the store can run the reducer and effects, and you can observe state changes in the store so that you can update UI.

The benefits of doing this is that you will instantly unlock testability of your feature, and you will be able to break large, complex features into smaller domains that can be glued together.

Every feature is testable in isolation and the power of the Composable Architecture is the ability to glue together two or more features in order to create a brand new one.

For example the gameSessionViewReducer is build on the composition of the user login, bootstrap and the game session session. And even the appReducer is build on the composition of the GameView and the Leaderboard.

This lead to an another concept: the sharing state. In fact, every time a session is completed, the collection of sessions is updated and shared between the single Session and the Leaderboard, please refer to AppState

Engineering for Testability

Environment

A type that holds any dependencies the feature needs, for WhoSigns we have client for Musixmatch API.

Scheme
  • WhoSings: is the live implementation
  • WhoSingsMock : a bunch of different scenarioss for manual testing and development

UI Application

The folder UI Application contains all the Views and ViewControllers and is isolated from the features domain.

Features domain and Business logic

GameView

GameView is the main feature and is composed on three sub-features.

  • Bootstrap: is responsible to fetch properly the APIs. Download a bunch of TopSongs in Italy and for every track fetch the corresponding lyrics. In addition download a list of artists.
  • Game Session: once start is called a new game session is created based on the Bootstrap results.
  • Login: handle a simple login session in local
User Session

Simply contains the game user session completed.

Frameworks

Pod Version
RxSwift 6.0.x
RxCocoa 6.0.x
RxDataSources 4.0.x
SnapKit 4.2.0
Charts

Personal libraries

Pod Version
RxComposableArchitecture 3.0.0

Pods for testing

Pod Version
RxComposableArchitectureTests 3.0.0
SnapshotTesting 1.7.2
RxBlocking
RxTest

Author

Jean Raphaël Bordet, [email protected]

You might also like...
IOS Spin Game - A simple spin game using SwiftUI
IOS Spin Game - A simple spin game using SwiftUI

IOS_Spin_Game A simple spin game using Swift UI.

CardGameEngine - Prototyping a game engine for the Bang card game
CardGameEngine - Prototyping a game engine for the Bang card game

CardGameEngine Prototyping a game engine for the Bang card game. Features Engine is open source Powerful scripting language using JSON Card design is

Swift-WordleSolver - Solve and analyze Wordle games. Command-line tool written in Swift

Swift-WordleSolver - Solve and analyze Wordle games. Command-line tool written in Swift

Imagine Engine - a fast, high performance Swift 2D game engine for Apple's platforms
Imagine Engine - a fast, high performance Swift 2D game engine for Apple's platforms

Welcome to Imagine Engine, an ongoing project that aims to create a fast, high performance Swift 2D game engine for Apple's platforms that is also a j

🖐 Memory game with hand gesture recognition that will keep your brain in a good shape!
🖐 Memory game with hand gesture recognition that will keep your brain in a good shape!

Hands I have always been interested in how I can improve my memory in addition to reading books, and once I came across an interesting technique relat

Lambton College, 2nd Semester Final IOS Project (Star Wars) game
Lambton College, 2nd Semester Final IOS Project (Star Wars) game

The game we developed for our project of the course advanced iOS application is based on a functioning of a real time shooting game, in which initiall

Tic Tac Toe game developed in SwiftUI
Tic Tac Toe game developed in SwiftUI

TicTacToe Tic Tac Toe game developed in SwiftUI Requirements macOS 11.1 Big Sur Xcode 12.3 iOS 14 Getting Started Clone the Repository Royalty free au

A game engine built with SDL and Swift.

Lark A game engine made with Swift and SDL. This is a pre-alpha work-in-progress. Don't try to use this unless you really know what you're doing. I ba

The purpose of the color game is to find the right color without getting distracted. It is as difficult as it is fun.
The purpose of the color game is to find the right color without getting distracted. It is as difficult as it is fun.

Color Game The purpose of the color game is to find the right color without getting distracted. It is as difficult as it is fun. Getting Started Insta

Owner
Jean Raphael
Jean Raphael
BabySortingToyGame - Build a little game for babies to sort shapes in the correct location. This is made in SwiftUI using drag gestures.

This is a demo to build a little mini-game "for babies". It's inspired in this kind of games:

Pedro Rojas 17 Oct 23, 2022
This is a game in which the player has to match cards with the correct pair.

This is a game in which the player has to match cards with the correct pair. When they are paired, a funny record of a Peruvian influencer is played. Made with Swift and SwiftUI.

Augusto Galindo Ali 6 Jun 21, 2022
This is a word scramble game where you get points based on what words you can spell out of a root word.

WordScramble This is a word scramble game where you get points based on what words you can spell out of a root word. This app was part of my SwiftUI c

Alex Diaz 0 Jan 19, 2022
PowerUp is an educational choose-your-own-adventure game that utilizes a users uploaded curriculum to empower pre-adolescents to take charge of their reproductive health.

PowerUp is an educational choose-your-own-adventure game that utilizes a users uploaded curriculum to empower pre-adolescents to take charge of their reproductive health. This is the iOS version of the game.

AnitaB.org Open Source 39 Sep 26, 2022
A command line version of the popular Wordle game, written in Swift

WordleCLI A command line version of the popular game Wordle. For the original game, see: https://www.powerlanguage.co.uk/wordle/ Usage $ swift run Wel

Eneko Alonso 2 Jan 18, 2022
A little arcade game that uses SwiftUI as a game engine.

SwiftUI Game A little arcade game that uses SwiftUI as a game engine :) Just copy the code into the Blank playgroundbook in Swift Playgrounds app on i

Roman Gaditskiy 10 Sep 30, 2022
The one and only open source 4X MMO mid-core strategy game for iOS. Similar to Game of War and Mobile Strike

4X MMO Strategy Game for iOS I have spent 4 years of my life and a significant amount of money into completing this game and I hope you enjoy it. For

shankqr 69 Nov 16, 2022
🦁 🃏 📱 An animal matching puzzle card game– built with turn-based game engine boardgame.io and React-Native + React-Native-Web

Matchimals.fun an animal matching puzzle card game ?? ?? ?? Download for iOS from the App Store ?? Download for Android from the Google Play Store ??

iGravity Studios 137 Nov 24, 2022
Switshot is a game media manager helps you transfer your game media from Nintendo Switch to your phone, and manage your media just few taps.

Switshot is a game media manager helps you transfer your game media from Nintendo Switch to your phone, and manage your media just few taps.

Astrian Zheng 55 Jun 28, 2022
Gravity Switch - A dynamic game that integrates swiping and tapping to create a fun interactive game

GravitySwitch Gravity Switch is a dynamic game that integrates swiping and tappi

null 3 Nov 19, 2022