web
ai
mobile
data
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
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 contract: 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 Photon 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 contract, 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
Photon 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
Photon 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 backend 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 backend contracts.
Moderation, Privacy, and Account Controls
Photon 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.