Aplikasi iOS Statistik Internasional Penyebaran Covid-19 dengan SwiftUI, MVVM Design Pattern, dan REST APIs dari rapidapi.com

Overview

CovStats

CovStats adalah aplikasi iOS Data Statistik Internasional Covid-19 yang datanya didapatkan dari rapidapi.com dengan struktur REST API. Dibuat menggunakan SwiftUI, MVVM Design Pattern, dan REST APIs dari rapidapi.com. Aplikasi ini memiliki fitur Storing Cache Locally, Search, Custom Alert, Responsive Layout Display, Number Formatting, dan Dark Mode Integration.

Preview

Folder & File Structure

CovStats mengikuti pedoman design pattern dengan 3 komponen, yaitu Model, View, & ViewModel (MVVM). Berikut struktur file dan folder pada CovStats:

.
├── CovStatsApp.swift
├── ContentView.swift          # Berisikan Tampilan Halaman Beranda Aplikasi sebagai View Utama
├── Assets.xcassets            # Berisikan Default cardBackground dan App Icon
│
├── API                        # API: API Service (Fetch Data Globally & Locally) dan Store & Save Countries Data Locally
│   ├── LocalFileManager.swift # Berisikan Fungsi (Store & Save, Fetch from Saved, dan Helper) Data Countries
│   └── CovStatsAPI.swift      # Berisikan Fungsi Decode JSON File, Fetch (data, response, & error) via URL Session dengan method GET, & Generate 
│                                Hasil (Total Data, Negara, dan Report)
│
├── Errors                     # Error: Custom Error dan Custom Alert ketika Gagal Fetch API dari Server
│   ├── CustomError.swift      # Berisikan 2 Error Case untuk Incorrect URL dan No Data Received
│   └── AlertItem.swift        # Berisikan Deklarasi Singleton Alert Item dan Macam-macam Alert Context
│
├── Extension                  # Extension: Custom Extension untuk Format Penulisan Angka (Data Kasus)
│   └── Extension+Int.swift    # Berisikan Custom Format Number Decimal & Format Pembulatan Digit Jutaan (ex. "5.1 Juta")
│
├── Models                     # Models: API Data Declaration
│   ├── Regions.swift          # Berisikan Endpoints Data Regions
│   ├── Report.swift           # Berisikan Endpoints Data Report
│   └── TotalData.swift        # Berisikan Endpoints Data TotalData
│
├── ViewModels                          # ViewModel: Fungsi Information Handler (Data Bindings) yang Berkomunikasi Langsung dengan UI di Views
│   ├── CountryDetailViewModel.swift    # Berisikan Fungsi Fetch Report berdasarkan Country (Kode iso)
│   └── MainViewModel.swift             # Berisikan Fungsi Fetch Total Data dan Fetch All Countries
│
└── Views                           # Views: Controller UI & Frontend Related (Show & Get Data from ViewModels)
    ├── CountryDetailView.swift     # Berisikan Tampilan Halaman Provinsi ketika Salah Satu Negara dipilih (jika ada maka ditampilkan)
    ├── DataCardView.swift          # Berisikan Default Card Wrapper untuk Masing-masing Data (TotalDataView)
    ├── SearchBarView.swift         # Berisikan Bar Form untuk Kolom Search
    ├── TotalDataView.swift         # Berisikan Layout 4 DataCardView untuk Tampilan Masing-masing Data Kasus Covid-19
    └── ReportView.swift            # Berisikan Tampilan Halaman Report untuk Negara atau untuk Negara per-bagian Provinsi

Features:

  • MVVM Design Pattern
  • Search
  • Storing Cache Locally
  • Custom Alert
  • Responsive Layout Display
  • Number Formatting
  • Dark Mode Integration

Build With:

Installation

Untuk menggunakan repositori ini, ikutilah petunjuk penggunaan berikut dan pastikan git sudah terinstall pada komputer (semua perintah dilaksanakan pada cmd.exe atau terminal):

  1. Lakukan download .zip atau clone repositori dengan cara:
git clone https://github.com/dekapd99/CovStats.git
  1. Buka project di Xcode dan copy API Key dari rapidapi.com (Pastikan Anda sudah login)
  2. Jika sudah, buka Project Navigation klik API > CovStatsAPI.swift, paste string pada variabel X-RapidAPI-Key (line 21) dengan API Key Anda.
"X-RapidAPI-Key": "copy & paste your api key here", // Replace API Key disini
  1. Build & Run

License

No License

(back to top)

You might also like...
NewsApp - MVVM pattern have been used
NewsApp - MVVM pattern have been used

NewsApp MVVM pattern have been used. All features are working properly as suppose to. Alamofire, Kingfisher, lottie-ios and IQKeyboardManagerSwift pod

demo: REST API with SwiftUI
demo: REST API with SwiftUI

CatAPISwiftUI demo: REST API with SwiftUI The example API is the cat API. https://thecatapi.com/ You can watch me develope this code on my Youtube cha

COVID-19 SwiftUI Demo
COVID-19 SwiftUI Demo

