{"id":19435909,"url":"https://github.com/ralscha/apod","last_synced_at":"2025-04-24T21:30:42.017Z","repository":{"id":27898960,"uuid":"115504952","full_name":"ralscha/apod","owner":"ralscha","description":"Self hosted Astronomy Picture of the Day viewer","archived":false,"fork":false,"pushed_at":"2025-04-16T23:41:18.000Z","size":1162,"stargazers_count":7,"open_issues_count":12,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T12:24:45.431Z","etag":null,"topics":["ionic4","java","jsoup","kryo","okhttp3","protobuf","spring","spring-boot","xodus"],"latest_commit_sha":null,"homepage":"https://apod.hplar.ch","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ralscha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-27T09:29:59.000Z","updated_at":"2025-03-29T08:34:12.000Z","dependencies_parsed_at":"2023-02-15T20:15:38.972Z","dependency_job_id":"2e5904d1-c70c-4f91-a7b0-60c558053d1d","html_url":"https://github.com/ralscha/apod","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralscha%2Fapod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralscha%2Fapod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralscha%2Fapod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ralscha%2Fapod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ralscha","download_url":"https://codeload.github.com/ralscha/apod/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250712876,"owners_count":21475092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ionic4","java","jsoup","kryo","okhttp3","protobuf","spring","spring-boot","xodus"],"created_at":"2024-11-10T15:08:24.134Z","updated_at":"2025-04-24T21:30:41.710Z","avatar_url":"https://github.com/ralscha.png","language":"Java","readme":"Self hosted [NASA Astronomy Picture of the Day](https://apod.nasa.gov/apod/astropix.html) (APOD) viewer written with Ionic 7 / Angular 17 (`client`) and Java (`server`).\r\n\r\n# https://apod.hplar.ch/\r\n\r\nThis is *not* a PWA. This web app requires a browser with service worker and Cache API implementation.    \r\nCurrently the app only runs on Chrome and Firefox. \r\n\r\n## Technology\r\n\r\n### Server\r\nWritten in Java 17 with Spring / Spring Boot.    \r\nPeriodically polls the [APOD API](https://api.nasa.gov/api.html), stores the information in a [Xodus](https://github.com/JetBrains/xodus) database, downloads the normal and high def image and recompresses them with [jpeg-recompress](https://github.com/danielgtaylor/jpeg-archive) to save bandwidth.      \r\nProvides a Protocol Buffer endpoint (`/apods`) for the clients.\r\n\r\n**Libraries:**\r\n  * [Spring 6](https://projects.spring.io/spring-framework/)\r\n  * [Spring Boot 3](https://projects.spring.io/spring-boot/)\r\n  * [Xodus](https://github.com/JetBrains/xodus)\r\n  * [jsoup](https://jsoup.org/)\r\n  * [OkHttp](http://square.github.io/okhttp/)\r\n  * [protobuf-java](https://github.com/google/protobuf)\r\n  * [kryo](https://github.com/EsotericSoftware/kryo)\r\n\r\n\u003cbr\u003e\r\n\r\n### Client\r\nWritten in [TypeScript](https://www.typescriptlang.org/), CSS, HTML and the [Ionic](https://ionicframework.com/) framework.    \r\nThe app consists of 3 pages:\r\n  * **Home**: Displays a list of images for each APOD entry. Shows detail page when user taps on image.\r\n  * **Detail**: Displays the image and underneath the explanation. Shows full page when user taps on image.\r\n  * **Full**: Displays the high definition image in a scrollable view.\r\n  \r\nApod data is stored in IndexedDB. The application accesses the IndexedDB through [Dexie.js](http://dexie.org/). 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.\r\n\r\n#### Libraries\r\n  * [Ionic](https://ionicframework.com/)\r\n  * [Dexie.js](http://dexie.org/)\r\n  * [ProtoBuf.js](https://github.com/dcodeIO/ProtoBuf.js/)\r\n  * [Workbox](https://developers.google.com/web/tools/workbox/)\r\n  \r\n#### Icon\r\nSource: https://www.shareicon.net/science-stars-education-astronomy-universe-telescope-795293      \r\nVarious sized icons generated with: http://cthedot.de/icongen/\r\n\r\n#### Build tools\r\n  * [bread-compressor-cli](https://github.com/ralscha/bread-compressor-cli): Pre-compresses assets\r\n  * [workbox-cli](https://github.com/googlechrome/workbox): Precache the application resources\r\n  \r\n\r\n## Run locally\r\n\r\n  * Install Node.js    \r\n    https://nodejs.org/en/\r\n\r\n  * Download jpeg-recompress for your operation system    \r\n    https://github.com/imagemin/jpeg-recompress-bin/tree/master/vendor/\r\n\r\n  * Install the Ionic and Angular CLI: \r\n    * `npm install -g ionic@latest`\r\n    * `npm install -g @angular/cli`\r\n\r\n  * Clone the project and install the dependencies\r\n    ```\r\n    git clone https://github.com/ralscha/apod.git\r\n    cd apod/client\r\n    npm install\r\n    ```\r\n\r\n  * Open `server/src/main/resources/application-development.properties` and change the path to the jpeg-recompress binary. \r\n\r\n\r\n  * Visit the NASA Open API page and apply for an API key (it's free)     \r\n    https://api.nasa.gov/index.html#apply-for-an-api-key\r\n\r\n  * Open `server/src/main/resources/application.properties` and enter the API key     \r\n    `app.nasa-api-key=\u003center key here\u003e`\r\n\r\n  * Download some test data. The following command will download the last 10 days.\r\n    ```\r\n    cd apod/server\r\n    ./mvnw spring-boot:run -Dspring.profiles.active=development -Dspring-boot.run.arguments=import10\r\n    ```\r\n\r\n  * Start the server\r\n  ```\r\n  ./mvnw spring-boot:run -Dspring.profiles.active=development\r\n  ```\r\n\r\n  * Start the client\r\n  ```\r\n  cd apod/client\r\n  ionic serve\r\n  ```\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralscha%2Fapod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fralscha%2Fapod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fralscha%2Fapod/lists"}