Harmony Support

About

Learn the mission, tech stack, and high-level architecture of Harmony

Harmony

📖 This document is a living reference and will be updated as the project evolves.

Project Mission

Harmony’s mission is to make personal music analytics accessible, beautiful, and open-source. We help users understand their listening habits, discover insights, and share findings securely—all while providing maintainers a modern, well-typed codebase built for speed and extensibility.

Tech Stack

LayerTechnologyWhy We Chose It
Application FrameworkNext.js 16 (App Router)File-system routing, React Server Components, edge-ready deployment.
UI LibraryReact 19 with Server ActionsLatest React features, seamless data fetching, and progressive enhancement.
StylingTailwind CSS v4 + Shadcn UIRapid styling, accessible components, and design consistency.
State & AsyncReact Query + ZustandPredictable data-fetching & caching strategies.
DatabasePostgreSQL via Drizzle ORMType-safe SQL, easy migrations, and portability.
Repo ManagementTurborepoIncremental builds, caching, and monorepo DX.
Auth@repo/auth (NextAuth.js v5 under the hood)Secure OAuth, extensible adapter, first-class TypeScript support.
CI / CDGitHub Actions + Vercel / DockerFast preview deployments & flexible self-hosting.

High-Level Architecture

Folder Structure (Excerpt)

apps/
  web/                      ← User-facing analytics application
  docs/                     ← This documentation site (Fumadocs)
  studio/                   ← Developer studio & DB migrations
  api/                      ← API app (Hono.js)
packages/
  ui/                       ← Shared UI components (shadcn and customs)
  database/                 ← Drizzle config & schema
  auth/                     ← Authentication helpers
  spotify/                  ← Spotify API SDK
  config-eslint/            ← Shared ESLint configuration
  config-typescript/        ← Shared TypeScript configuration
  web-tests/                ← End-to-end & unit tests
  zustand-cookie-storage/   ← Zustand cookie storage helper

Data Flow

  1. The Web App fetches data from Spotify via the @repo/spotify package.
  2. Data is persisted in PostgreSQL through Drizzle ORM defined in @repo/database.
  3. Server Actions in Next.js expose strongly-typed endpoints to React components.
  4. Client components hydrate minimal UI state and leverage React Query for caching.