COVID-19_SwiftUI_Demo About COVID-19_SwiftUI_Demo is the coronavirus information application using SwiftUI which is first introduced in WWDC19 keynote

A simple App to Track the status of Covid-19 around the World. Using SwiftUI and GraphQL
A simple App to Track the status of Covid-19 around the World. Using SwiftUI and GraphQL

CovidUI CovidUI is a simple App to Track the status of Covid-19 around the World. This is a simple App I made to track the spread of Covid-19 for me a

iOS 14 widget for stats on COVID -19.
iOS 14 widget for stats on COVID -19.

A Covid-19 Tracking Widget for iOS 14 WidgetKit WidgetKit gives users ready access to content in apps by putting widgets on the iOS Home screen or mac

iOS application to help fight COVID-19

iOS application to help fight COVID-19 This app is aiming at helping fight COVID-19 spread by collecting anonymous data about people meeting each othe

Get notified about available COVID-19 vaccination appointments in Berlin's vaccination centers
Get notified about available COVID-19 vaccination appointments in Berlin's vaccination centers

VaccinationMonitor If you live in Berlin you might know how difficult it is to find an appointment to get a COVID-19 vaccination. This app notifies yo

EU Digital COVID Certificate Kit for the Apple Platform  (unofficial)
EU Digital COVID Certificate Kit for the Apple Platform  (unofficial)

EU Digital COVID Certificate Kit A Swift Package to decode, verify and validate EU Digital COVID Certificates for iOS, tvOS, watchOS and macOS Disclai

Covid 19 Tracing Mobile Application
Covid 19 Tracing Mobile Application

PVAMU-COVID19-APP Covid 19 Tracing Mobile Application This is my Senior Design Project 2021-2022 Mobile applications are the new gateway to have easy

Owner
DK
Improving skills through project everyday
DK
Aplikasi CrypTraces adalah MacOS Widget Crypto Tracker dengan SwiftUI, Combine & Cocoa Framework, dan WebSocket & CoinCap API

Aplikasi CrypTraces adalah MacOS Widget Crypto Tracker dengan SwiftUI, Combine & Cocoa Framework, dan WebSocket & CoinCap API. Aplikasi ini berbentuk Widget di Menu Bar MacOS dengan menampilkan beberapa Crypto Currency seperti Bitcoin (BTC), Ethereum (ETH), Dogecoin (DOGE), Monero (XMR), dan Litecoin (LTC).

DK 6 Aug 1, 2022
Aplikasi iOS Simulasi CRUD Stok Barang dengan SwiftUI, Firebase CLI & Firestore

iStockery Aplikasi iStockery adalah aplikasi stok inventory berbasis iOS yang dibuat menggunakan Firebase (Firestore) secara Local dengan fitur CRUD d

DK 7 Aug 1, 2022
Lentit iOS app developed in Swift with SwiftUI using MVVM design pattern

Lentit Track things you lend with Lentit Features 100% Swift 100% SwiftUI MVVM d

W1W1-M 2 Jun 26, 2022
Mahmoud-Abdelwahab 5 Nov 23, 2022
COVID Certificate is the official app for storing and presenting COVID certificates issued in Switzerland.

COVID Certificate is the official app for storing and presenting COVID certificates issued in Switzerland. The certificates are kept and checked locally on the user's phone.

Swiss Admin 111 Dec 19, 2022
COVID Safe Paths (based on Private Kit) is an open and privacy preserving system to use personal information to battle COVID

COVID Safe Paths is a mobile app for digital contract tracing (DCT) sponsored by Path Check a nonprofit and developed by a growing global community of engineers, designers, and contributors. Safe Paths is based on research originally conducted at the MIT Media Lab.

PathCheck Foundation 470 Nov 6, 2022
ViruSafe aims to help the fight with COVID-19 by offering people to share their symptoms as well track the spread of COVID-19 with an interactive map

ViruSafe aims to help the fight with COVID-19 by offering people to share their symptoms as well track the spread of COVID-19 with an interactive map, that shows how the infection has spread throughout Bulgaria.

scalefocus 16 Feb 9, 2022
News App 📱 built to demonstrate the use of SwiftUI 3 features, Async/Await, CoreData and MVVM architecture pattern.

Box Feed News App ?? built to demonstrate the use of following features, SwiftUI 3 Async/Await AsyncImage List Refreshable Swipe Actions Separator Cor

Sameer Nawaz 113 Dec 20, 2022
Giphy is an open source iOS app based on MVVM (Model–view–viewmodel) software architectural pattern.

Giphy(Search and display gifs) - MVVM Description Giphy is an open source iOS app based on MVVM (Model–view–viewmodel) software architectural pattern.

Tirupati Balan 8 Jun 14, 2022
Implemented MVVM-C (Coordinator) architecture pattern for the project. Which is satisfying SOLID principles altogether. Protocol oriented development has been followed.

BreakingBad BreakingBad API doc Implemented MVVM-C (Coordinator) architecture pattern for the project. Which is satisfying SOLID principples altogethe

Dhruvik Rao 2 Mar 10, 2022