Oceano di Versi

Oceano di Versi

An iOS social network built for poetry — a safe, moderated space to write, discover and share verses.

Technologies: SwiftUISwiftFirebaseCloud FunctionsGeminiAlgoliaStoreKit 2

What it is

Oceano di Versi is an iOS social platform built exclusively for poetry. It starts from the idea that verses deserve a space of their own, away from the noise of general-purpose social networks: a moderated environment that encourages daily creative expression and rewards consistency.

The app is fully localized in six languages — Italian, English, German, Spanish, French and Brazilian Portuguese — and published on the App Store.

Core features

  • Dual feed — a global feed to discover new poets and a following feed for favorite authors.
  • Emotion tags — every poem is tagged with an emotion (Love, Melancholy, Joy, Anger, Hope, Loneliness, Nostalgia, Peace, Passion, Pain), so readers can browse by mood.
  • Rich editor — compose with optional cover images, save drafts, publish publicly or keep private.
  • Social interactions — like, comment, follow and share poems via deep links with Open Graph metadata for rich previews outside the app.
  • Full-text search — users and poems indexed with Algolia for instant author and verse discovery.
  • Daily prompt — every day at midnight (Europe/Rome) Gemini generates an introspective question in all supported languages, pinned at the top of the feed.
  • Monthly leaderboard — +1 point per day with at least one public poem, −3 for every missed day. The monthly winner is featured at the top of the public feed for the first 7 days of the following month.
  • AI moderation — every poem, comment and profile photo is reviewed by Gemini 2.5 Flash before publication, with an admin panel for human review of flagged content.
  • Reports & flagging — built-in user and content reporting, with automatic notification to moderators.
  • Flexible authentication — sign in with Email, Google or Apple.
  • Oceano Pro — monthly or yearly subscription via StoreKit 2, with unlimited drafts, a verified badge and premium features.
  • Notification center — in-app hub for likes, comments, new followers and moderation updates, with multilingual FCM push notifications.

Architecture

The app is written entirely in SwiftUI (iOS 18.6+) and follows MVVM with Firestore as a single source of truth. All listeners are real-time — no polling.

The backend is made of 22 Cloud Functions Gen 2 in Node.js 22, deployed to europe-west1, handling:

  • AI moderation of poems, comments and profile photos;
  • push notifications for likes, comments, follows and new posts;
  • leaderboard scoring and automatic monthly close;
  • multilingual daily prompt generation;
  • Algolia sync for full-text search;
  • propagation of profile changes (name, photo, premium) across related content;
  • Open Graph metadata generation for deep-linked sharing;
  • GDPR-compliant account deletion.

Two mirrored environments — production and staging — allow isolated testing on real devices thanks to separate Bundle IDs.

Code examples

Paginated Firestore feed (SwiftUI)

Reactive ViewModel, Firestore query ordered by timestamp with a cursor for pagination:

@Published var globalPoesie: [Poesia] = []
private var lastDoc: DocumentSnapshot?

var query = db.collection("poems")
    .order(by: "timestamp", descending: true)
    .limit(to: 10)

if let cursor = lastDoc {
    query = query.start(afterDocument: cursor)
}

AI moderation with Gemini (Cloud Function)

Poems go through pendingPoems before reaching poems: a Firestore trigger calls Gemini and decides the verdict.

exports.moderatePendingPoem = onDocumentCreated(
  { document: "pendingPoems/{poemId}", secrets: [GEMINI_API_KEY] },
  async (event) => {
    const verdict = await runGeminiModeration(event.data.data());

    if (verdict === "block") return quarantinePoem(event);
    return promotePoemFromPending(event);
  }
);

Full details (fail-open, override, profile photos) in the moderation pipeline doc at the bottom of the page.

Stack

LayerTechnology
iOS appSwiftUI, Swift 5, iOS 18.6+
AuthenticationFirebase Auth (Email, Google, Apple)
DatabaseCloud Firestore
StorageFirebase Storage
BackendCloud Functions Gen 2 (Node.js 22)
SearchAlgolia
AI moderationGemini 2.5 Flash
PushFirebase Cloud Messaging
SubscriptionsStoreKit 2

Built with AI agents

The entire codebase — iOS app, Cloud Functions, Firestore rules, localizations and this documentation — was written in collaboration with multiple AI agents (Claude and Codex). The human role: defining requirements and constraints, reviewing diffs and architecture, calling non-obvious tradeoffs (e.g. fail-open on moderation, floor-at-0 on scores, stable pointer for the daily prompt). Agents produced implementations, tests, refactors and docs; every change went through review before merge.

Documentation