BakeBetter Apps·Explainer Hub
← All Explainers
← Hub

//US

Feature Spec — v1.0

//US — The Music
Collaboration Platform

A place where independent artists upload tracks, discover other artists' music, record vocals or ideas over existing tracks, and connect with collaborators. Built for the Indian indie music scene, starting with Nucleya's album remix contest.

3
Platforms
17
Pages / Views
30+
API Endpoints
8
Data Models
01

Platform Overview

What //US delivers across web and iOS

//US is a full-stack music collaboration platform with three surfaces: a Next.js web app, a native Swift iOS app, and an Express backend API. All three share a single PostgreSQL database and Cloudflare R2 storage layer.

🎵 Upload & Share Tracks

Artists upload original music (MP3, WAV, FLAC up to 100MB), set genre/BPM/key metadata, and publish to the community.

🎧 Discover & Play

Browse a feed of public tracks with genre filters, waveform visualization, and a persistent mini-player for continuous listening.

🎤 Record Collaborations

Listen to any track and record your own take over it — vocals, rap, instruments — directly in the browser or iOS app.

💬 Real-time Messaging

Socket.io powered chat with text, voice notes, and file sharing. Start conversations from any track or profile.

🏆 Remix Contests (NEW)

Artists create time-bound remix projects. Community submits remixes. Owner reviews and selects winners for official releases.

👤 Artist Profiles

Each artist has a public profile with bio, genres, skills, tracks, collaboration count, and follow/unfollow.

02

Authentication

Three auth methods across web and iOS

  • Register: POST /api/auth/register — email, password (min 8 chars), name, optional artistName
  • Login: POST /api/auth/login — returns JWT access token (15 min) + httpOnly refresh cookie (7 days)
  • Refresh: POST /api/auth/refresh — token rotation, issues new access token + rotated refresh cookie
  • Rate limited: 10 requests per 15 minutes on auth endpoints
1

User clicks "Continue with Google"

Redirects to GET /api/auth/google which triggers Passport Google strategy

2

Google consent screen

Scope: profile + email. Published OAuth app, no test user restriction.

3

Callback at /api/auth/google/callback

Find-or-create user by Google profile. Issue JWT + refresh cookie.

4

Redirect to frontend

Frontend receives ?access_token= URL param, stores in Zustand auth state.

1

GoogleSignIn SDK opens browser sheet

Uses iOS Client ID. ColabApp.swift handles onOpenURL for redirect.

2

App receives Google ID token

GoogleAuthService.swift extracts the idToken from GIDSignInResult.

3

POST /api/auth/google/mobile

Backend verifies token with Google's tokeninfo endpoint, find-or-creates user.

4

Token stored in Keychain

AuthStore (@Observable) updates isAuthenticated, triggers UI switch from onboarding to main app.

Architecture Note iOS uses AuthStore.swift as the single source of truth — an @Observable singleton that tries Google session restore on bootstrap, falls back to email/password token from Keychain.
03

Tracks & Upload

The core content unit of the platform

A Track is the fundamental content object. Artists upload audio, set metadata, and publish. Tracks are what people discover, play, and record collaborations over.

FieldTypeNotes
titleStringRequired
descriptionString?Optional, shown on track detail
genreString?e.g. "Electronic", "Hip Hop"
bpmInt?Beats per minute
keyString?Musical key, e.g. "Am", "C#"
tagsString[]Freeform tags
lookingForString[]e.g. ["vocalist", "rapper", "guitarist"]
visibilityEnumPUBLIC / PRIVATE / UNLISTED
stemsAvailableBooleanWhether stems can be downloaded
downloadableBooleanWhether the full track can be downloaded
1

Request presigned URL

POST /api/uploads/presign with fileName, fileType, fileSize (max 100MB). Accepts MP3, WAV, M4A, AAC, OGG, FLAC, WebM.

2

Direct upload to R2

Client PUTs file directly to Cloudflare R2 using the presigned URL. No server bandwidth used.

3

Complete upload

POST /api/uploads/complete with key + trackId. Sets audioUrl, status to "processing".

4

Waveform generation

BullMQ job runs audiowaveform to generate peak data. Track status moves to "ready" when done.

draft → uploading → processing → ready
                               ↓
                            error

Only tracks with status "ready" appear in public feeds.

Waveform Rendering Server generates peak data via audiowaveform (BullMQ job). Client renders with wavesurfer.js 7 + @wavesurfer/react. WaveformBars component provides a simplified bar visualization for cards.
04

