A simple world clock application that displays the current time in various cities around the world. It uses open-meteo to find city coordinates and Mapbox to display a static map with markers for each city. It uses Kastro to calculate current day/night for each city.
Built with Kotlin Multiplatform + Compose Multiplatform, targeting Android and iOS. See ARCHITECTURE.md for the module layout.
Android:
./gradlew :app-android:assembleDebugiOS (requires XcodeGen):
cd app-ios && xcodegen generate && open WorldClock.xcodeprojTests:
./gradlew :domain:jvmTest :data:jvmTest :ui:testAndroidHostTestBoth app targets need the MAPBOX_ACCESS_TOKEN Gradle property (see below).
Shamelessly uses the awesome design by Omar Faizan, which can be found here and here.
https://geocoding-api.open-meteo.com/v1/search?name=Ber&count=5&language=en&format=json
This returns a JSON response with city information, including latitude, longitude, timezone, and administrative divisions:
{
"results": [
{
"name": "Berlin",
"country": "Germany",
"latitude": 52.52,
"longitude": 13.405,
"timezone": "Europe/Berlin",
"admin1": "State of Berlin",
"admin2": "Berlin, Stadt",
"admin3": "Berlin"
}
]
}World Clock uses Mapbox Static Map API to display a static map with markers for each city.
To use Mapbox, you need to sign up for an account and obtain an access token.
Store your Mapbox Access Token in your environment as described here.
Mapbox Static Map API here:
https://docs.mapbox.com/api/maps/static-images/ https://console.mapbox.com/studio/styles/jesterwrestler/cmcu29qe2006001r47g1k3n4d/edit/#11/40.73/-74
https://github.com/yoxjames/Kastro
- Use GeoKJSON to calculate distance two points in the database
- Add more info to each city:
- Day/Night timeline
- 9am/5pm timeline
- Info for contacts in each city