Back to projects
webaimobiledata 2026

Photo(n) Cross-Platform Photo Platform

A cross-platform photo system case study spanning a Bun/Hono API, Next.js web interface, SwiftUI iOS app, Kotlin Android app, realtime infrastructure, AI photo analysis, moderation workflows, private messaging, and production-readiness design.

Open Photo(n)
Technical focus
Cross-platform API, web, mobile, realtime, and AI workflow perspective
Year
2026
Stack
Bun, Hono, PostgreSQL, Prisma, Redis, BullMQ, Next.js 15, React 19, SwiftUI, Kotlin, WebSockets, Gemini, Mistral, S3

Architecture

Cross-platform photo system architecture

The product is shaped around one backend API and realtime layer shared by web, iOS, and Android clients, with media processing, AI jobs, realtime fan-out, and operations state separated behind the API boundary.

  1. Stage 1

    Client applications

    Three product surfaces consume the same API and realtime event contract.

    • Next.js web app

      • Next.js
      • React
      • PWA
    • SwiftUI iOS app

      • SwiftUI
      • URLSession
      • WebSocket
    • Kotlin Android app

      • Kotlin
      • Retrofit
      • Coil
    Technical details
    Next.js web app
    Public pages, protected feed and upload flows, photo detail, messaging, settings, moderation history, and operations-facing dashboards.
    SwiftUI iOS app
    Feature-based native client with URLSession networking, API extensions, upload flows, push, private messaging, and typed realtime event handling.
    Kotlin Android app
    Repository-oriented Android client using the unified API for feed, upload, messaging, notifications, AI insight, moderation, and account flows.
  2. Stage 2

    Backend API and realtime layer

    Bun services own the product API and live event boundary instead of splitting web and mobile behavior.

    • Bun and Hono API

      • Bun
      • Hono
      • JWT
    • Realtime service

      • WebSockets
      • Redis pub/sub
    Technical details
    Bun and Hono API
    Routes cover authentication, media, feed, users, messaging, tags, moderation, geocoding, events, statistics, search, and version compatibility.
    Realtime service
    Channel authentication, subscriptions, reconnect behavior, deduplication, recent-event replay, and multi-instance fan-out.
  3. Stage 3

    Processing services

    Expensive and slow work is kept out of request-time paths where practical.

    • Media and AI pipeline

      • Sharp
      • Gemini
      • Mistral
    • Worker process

      • BullMQ
      • Cron
      • Bun worker
    Technical details
    Media and AI pipeline
    Upload validation, EXIF extraction, Sharp variants, privacy-safe location labels, AI analysis, translations, and photo AI chat support.
    Worker process
    BullMQ AI jobs, account deletion lifecycle tasks, missing geocoding repair, migration helpers, and scheduled operational work.
  4. Stage 4

    State and infrastructure

    Storage, cache, queue, and search concerns are separated from client-specific code.

    • PostgreSQL and Prisma

      • PostgreSQL
      • Prisma
    • Redis, media storage, and search

      • Redis
      • S3
      • Typesense
    Technical details
    PostgreSQL and Prisma
    Relational model for users, photos, social graph, events, private messaging, moderation, AI usage, notifications, and account-data flows.
    Redis, media storage, and search
    Redis supports cache, queues, pub/sub, and realtime scaling; S3-compatible storage keeps optimized media variants; search indexing supports discovery.

Key flows

  1. Web, iOS, Android to Bun and Hono API

    Clients use the same authenticated REST contract for feed, uploads, messaging, moderation, events, statistics, and account controls.

  2. Web, iOS, Android to Realtime service

    Client channels receive feed updates, AI progress, notifications, private messages, typing state, moderation events, and replayed events.

  3. Bun and Hono API to Worker process

    Photo uploads and lifecycle actions enqueue AI, geocoding, deletion, backfill, and operational tasks.

  4. Processing services to State and infrastructure

    Workers and routes persist relational state, optimized media variants, cache entries, search documents, and event fan-out data.

Outcomes