Discover & Search

Finding tracks and artists

Home Feed (/home)

Infinite scroll of public tracks with genre filters. Each card shows waveform bars, artist avatar, play count, "looking for" tags. Three-dot menu with Copy Link, Share, Report.

Search (/search)

Full-text search across artists + tracks. Filter by type (artists / tracks / all). Searches name, artistName, genres, skills, title, tags, description via ILIKE + array contains.

Dashboard (/dashboard)

Artist's own stats: track count, collaboration count, recent activity. Quick actions: upload, record, browse.

Mini Player

Persistent glassmorphism audio player (desktop). Stays visible while browsing. Shuffle/skip/repeat buttons (currently no-ops, future feature).

05

Record & Collaborate

The core collaboration mechanic

This is the signature feature of //US. A user finds a track they like, and can immediately record their own take over it — vocals, rap, beats, instruments — all within the app.

1

User opens track detail page

Sees waveform player, track metadata, existing collaborations, and a prominent "Record" CTA button.

2

Navigates to /record/[trackId]

In-app recording interface loads. Reference track is queued up for playback alongside recording.

3

Records their take

LiveWaveform component shows real-time audio visualization. User can play the reference track while recording their part on top.

4

Upload recording

Same presigned URL flow as track upload. Audio is stored in R2. POST /api/recordings creates the recording with optional note.

5

Recording appears on track page

Shows up in the "Collaborations" section of the track detail page with the recorder's profile and playback.

Key Constraint Recordings require the track to have status other than "draft". You can't record over an unpublished track.
06

Messaging

Real-time chat between collaborators

Inbox (/inbox)

List of all conversations with last message preview, unread count, and other participant info. Ordered by most recent activity.

Chat Thread (/chat/[id])

Full conversation view with cursor-based pagination (30 messages per page, max 100). Real-time delivery via Socket.io.

Message Types

TEXT — standard text messages. AUDIO — voice notes with duration. FILE — file sharing with original filename.

Conversation Starters

Start conversations from: track detail page ("Message" button), artist profile page, or directly from inbox. Can optionally link a track to the conversation for context.

Demo Mode Inbox includes mock conversations with Nucleya, Prateek Kuhad, Ritviz, DIVINE, and Seedhe Maut as placeholder data for demos.
07

Profiles & Social

Artist identity and social graph

  • name — Display name (required)
  • artistName — Unique handle, case-insensitive (used in URLs)
  • avatar — Profile picture (R2 CDN URL)
  • bio — Free text description
  • location — City / area
  • genres — Array of genres (e.g. ["Electronic", "Hip Hop"])
  • skills — Array of skills (e.g. ["Producer", "Vocalist", "Guitarist"])
  • isVerified — Verification badge (admin-set)

Every profile shows four stats:

  • trackCount — Number of published tracks
  • collabCount — Number of recordings made
  • followerCount — People following this artist
  • followingCount — People this artist follows
  • Follow / Unfollow — Idempotent toggle. Paginated follower/following lists.
  • Message — Button on profile creates/opens a conversation
  • Share Profile — Copy profile link (working)
  • Edit Profile — Button exists but edit flow not yet built (planned)
08

Project / Contest System

The new headline feature — remix contests

New Feature This is the primary new feature based on Nucleya's feedback. A Project is a time-bound remix contest where an artist uploads reference tracks, invites the community to submit remixes, reviews submissions, and selects winners for an official album release.

Core concept: A Project is a container that holds reference tracks (the originals to remix), a deadline, and collects submissions from the community. The project owner reviews all submissions and can shortlist or select winners.

D

DRAFT

Project is being set up. Owner adds title, description, cover art, deadline, reference tracks. Not visible to the public.

O

OPEN

Project is live and accepting submissions. Visible on the projects browse page. Users can listen to reference tracks and submit remixes.

R

REVIEWING

Deadline has passed (or owner manually closed submissions). Owner reviews all submissions, shortlists favorites, selects winners.

C

CLOSED

Winners selected. Owner sets release title, date, and streaming URL. Project becomes an archive of the contest.

