How mozzius/graysky works
Project type and purpose
• Graysky is a full-stack, monorepo-managed Bluesky client. It comprises:
• A React Native/Expo mobile app (apps/expo)
• A Next.js marketing/web app (apps/nextjs)
• A standalone Node.js push notification service (apps/push-notifs)
• Shared packages for internal API (packages/api) and database schema (packages/db)
• Utility scripts (cryptography), tooling configs, and container/orchestration files
File structure
• Top-level “apps” directories each encapsulate a deployable application or service.
• “packages/api” houses a tRPC router (gifs, translate) and is consumed by Next.js API routes.
• “packages/db” defines the Prisma schema for Postgres (or equivalent).
• “apps/push-notifs” is a microservice that subscribes to the Bluesky Firehose, persists subscriptions in the DB, and pushes to FCM/APNs.
• “cryptography/keyGen.py” is a helper for generating keys (e.g., APNs/FCM).
• Dockerfile, docker-compose.yml, and GitHub Actions YAML define container builds and CI pipeline.
README for insights
• Primary focus on building and running the Expo mobile client.
• Mentions push notifications (which maps to apps/push-notifs).
• Mobile Client (Expo/React Native)
• Web Client (Next.js)
• Internal tRPC API Service (packages/api)
• Push Notification Service (apps/push-notifs)
• Database (Prisma/Postgres from packages/db)
• External Bluesky PDS (app.bsky AT Protocol servers)
• External Services:
– Firebase Cloud Messaging (FCM) & Apple Push Notification service (APNs)
– Third-party APIs (GIF generation, translation)
• Mobile & Web → External PDS: authenticate & fetch Bluesky data via AT Protocol Agent
• Mobile & Web → Internal tRPC API: /api/trpc → packages/api router (for gifs & translate)
• Next.js hosts the tRPC API under /api/trpc using the shared router code
• Push-Notif Service subscribes to PDS Firehose stream → writes/reads tokens from Database → sends push messages to FCM/APNs
• Internal API & Push-Notif Service → Database (Prisma client)
• cryptography script → generates keys → used by Push-Notif Service
c. Architectural patterns & principles:
• Monorepo with pnpm & Turbo for fast builds & shared code
• Service-oriented: discrete deployable backends (Next.js serverless API, push service)
• Shared code via packages/api and packages/db
• React component hierarchy & hooks for mobile UI; Next.js Server Components for web
• tRPC for end-to-end typed APIs
• Prisma ORM for schema & migrations
d. Key technologies:
• Frontend: React Native (Expo), Next.js
• Backend: Node.js, tRPC, Prisma, Firehose client
• Deployment: Docker, docker-compose, EAS (Expo Application Services), GitHub Actions
• Package management: pnpm workspace, turborepo
• Internationalization: Crowdin & lingui