Impact

  • Structured four coordinated application surfaces: a Bun API and worker system, a Next.js web interface, a native iOS app, and a native Android app.
  • Implemented social photo workflows with uploads, privacy-aware location handling, AI image analysis, realtime feed updates, comments, reactions, bookmarks, private messaging, notifications, moderation, statistics, events, and account-data flows.
  • Documented operational architecture for data storage, media storage, background jobs, realtime fan-out, operations-facing observability, release readiness, and cross-platform client compatibility without exposing private implementation details.

Photo(n) is a cross-platform social photo and insight platform. This case study describes four coordinated technical surfaces sharing one backend API and realtime layer: a Bun API, a Next.js web application, a SwiftUI iOS app, and a Kotlin Android app.

The hard part of the project is not a single screen or feature. The work is keeping product behavior consistent across web, iOS, and Android while the backend handles photo storage, AI processing, realtime events, moderation, privacy, analytics, and operational readiness.

System Shape

The Photo(n) workspace is organized as four application surfaces:

  • a Bun and Hono backend API with worker and realtime responsibilities
  • a Next.js web app with public pages, protected user flows, and operations-facing tools
  • a native SwiftUI iOS app with networking, feature modules, realtime events, upload support, notifications, private messaging, and account controls
  • a native Kotlin Android app with repository boundaries, material UI, image loading, notifications, and XML-based screens

Each client talks to the same backend API, with platform-aware compatibility behavior kept behind the API boundary.

Bun API and Data Model

The backend is built on Bun, Hono, PostgreSQL, and Prisma. The data model covers social graph behavior, photos, reactions, bookmarks, notifications, events, invitations, AI processing jobs, private messaging, moderation, feedback, analytics, geocoding, and account-data flows.

The API is split into modules for authentication, media, feed behavior, users, notifications, messaging, tags, feedback, geocoding, operations, statistics, search, translations, events, stories, and worker communication. The public page avoids exact internal path names and private operational internals.

Important backend responsibilities include:

  • unified authentication for web and mobile clients
  • invitation-aware registration flows
  • API versioning and legacy compatibility behavior
  • PostgreSQL data modeling with Prisma migrations
  • S3-compatible or local storage abstraction
  • image upload validation and Sharp processing
  • EXIF extraction, confirmed location handling, reverse geocoding, and privacy-safe display labels
  • hashtag extraction and tag normalization
  • feed, following feed, bookmarks, trending tags, and impact search
  • moderation systems for photos, comments, appeals, and operational decisions
  • account data export and deletion flows

Image and AI Pipeline

Uploads are not treated as a plain file transfer. The backend validates real image signatures for JPEG, PNG, and WebP, extracts metadata, auto-rotates images, handles transparency, and generates optimized variants with Sharp.

The variant pipeline creates internal, thumbnail, and medium outputs. The internal version is optimized for AI processing, the thumbnail is used for grids and previews, and the medium asset is reused as the normal display variant to reduce upload and storage cost.

AI analysis is handled asynchronously. The API creates AI jobs, background workers process them, results are pushed back through realtime and search paths, and operational visibility is available without exposing internal job details or provider-specific configuration.

The platform also supports photo AI chat, translations, and AI insight display, so users can ask questions about generated photo descriptions and inspect the result from web or mobile clients.

Realtime System

Photo(n) uses a channel-based WebSocket architecture with Bun native WebSockets. Authentication, subscription, reconnect, and deduplication behavior are handled behind the realtime client/server boundary.

Realtime work includes:

  • feed and photo-specific realtime updates
  • user-scoped notification and private fan-out behavior
  • conversation and typing updates
  • schema validation and deduplication across clients
  • reconnect behavior with channel restore and backoff
  • multi-instance fan-out and recent-event replay

That infrastructure powers photo uploads, AI progress, feed changes, comments, reactions, moderation events, notifications, chat messages, typing indicators, follow events, and event-system updates.

Web and Operations App

The Next.js web app is more than a marketing surface. It includes protected product flows for feed, following feed, bookmarks, upload, photo detail, profiles, settings, notifications, moderation history, trends, search, statistics, feedback, chat, support, and public blog content.

