Frontend-first monorepo for the Starchild / Darkfloor music product.
The primary runtime is apps/web, a Next.js App Router application backed by tRPC, NextAuth, and Drizzle/Postgres. Desktop shells live in apps/desktop with Electron as the main path and Tauri as an experimental parallel track. apps/mobile is an Expo-based React Native Web shell that already uses a durable mobile controller architecture.
The Darkfloor API V2 backend is consumed through API_V2_URL. The api/ directory remains a Git submodule for explicit backend or coordinated full-stack work, not the default frontend implementation path.
- Root package:
darkfloor-player@1.15.21 - Default local frontend URL:
http://127.0.0.1:3222 - Default backend submodule URL when run locally:
http://127.0.0.1:3333 - Production frontend runtime: PM2 on Ubuntu (
bluesix-frontend-prod) - Active tRPC routers in
apps/web/src/server/api/root.ts:admin,post,music,equalizer - Additional router module present but not registered:
preferences - Current web route groups include:
- UI pages such as
/,/about,/library,/playlists,/settings,/signin,/spotify,/admin - Music detail routes for albums, artists, tracks, playlists, and discovery playlists
- Route handlers under
/api/**for auth, Songbird, Spotify, music discovery, V2 health/config/metrics, streaming, OG image generation, and admin diagnostics
- UI pages such as
apps/web: primary Next.js App Router productapps/desktop: Electron desktop shell, packaging helpers, and experimental Tauri runtimeapps/mobile: Expo React Native Web shell with state and persistence insrc/mobile-shell/*
packages/api-client: REST and tRPC client helperspackages/auth: auth logging and provider helperspackages/config: constants, storage keys, visualizer configpackages/types: shared TypeScript contractspackages/player-core: playback engine primitivespackages/player-react: React player context and hookspackages/audio-adapters: runtime audio adapterspackages/ui: shared UI primitives and motion helperspackages/visualizers: flow-field canvas and visualizer patternspackages/eslint-config,packages/tsconfig: workspace config packages
Run these commands from the repo root.
-
Initialize the backend submodule. Root install runs
install:apiduringpostinstall, so the submodule must exist unless you are intentionally using the missing-submodule escape hatch:git submodule update --init --recursive
-
Install dependencies:
pnpm install --frozen-lockfile
-
Create a local env file. The custom server reads
.envand.env.local; prefer.env.localfor machine-specific overrides:Copy-Item .env.example .env.local -
Fill in the required values:
PORTAUTH_SECRETAUTH_DISCORD_IDAUTH_DISCORD_SECRETDATABASE_URLAPI_V2_URLUNIVERSAL_KEY
-
Run database commands if your local schema needs to be generated or applied:
pnpm db:generate pnpm db:migrate
-
Start the frontend:
pnpm dev
-
Open
http://127.0.0.1:3222.
- Node.js 20+
- pnpm 10+
- PostgreSQL for web/auth data
- Git submodules enabled for normal root installs
- Rust only if you plan to use the experimental Tauri path
The typed env schema lives in apps/web/src/env.js. The starter template lives in .env.example.
Important current behavior:
DATABASE_URLis the canonical frontend database key used by the web runtime and frontend DB utilities.API_V2_URLis the canonical upstream API base URL.SONGBIRD_API_URLremains supported as a compatibility alias.- The custom server loads
.env, then.env.localin development, and.env.local,.env.production, then.envin production with file values overriding inherited process env. - New env keys should be added to both
.env.exampleandapps/web/src/env.js.
| Command | Purpose |
|---|---|
pnpm dev |
Start the main web runtime through the custom server wrapper |
pnpm dev:next |
Run plain Next.js dev server on port 3222 |
pnpm build |
Build the web app and the api/ submodule |
pnpm start |
Start the production custom server |
pnpm check |
Boundary check plus web lint/typecheck |
pnpm test |
Run the web Vitest suite |
pnpm mobile:check |
Type-check the Expo mobile workspace |
pnpm dev:mobile |
Start the Expo web shell |
pnpm electron:dev |
Run the web dev server and Electron together |
pnpm tauri:dev |
Start the experimental Tauri shell |
pnpm ws:check |
Run workspace checks with Turborepo |
apps/web/src/appapps/web/src/server/apiapps/web/src/server/authapps/web/src/server/dbapps/web/scripts/server.js
packages/api-client/srcpackages/player-core/srcpackages/player-react/srcpackages/types/srcpackages/visualizers/src
The canonical repo guidance is:
Thin compatibility files now exist for common assistants:
Those files intentionally stay short and route back to AGENTS.md plus AI_TOOLING.md.
- PM2 is the default production context for the frontend.
- Docker is available through
Dockerfileanddocker-compose.yml. vercel.jsonexists for compatible builds and replica scenarios, but it is not the default production assumption for the main frontend.
AI_TOOLING.mdCHANGELOG.mdapps/web/README.mdapps/desktop/README.mdapps/mobile/README.mdpackages/README.md
GPLv3. See LICENSE.md.