{"id":42988567,"url":"https://github.com/aitjcize/esp32-photoframe-server","last_synced_at":"2026-01-31T02:33:59.282Z","repository":{"id":334332470,"uuid":"1140981644","full_name":"aitjcize/esp32-photoframe-server","owner":"aitjcize","description":"Image server for https://github.com/aitjcize/esp32-photoframe","archived":false,"fork":false,"pushed_at":"2026-01-24T15:57:01.000Z","size":109,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T16:06:40.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aitjcize.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-24T03:09:29.000Z","updated_at":"2026-01-24T15:53:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aitjcize/esp32-photoframe-server","commit_stats":null,"previous_names":["aitjcize/esp32-photoframe-server"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/aitjcize/esp32-photoframe-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitjcize%2Fesp32-photoframe-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitjcize%2Fesp32-photoframe-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitjcize%2Fesp32-photoframe-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitjcize%2Fesp32-photoframe-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aitjcize","download_url":"https://codeload.github.com/aitjcize/esp32-photoframe-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitjcize%2Fesp32-photoframe-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28927238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T22:32:35.345Z","status":"online","status_checked_at":"2026-01-31T02:00:09.179Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-01-31T02:33:58.773Z","updated_at":"2026-01-31T02:33:59.277Z","avatar_url":"https://github.com/aitjcize.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32 PhotoFrame Server\n\nA middleware server for the [ESP32 PhotoFrame](https://github.com/aitjcize/esp32-photoframe) project. This server acts as a bridge between the E-Ink display and various photo sources (Google Photos, Telegram), handling image processing, resizing, dithering, and overlay generation.\n\n## Features\n\n-   **Multiple Data Sources**:\n    -   **Google Photos**: Uses the Picker API to securely select albums and photos.\n    -   **Synology Photos**: Connect directly to your Synology NAS (supports DSM 7 Personal and Shared spaces).\n    -   **Telegram Bot**: Send photos directly to your frame via a Telegram bot.\n-   **Smart Image Processing**:\n    -   Automatic cropping to device aspect ratio (800x480 or 480x800).\n    -   **Smart Collage**: Automatically combines two landscape photos in portrait mode (or vice versa) to maximize screen usage.\n    -   **Dithering**: Applies Floyd-Steinberg dithering optimized for 7-color E-Ink displays (reusing the same logic as the firmware).\n-   **Overlays**:\n    -   Customizable Date/Time display.\n    -   Real-time Weather status (Temperature + Condition) based on location.\n    -   \"iPhone Lockscreen\" style aesthetics with Inter font and drop shadows.\n-   **Web Interface**:\n    -   Modern Vue 3 + Tailwind CSS dashboard.\n    -   Manage settings: Orientation, Weather location, Collage mode.\n    -   Manage gallery: View and delete imported photos.\n    -   Import photos via Google Photos Picker.\n\n## Deployment (Docker)\n\nThe easiest way to run the server is using Docker.\n\n### 1. Build \u0026 Run locally\n\n```bash\n# Build the image\nmake build\n\n# Run the container\n# -p 9607:9607 : Expose web UI\n# -v $(pwd)/data:/data : Persist database and photos\nmake run\n```\n\n### 2. Manual Docker Run\n\n```bash\ndocker run -d \\\n  -p 9607:9607 \\\n  -v /path/to/data:/data \\\n  --name photoframe-server \\\n  aitjcize/esp32-photoframe-server:latest\n```\n\n### 3. Docker Compose (tested on Synology DSM 7)\nFor use in Container Manager or Portainer. Update the `volume` and `user` sections with values appropriate to your environment.\n```\nname: esp32-photoframe-server\nservices:\n    esp32-photoframe-server:\n        ports:\n            - 9607:9607\n        volumes:\n            - /volume1/docker/esp32-photoframe-server:/data\n        container_name: photoframe-server\n        image: aitjcize/esp32-photoframe-server:latest\n        user: \u003cuid\u003e:\u003cgid\u003e\n```\n\n## Configuration\n\nAccess the dashboard at `http://localhost:9607` (or your server IP).\n\n### Google Photos Setup\n\n\u003e [!IMPORTANT]\n\u003e **Google OAuth Restriction**: Google does not allow `.local` domains or private IP addresses in OAuth redirect URIs. If running on Home Assistant, you must use one of these methods:\n\u003e - **Port Forwarding** (recommended for one-time setup): `ssh -L 9607:localhost:9607 root@homeassistant.local -p 22222`\n\u003e - **Public Domain**: Use a domain name with Cloudflare Tunnel or similar\n\n#### Steps:\n\n1.  **Create OAuth Credentials**:\n    -   Go to [Google Cloud Console](https://console.cloud.google.com/)\n    -   Create a new project or select an existing one\n    -   Enable the **Google Photos Picker API**\n    -   Go to **Credentials** → **Create Credentials** → **OAuth 2.0 Client ID**\n    -   Application type: **Web application**\n    -   **Authorized JavaScript Origins**: `http://localhost:9607`\n    -   **Authorized Redirect URIs**: `http://localhost:9607/api/auth/google/callback`\n    -   Click **Create** and save your Client ID and Client Secret\n\n2.  **Configure the Server**:\n    -   If running on Home Assistant, set up port forwarding first:\n        ```bash\n        ssh -L 9607:localhost:9607 root@homeassistant.local -p 22222\n        ```\n    -   Access the dashboard at `http://localhost:9607`\n    -   Go to **Settings**\n    -   Select **Source: Google Photos**\n    -   Enter your **Client ID** and **Client Secret**\n    -   Click **Save All Settings**\n\n3.  **Authenticate and Import Photos**:\n    -   Go to the **Gallery** tab\n    -   Click **Add Photos**\n    -   You'll be redirected to Google OAuth (sign in if needed)\n    -   Select the photos you want to display\n    -   Click **Add** to import them\n\n4.  **After Setup**:\n    -   The OAuth token is saved in the database\n    -   You can close the SSH tunnel (if used)\n    -   Access the server normally via `http://homeassistant.local:9607` or your regular URL\n    -   Re-authentication is only needed if you revoke access or want to add more photos\n\n### Synology Setup\n1.  Go to **Settings** in the dashboard.\n2.  Enable **Synology Photos**.\n3.  Enter your **NAS URL** (e.g., `https://192.168.1.10:5001`), **Account**, and **Password**.\n4.  If using 2FA, enter the **OTP Code** when testing the connection.\n5.  Select the **Photo Space** (Personal or Shared) and optionally a specific **Album**.\n6.  Click **Sync Now** to import metadata.\n\n### Telegram Setup\n1.  Create a new bot via [@BotFather](https://t.me/botfather) on Telegram.\n2.  Get the **Bot Token**.\n3.  Go to **Settings** in the dashboard.\n4.  Select **Source: Telegram Bot**.\n5.  Enter your Bot Token and save.\n6.  Send a photo to your bot on Telegram. The frame will update to show this photo immediately.\n\n## Photo Frame Configuration\nOnce you've configured a photo source, a box with the correct URL will appear on that tab. It should be in the format\n```\nhttp(s)://\u003chostname/IP address\u003e/image/\u003cintegration\u003e\n```\n1. Copy the URL.\n2. Generate an access token.\n3. Log into the photo frame web app.\n4. Go to the Auto-Rotate tab and paste the URL and the Token in the appropriate boxes.\n5. Click the 'Save Settings' button\n\n## API Endpoints (For ESP32)\n\n-   **`GET /image/google`**: Returns a random image specifically from **Google Photos**.\n-   **`GET /image/synology`**: Returns a random image specifically from **Synology Photos**. \n-   **`GET /image/telegram`**: Returns the last photo sent via **Telegram Bot**.\n\n### Technical Details:\n-   **Output Format**: Processed 7-color PNG, optimized with Floyd-Steinberg dithering.\n-   **Automatic Scaling**: Images are automatically cropped and resized to your frame's dimensions.\n-   **Headers**: \n    -   `X-Thumbnail-URL`: Link to a temporary JPEG thumbnail for fast preview in the firmware if supported.\n\n## Development\n\n### Tech Stack\n-   **Backend**: Go (Golang) + Echo Framework + GORM (SQLite).\n-   **Frontend**: Vue 3 + Vite + Tailwind CSS.\n\n### Commands\n-   `make build`: Build Docker image.\n-   `make run`: Run Docker container.\n-   `make format`: Format Go and Frontend code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitjcize%2Fesp32-photoframe-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faitjcize%2Fesp32-photoframe-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitjcize%2Fesp32-photoframe-server/lists"}