The upload flow handles client-side validation, metadata handling, manual location fallback, AI consent, upload progress, and AI status display. The web app also includes a PWA manifest, installable app metadata, availability-state behavior, response-header hardening, and remote image configuration.

The operations dashboard is a real operational interface. The public description keeps it high-level and avoids private access-control, internal path, and queue details. It covers:

  • user and invitation management
  • photo, comment, and user report queues
  • moderation decisions and appeal handling
  • event review, event cities, and relevancy rules
  • AI usage and failure visibility
  • cache, realtime, and worker health signals
  • blog analytics for public content

This gives the system operations tooling instead of leaving production operation to database queries and log inspection.

Private Messaging

Photo(n) includes private messaging across web, iOS, and Android. The public page intentionally avoids low-level cryptographic parameters and storage details.

The technical design separates client-side message protection from backend delivery responsibilities. The backend coordinates delivery metadata and stored message payloads without the project page exposing implementation internals.

Chat behavior includes conversations, participants, message read state, hidden or deleted messages, typing indicators, message reactions, blocked users, reports, unread counts, push notification integration, and realtime delivery.

Native iOS App

The iOS client is a SwiftUI app targeting modern iOS. Its architecture is feature-based, with URLSession networking, dependency protocols, shared state through ObservableObject, and a split API client with feature-specific extensions.

Implemented iOS areas include:

  • feed scopes for For You, Following, and Bookmarks
  • photo detail, comments, reactions, bookmarks, AI insights, and AI chat
  • upload flow with gallery, camera, drafts, validation, and MapKit location picker
  • profile editing, connections, follow requests, private-account controls, and blocked users
  • private messaging, user search, unread counts, and notification updates
  • trends, tag photos, impact/statistics, moderation, appeals, and flagging
  • push notifications
  • account authentication, data export, and account deletion/restoration

The iOS realtime client handles authentication, channel subscriptions, reconnection, event deduplication, and typed event parsing so it can stay aligned with the web and Android clients.

Native Android App

The Android client is written in Kotlin with a repository-oriented architecture. Retrofit and Moshi define the API contract, OkHttp handles network transport, platform storage handles local session data, Coil handles images, push messaging powers notifications, UCrop supports photo editing, and OSMDroid supports location picking.

The Android app includes more than one hundred Kotlin source files and dozens of screens. Major feature areas include:

  • Google OAuth sign-in with invitation support
  • feed, following scope, photo detail, comments, reactions, bookmarks, upload, edit, and share
  • profile, settings, notifications, connections, private accounts, follow requests, and blocked users
  • private messaging, user search, messages, read state, typing, reactions, reports, and blocked users
  • AI insights, translations, AI chat, trends, tag photos, impact search, statistics, moderation, appeals, and help center
  • push notifications
  • realtime reconnect, event dedupe, feed dirty tracking, and channel subscriptions

The Android API interface covers the same unified API used by the web and iOS clients, which keeps platform work from drifting into separate API contracts.

Moderation, Privacy, and Account Controls

Photo(n) has several product and operational controls that matter for a social-photo platform:

  • invitation-aware access flows
  • moderation decision workflows
  • user-facing moderation history and appeals
  • comment and photo flagging
  • private accounts and follow approvals
  • user blocking
  • account data export
  • account deletion lifecycle
  • privacy-safe location display instead of raw coordinate fallbacks
  • explicit AI consent during upload
  • AI status visibility

These systems make the platform closer to an operating product than a demo photo feed.

Operational Readiness

The operational architecture is built around separating the API server, realtime behavior, and background worker responsibilities. The public case study keeps deployment providers, environment wiring, health check details, and private automation details out of the page.

Operational work includes queueing and pub/sub, storage abstraction, migration handling, runtime monitoring, AI retry operations, search indexing, geocoding backfills, storage checks, and platform-specific release readiness for iOS and Android.

Technical Perspective

This case study demonstrates technical breadth across backend, web, mobile, realtime infrastructure, media processing, AI integration, operational tooling, release readiness, and cross-platform behavior.