Self hosted NASA Astronomy Picture of the Day (APOD) viewer written with Ionic 8 / Angular 22 (client) and Java (server).
Written in Java 25 with Spring / Spring Boot.
Periodically polls the APOD API, stores the information in a Xodus database, downloads the normal and high def image and recompresses them with jpeg-recompress to save bandwidth.
Provides a Protocol Buffer endpoint (/apods) for the clients.
Libraries:
Written in TypeScript, CSS, HTML and the Ionic framework.
The app consists of 3 pages:
- Home: Displays a list of images for each APOD entry. Shows detail page when user taps on image.
- Detail: Displays the image and underneath the explanation. Shows full page when user taps on image.
- Full: Displays the high definition image in a scrollable view.
Apod data is stored in IndexedDB. The application accesses the IndexedDB through Dexie.js. Visited images are stored by the service worker in the cache. The application assets are also cached, the app therefore runs when offline. In offline mode the applications shows only entries and images that the user visited before and are therefore cached.
Source: https://www.shareicon.net/science-stars-education-astronomy-universe-telescope-795293
Various sized icons generated with: http://cthedot.de/icongen/
- bread-compressor-cli: Pre-compresses assets
- Vite: Builds the custom service worker
- workbox-cli: Precache the application resources
-
Install Node.js https://nodejs.org/en/
-
Install Java 25
-
Download jpeg-recompress for your operation system https://github.com/imagemin/jpeg-recompress-bin/tree/master/vendor/
-
Clone the project and install the dependencies
git clone https://github.com/ralscha/apod.git cd apod/client npm install -
Open
server/src/main/resources/application-development.propertiesand change the path to the jpeg-recompress binary. -
Visit the NASA Open API page and apply for an API key (it's free)
https://api.nasa.gov/index.html#apply-for-an-api-key -
Open
server/src/main/resources/application.propertiesand enter the API key
app.nasa-api-key=<enter key here> -
Download some test data. The following command will download the last 10 days.
cd apod/server ./mvnw spring-boot:run -Dspring.profiles.active=development -Dspring-boot.run.arguments=import10 -
Start the server
./mvnw spring-boot:run -Dspring.profiles.active=development
- Start the client and service worker build watcher
cd apod/client
npm run dev