FieldTypePurpose
titleStringe.g. "Remix Nucleya's New Album"
descriptionString?Rules, what the artist is looking for, prizes
coverUrlString?Project artwork / album cover
deadlineDateTime?Submission cutoff date
statusEnumDRAFT / OPEN / REVIEWING / CLOSED
maxSubmissionsInt?Per-user submission cap (null = unlimited)
releaseTitleString?Final album/EP name (set when closing)
releaseDateDateTime?When the final release drops
releaseUrlString?Link to streaming platforms
FieldTypePurpose
audioUrlStringR2 CDN URL of the remix
waveformDataJson?Peak data for visualization
durationFloat?Length in seconds
noteString?Submitter's message to the owner
feedbackString?Owner's private notes (never shown to submitter)
statusEnumPENDING / SHORTLISTED / SELECTED / REJECTED
referenceTrackIdString?Which reference track this remixes
Privacy Rule Submission status is never shown to the submitter as "rejected". The public API only returns submissions without status. Only the project owner sees the full status in their review dashboard.

A project contains one or more reference tracks — these are existing Track objects that the owner attaches to the project. They're the "originals" that people will remix.

  • Reference tracks have an order field for display ordering
  • A track can only be added once per project (unique constraint)
  • Owner can add, remove, and reorder reference tracks
  • Submitters can optionally tag their submission to a specific reference track
09

Project User Flows

End-to-end journeys for creators and submitters

Flow A: Artist Creates a Project

1

Navigate to /project/new

Only visible to users with ARTIST or ADMIN role. At launch, only Nucleya has this access.

2

Fill project details

