Skip to content

nowjordanhappy/SwiftUICryptoApp

Repository files navigation

CryptoApp

Status GitHub top language GitHub Repo stars GitHub Issues GitHub Pull Requests License

Buy Me A Coffee

CryptoApp (SwiftUI)

This project is following the great and free course SwiftUI Crypto App by @SwiftfulThinking. I can not thank him enought for such a great course.

We are using Core Data, SwiftUI, Combine and others great tools. I added new features covering and using Clean Architecture, Mappers, Localization, SwiftLint and Unit Tests.

Demo Dark Mode Demo Light Mode Full Demo

Table of Contents

Structure

The project has the following structure:

  • utilities
  • extensions
  • services
  • data
    • remote
    • mappers
  • models
  • core
    • components
    • Launch
      • Views
    • Home
      • ViewModels
      • View
    • Detail
      • ViewModels
      • View
    • Settings
      • ViewModels
      • Views
  • Resources
  • JsonResponse

API Reference CoinGecko

Using Free CoinGecko API for this project. The free plan has a limitations:

The rate limit is ~30 calls per minutes and it varies depending on the traffic size.

So sometimes to avoid this and be able to use the preview I stored the JSON response of the API calls so I can test the service calls like a fake response, and then only use the real API call when I build the app.

    URL BASE: https://api.coingecko.com/api/v3/

Get Coins Data

    GET coins/markets?vs_currency=usd&order-market_cap_desc&per_page=100&page=1&sparkline=true&price_change_percentage=24h

Get Coin Detail

    GET coins/{coinId}?localization=false&tickers=false&market_data=false&community_data=false&developer_data=false&sparkline=false

Get Market Data

    GET global
Service JSON Response File
Get Coins Data marketsResponse.json
Get Coin Detail bitcoinDetailResponse.json
Get Coin Detail marketDataResponse.json

If we exceed the rate limite, we can do like this in CoinDetailDataService:

Comment the line with dowlonad function:

// coinDetailsSubscription = networkingManager.download(url: url)

And uncomment the next like using the json file:

 coinDetailsSubscription = networkingManager.readLocalJSON(nameFile: "bitcoinDetailResponse")

New Features

  • Swipe Actions to delete and edit (NEW)

  • Spanish Localization (NEW)

  • SwiftLint (NEW)

  • Unit Tests (NEW)

Tests

  • SparklineDtoMapperTest
  • CoinDtoMapperTest
  • CoinModelTest

XCode

XCode Version 15.4 (15F31d)
macOS 14.5 (23F79)

Author

License

MIT License

Copyright (c) 2024 Jordan R. A.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages