This is a simple mobile application built using Ionic Framework, Vue 3, and TypeScript, designed to fetch and display cryptocurrency data from the public API:
https://api.coinlore.net/api/tickers/
The app shows a list of cryptocurrencies with information such as rank, name, symbol, and USD price, styled in a clean and mobile-friendly layout. It also includes a Refresh button to update data on demand.
This repository is made for complete the 3rd task of Mobile Device-Based Programming (PPB) from Universitas Terbuka.
| Tool | Desc |
|---|---|
| Ionic 7 | UI framework for mobile apps |
| Vue 3 | Frontend framework |
| TypeScript | Strong typing for safer code |
| Vite | Fast development bundler |
| Capacitor | Native mobile runtime |
| CSS Grid | Clean layout for crypto list |
Clone this repo
git clone https://github.com/mfazahanif/api-crypto-name-ionic-vue.git
cd api-crypto-name-ionic-vueInstall Dependencies
npm installMakesure install ionic on global
npm install -g @ionic/cliRunning project on browser
ionic serveOpen http://localhost:8100/crypto
Running on Emulator
- Build web assets
npm run build- Sync with android
npx cap sync android- Run Emulator
npx @ionic/cli@latest capacitor run android -l –external- Fetch live cryptocurrency data from API (Coinlore)
- Display:
- Rank
- Name
- Symbol
- Price in USD
- Clean UI using Ionic components
- Fully reactive using Vue 3 Composition API
- Ready to run on:
- Browser (ionic serve)
- Android emulator
- Physical Android device
-
Fetching data
The app uses
async/awaitto call the API when the page loads:const fetchCrypto = async () => { const res = await fetch("https://api.coinlore.net/api/tickers/"); cryptos.value = (await res.json()).data; };
-
Reactive state
Vue 3
ref()is used so that UI updates automatically when data changes:const cryptos = ref<Crypto[]>([]); const loading = ref(true);
-
Typescript
The
Cryptointerface defines the structure of API data:interface Crypto { rank: string; name: string; symbol: string; price_usd: string; }
-
Routing
Default
routeredirects to/crypto, necessary for emulator:{ path: "/", redirect: "/crypto", }
This project is open-source and free for learning & experimentation especially if you are a student of Universitas Terbuka.