Title, description (rules, what they're looking for), cover art upload, deadline picker, max submissions per user.

3

Attach reference tracks

Search/select from their own existing tracks. Drag to reorder. These become the tracks people will remix.

4

Save as draft or publish

Draft saves without making it public. Publish moves status to OPEN and the project appears in /projects.

Flow B: User Discovers & Submits a Remix

1

Browse /projects or see featured banner on /home

Active projects appear as prominent cards with cover art, title, deadline countdown, and submission count.

2

Open project detail (/project/[id])

See full description, all reference tracks with inline waveform players, existing submissions gallery.

3

Listen to reference tracks

Play each reference track to find one they want to remix. Each track has full waveform visualization.

4

Click "Submit Your Remix"

Navigates to /project/[id]/submit. Button disabled if: not logged in, deadline passed, or maxSubmissions reached.

5

Upload remix audio

Same presigned URL upload flow as regular track upload. Select which reference track they remixed (optional). Add a note to the artist.

6

Preview and submit

Listen to uploaded audio before final submission. Success screen links back to the project page.

Submission Limits If maxSubmissions is set (e.g. 3), each user can submit up to that many remixes per project. The unique constraint is on [projectId, userId, referenceTrackId] — so one remix per reference track per user.
10

Owner Review Dashboard

/project/[id]/manage — the curation interface

The owner review dashboard is where the project creator reviews all submissions, shortlists favorites, and selects winners for the official release. Only accessible by the project owner.

Stats Bar

Top of the page shows: total submissions, pending count, shortlisted count, selected count. Quick visual overview of review progress.

Filter & Browse

Filter submissions by status: All / Pending / Shortlisted / Selected. Each card shows user info, inline audio player, note, timestamp.

Review Actions

Per-submission buttons: Shortlist / Select / Reject. Private feedback text field for owner's notes (never shown to submitter).

Project Controls

Close submissions (OPEN → REVIEWING). Reopen if needed. Finalize once winners are selected.

Release Panel

When moving to CLOSED: set release title (album/EP name), release date, and streaming platform URL. This info shows on the project page.

1

Browse pending submissions

Listen to each remix with inline player. Read submitter's note.

2

Shortlist promising ones

Click "Shortlist" to flag interesting submissions. Add private feedback notes.

3

Select winners from shortlist

Review shortlisted submissions. Click "Select" on the final picks for the album.

4

Finalize the project

Set release title, date, and streaming URL. Project moves to CLOSED. Selected submissions are featured.

11

Roles & Access Control

Phased rollout strategy

RoleCan Create ProjectsCan Submit RemixesCan Browse/PlayNotes
USER (default) No Yes Yes Standard user — discovers, plays, records, submits
ARTIST Yes Yes Yes Can create and manage projects. Nucleya at launch.
ADMIN Yes Yes Yes Full platform access. For the //US team.

Phased Rollout Plan

  • Nucleya's account set to ARTIST role via DB update
  • Only ARTIST/ADMIN roles can access POST /api/projects
  • Nucleya creates the first project: "Remix my new album"
  • Community signs up, browses reference tracks, submits remixes
  • Nucleya reviews submissions and selects winners for the release
  • Goal: Prove the concept with real content and real users
  • Add "Request Artist Status" flow for verified users
  • Any approved artist can create their own remix projects
  • Project discovery page becomes a marketplace of active contests
  • Home feed shows projects alongside individual tracks
12

All Pages & Routes

Complete route map across web and iOS

Web (Next.js App Router)

RouteStatusPurpose
/LiveRoot redirect to /dashboard
/onboardingLiveSign-up flow (Google + email)
/loginLiveLogin page
/dashboardLiveArtist stats, quick actions
/homeLiveDiscover feed with filters
/searchLiveArtist + track search
/track/[id]LiveTrack detail, waveform, collaborations
/record/[trackId]LiveIn-app recording interface
/uploadLiveTrack upload with R2 presigned URLs
/profileLiveOwn profile, share, logout
/profile/[id]LiveOther artist's profile
/inboxLiveConversation list
/chat/[id]LiveReal-time messaging thread
/projectsNewBrowse open projects/contests
/project/[id]NewProject detail + reference tracks + submissions
/project/[id]/submitNewUpload remix to project
/project/[id]/manageNewOwner review dashboard
/project/newNewCreate project (ARTIST/ADMIN only)
/project/[id]/editNewEdit project metadata
/settingsPlannedAccount settings, change password

iOS (SwiftUI)

ViewStatusPurpose
OnboardingViewLiveLogin / sign-up landing
HomeFeedViewLiveTrack feed with filters
SearchViewLiveFull-text search
DashboardViewLiveUser stats
TrackDetailViewLiveTrack page + recordings
UploadTrackViewLiveTrack upload
RecorderViewLiveRecord over a track
MyProfileViewLiveOwn profile
ArtistProfileViewLiveOther artist profiles
InboxViewLiveConversations list
ChatThreadViewLiveChat messages
ProjectsListViewNewBrowse open projects
ProjectDetailViewNewProject detail + submissions
SubmitRemixViewNewUpload remix to project
ManageProjectViewNewOwner review (ARTIST only)
CreateProjectViewNewCreate project (ARTIST only)
13

Data Model

All Prisma models — existing + new

ModelStatusKey FieldsRelations
User Existing email, name, artistName, avatar, bio, genres[], skills[], role (NEW) tracks, recordings, conversations, followers, following, projects, submissions
Track Existing title, audioUrl, waveformData, genre, bpm, key, tags[], visibility, status user, recordings, projectTracks, submissionRefs
Recording Existing audioUrl, waveformData, duration, note track, user
Conversation Existing lastMessageAt, trackId (optional) messages, participants, track
Message Existing type (TEXT/AUDIO/FILE), content, audioUrl, fileUrl conversation, sender
Follow Existing followerId, followingId follower (User), following (User)
RefreshToken Existing token (hashed), expiresAt user
Project New title, description, coverUrl, deadline, status, maxSubmissions, releaseTitle/Date/Url owner (User), referenceTracks (ProjectTrack[]), submissions
ProjectTrack New order project, track
Submission New audioUrl, waveformData, duration, note, feedback, status project, user, referenceTrack (Track)
New Enums UserRole: USER | ARTIST | ADMIN — ProjectStatus: DRAFT | OPEN | REVIEWING | CLOSED — SubmissionStatus: PENDING | SHORTLISTED | SELECTED | REJECTED
14

API Endpoints

Complete endpoint reference

POST /api/auth/register  — Create account
POST /api/auth/login     — Get tokens
POST /api/auth/refresh  — Rotate refresh token
POST /api/auth/logout   — Clear tokens
GET  /api/auth/me       — Current user profile
GET  /api/auth/google        — Start Google OAuth
GET  /api/auth/google/callback — Handle Google callback
POST /api/auth/google/mobile  — iOS native token exchange
POST   /api/tracks      — Create track
GET    /api/tracks      — List tracks (paginated, filtered)
GET    /api/tracks/:id  — Get single track
PUT    /api/tracks/:id  — Update track metadata
DELETE /api/tracks/:id  — Delete track
POST /api/recordings               — Submit recording
GET  /api/tracks/:trackId/recordings — List recordings for track
POST /api/conversations            — Create conversation
GET  /api/conversations            — List conversations
GET  /api/conversations/:id/messages — Get messages (cursor-based)
POST /api/conversations/:id/messages — Send message
POST /api/conversations/:id/read    — Mark as read
GET /api/profiles/me         — Own profile + stats
PUT /api/profiles/me         — Update profile
GET /api/profiles/:artistName — Public artist profile
POST   /api/follow/:userId               — Follow
DELETE /api/follow/:userId               — Unfollow
GET    /api/profiles/:artistName/followers — Follower list
GET    /api/profiles/:artistName/following — Following list
GET /api/search?q=...&type=all|artists|tracks — Full-text search
POST /api/uploads/presign  — Get presigned R2 URL
POST /api/uploads/file     — Local file upload (dev)
POST /api/uploads/complete — Finalize upload + trigger waveform
// Project CRUD
POST   /api/projects                      — Create project (ARTIST/ADMIN)
GET    /api/projects                      — List open projects
GET    /api/projects/:id                  — Project detail
PUT    /api/projects/:id                  — Update metadata
DELETE /api/projects/:id                  — Delete (DRAFT only)

// Lifecycle
POST   /api/projects/:id/publish          — DRAFT → OPEN
POST   /api/projects/:id/close-submissions — OPEN → REVIEWING
POST   /api/projects/:id/finalize         — REVIEWING → CLOSED

// Reference Tracks
POST   /api/projects/:id/tracks           — Add reference track(s)
DELETE /api/projects/:id/tracks/:trackId   — Remove reference track
PUT    /api/projects/:id/tracks/reorder    — Reorder tracks

// Submissions
POST   /api/projects/:id/submissions       — Submit remix
GET    /api/projects/:id/submissions       — List submissions
GET    /api/projects/:id/submissions/mine  — My submissions
DELETE /api/projects/:id/submissions/:subId  — Withdraw submission

// Owner Review
PUT    /api/projects/:id/submissions/:subId/status   — Change status
PUT    /api/projects/:id/submissions/:subId/feedback — Add private notes
15

Tech Stack

Infrastructure and tooling

LayerTechnologyDetails
Web FrontendNext.js 16.2.2App Router, React 19, Tailwind v4, Zustand state
Web BackendExpress 5.2.1Node 22+, TypeScript 5, Zod validation
iOS AppSwift 5.9 / SwiftUIiOS 17.0+, XcodeGen, SPM packages
DatabasePostgreSQL + Prisma 7.6Custom adapter-pg, generated client
AuthJWT (jose) + Google OAuth15min access, 7-day refresh in httpOnly cookie
Real-timeSocket.io 4.8.3WebSocket for messaging
StorageCloudflare R2S3-compatible, presigned upload URLs
Audio Processingaudiowaveform + wavesurfer.js 7Server-side peaks, client rendering
Job QueueBullMQ + RedisWaveform generation jobs
DeploymentPM2 + NginxVPS at 72.60.201.119, SSL via Certbot
iOS Dependencies SocketIO 16.1.1 (real-time messaging) and GoogleSignIn-iOS 8.0.0 (OAuth) via Swift Package Manager. Bundle ID: com.bakebetterapps.colab
16

Launch Strategy

Nucleya's vision for the initial rollout

The Pitch "Here's a new project I'm doing. I want you guys to participate. Anybody who wants to remix my new album — log on, create an account, upload your mixes. Whoever I find interesting, I'll put them on an album." — Nucleya
1

Nucleya creates the first Project

Uploads reference tracks from his new album. Sets a deadline. Writes a description explaining what he's looking for in remixes.

2

Announces on social media

Drives his fanbase to //US. "Sign up, listen to my tracks, upload your remix." Creates initial buzz and user signups.

3

Community submits remixes

Artists sign up, browse reference tracks, and submit their takes. Platform gets seeded with real content from real musicians.

4

Nucleya reviews and selects

Uses the owner review dashboard to listen to submissions, shortlist favorites, and select winners for the album.

5

Album release

Selected remixes get released as an official album. Project is closed with release info (title, date, streaming URL).

6

Open platform (Phase 2)

After proving the concept, project creation opens to other verified artists. //US becomes the go-to platform for music collaboration in India.

Why This Approach Nucleya needs to show a proof of concept — that he designed it for himself and it works. Only then does he open it for everyone else. This ensures the platform launches with real content, real users, and a validated use case.
17

Build Order

Implementation sequence with dependencies

Critical path: Schema → Project API → Submission API → Project Detail Page → Submit Page. Everything else can follow in parallel.

Parallel Tracks Steps 1-11 (backend + web) and Step 16 (domain) can run in parallel. iOS work (Steps 12-15) depends on backend APIs being ready (Steps 3-5). Deploy (Step 17) is the final step after everything is built and tested.

//US Feature Spec v1.0 — Generated 2026-04-08
Based on Nucleya's voice note feedback + existing codebase analysis
Covers: 3 platforms, 20 pages/views, 44 API endpoints, 10 data models