Initial commit: Music Hub collaboration platform
Full-stack music production collaboration tool with: - SvelteKit frontend with Design System (CSS vars, 8 shared components) - Hono API with auth, projects, tracks, versions, comments - PostgreSQL + Drizzle ORM (8 tables, roles, permissions) - S3-compatible storage with presigned upload URLs - wavesurfer.js audio player with waveform visualization - A/B version comparison with synchronized playback - Timestamped comments with threading and resolve workflow - Magic Link authentication with Resend email integration - Background audio processing (ffmpeg transcode + waveform peaks) - Role-based access control (Owner, Engineers, Artist, Label, Management, Viewer) - Toast notifications, skeleton loading, responsive layout - Docker deployment setup (API + Web + Postgres) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
32
packages/shared/src/validation/track.ts
Normal file
32
packages/shared/src/validation/track.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { z } from 'zod';
|
||||
import { SUPPORTED_AUDIO_FORMATS, MAX_FILE_SIZE } from '../constants/audio.js';
|
||||
|
||||
export const createTrackSchema = z.object({
|
||||
name: z.string().min(1).max(255),
|
||||
description: z.string().max(2000).optional(),
|
||||
});
|
||||
|
||||
export const updateTrackSchema = z.object({
|
||||
name: z.string().min(1).max(255).optional(),
|
||||
description: z.string().max(2000).optional(),
|
||||
});
|
||||
|
||||
export const requestUploadUrlSchema = z.object({
|
||||
fileName: z.string().min(1),
|
||||
mimeType: z.enum(SUPPORTED_AUDIO_FORMATS),
|
||||
fileSize: z.number().int().positive().max(MAX_FILE_SIZE),
|
||||
});
|
||||
|
||||
export const createVersionSchema = z.object({
|
||||
fileKey: z.string().min(1),
|
||||
label: z.string().max(100).optional(),
|
||||
notes: z.string().max(2000).optional(),
|
||||
originalFileName: z.string().min(1),
|
||||
mimeType: z.string().min(1),
|
||||
fileSize: z.number().int().positive(),
|
||||
});
|
||||
|
||||
export type CreateTrackInput = z.infer<typeof createTrackSchema>;
|
||||
export type UpdateTrackInput = z.infer<typeof updateTrackSchema>;
|
||||
export type RequestUploadUrlInput = z.infer<typeof requestUploadUrlSchema>;
|
||||
export type CreateVersionInput = z.infer<typeof createVersionSchema>;
|
||||
Reference in New Issue
Block a user