mirror of
https://github.com/nomadkaraoke/karaoke-gen.git
synced 2026-11-20 13:07:57 +09:00
Replaced frontend with next.js/react version from vercel v0
This commit is contained in:
141 files changed
+4447
-4998
No files matched your search
+45
@@ -13,6 +13,51 @@ tests/outputs
|
||||
input
|
||||
output/
|
||||
|
||||
# Next.js / React Frontend (./frontend)
|
||||
node_modules/
|
||||
frontend/node_modules/
|
||||
frontend/.next/
|
||||
frontend/out/
|
||||
frontend/.swc/
|
||||
frontend/.turbo/
|
||||
frontend/build/
|
||||
frontend/dist/
|
||||
|
||||
# Next.js specific
|
||||
frontend/*.tsbuildinfo
|
||||
frontend/next-env.d.ts
|
||||
|
||||
# Environment files (local overrides)
|
||||
frontend/.env*.local
|
||||
|
||||
# Vercel
|
||||
frontend/.vercel/
|
||||
|
||||
# Package manager logs
|
||||
frontend/npm-debug.log*
|
||||
frontend/yarn-debug.log*
|
||||
frontend/yarn-error.log*
|
||||
frontend/pnpm-debug.log*
|
||||
frontend/.pnpm-debug.log*
|
||||
|
||||
# Testing
|
||||
frontend/coverage/
|
||||
|
||||
# TypeScript
|
||||
frontend/*.tsbuildinfo
|
||||
|
||||
# ESLint
|
||||
frontend/.eslintcache
|
||||
|
||||
# Storybook
|
||||
frontend/storybook-static/
|
||||
|
||||
# PWA files
|
||||
frontend/**/public/sw.js
|
||||
frontend/**/public/workbox-*.js
|
||||
frontend/**/public/swe-worker-*.js
|
||||
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Generated
+97
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "frontend",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.53.2",
|
||||
"@types/node": "^24.0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/@playwright/test": {
|
||||
"version": "1.53.2",
|
||||
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.53.2.tgz",
|
||||
"integrity": "sha512-tEB2U5z74ebBeyfGNZ3Jfg29AnW+5HlWhvHtb/Mqco9pFdZU1ZLNdVb2UtB5CvmiilNr2ZfVH/qMmAROG/XTzw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"playwright": "1.53.2"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.10.tgz",
|
||||
"integrity": "sha512-ENHwaH+JIRTDIEEbDK6QSQntAYGtbvdDXnMXnZaZ6k13Du1dPMmprkEHIL7ok2Wl2aZevetwTAb5S+7yIF+enA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright": {
|
||||
"version": "1.53.2",
|
||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.53.2.tgz",
|
||||
"integrity": "sha512-6K/qQxVFuVQhRQhFsVZ9fGeatxirtrpPgxzBYWyZLEXJzqYwuL4fuNmfOfD5et1tJE4GScKyPNeLhZeRwuTU3A==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"playwright-core": "1.53.2"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.53.2",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.53.2.tgz",
|
||||
"integrity": "sha512-ox/OytMy+2w1jcYEYlOo1Hhp8hZkLCximMTUTMBXjGUA1KoFfiSZ+DU+3a739jsPY0yoKH2TFy9S2fsJas8yAw==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"playwright-core": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "1.0.0",
|
||||
"description": "This is the static frontend for the Karaoke Generator web application. It's designed to be deployed on GitHub Pages with a custom domain.",
|
||||
"main": "app.js",
|
||||
"scripts": {},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"type": "commonjs",
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.53.2",
|
||||
"@types/node": "^24.0.10"
|
||||
}
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,24 +0,0 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
@@ -1,124 +0,0 @@
|
||||
# Frontend React Application
|
||||
|
||||
Modern React + TypeScript frontend for the karaoke generation web application.
|
||||
|
||||
## Tech Stack
|
||||
|
||||
- **React 18** with TypeScript
|
||||
- **Vite** for fast development and optimized builds
|
||||
- **TanStack Query** for server state management
|
||||
- **Axios** for API calls
|
||||
- **Zustand** for client state
|
||||
- **Tailwind CSS** for styling
|
||||
|
||||
## Development
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Node.js 18+ and npm
|
||||
|
||||
### Setup
|
||||
|
||||
```bash
|
||||
cd frontend-react
|
||||
npm install
|
||||
```
|
||||
|
||||
### Running Locally
|
||||
|
||||
```bash
|
||||
# Start development server
|
||||
npm run dev
|
||||
|
||||
# Access at http://localhost:5173
|
||||
```
|
||||
|
||||
### Environment Variables
|
||||
|
||||
Create a `.env.local` file:
|
||||
|
||||
```
|
||||
VITE_API_URL=http://localhost:8080/api
|
||||
```
|
||||
|
||||
For production, set `VITE_API_URL` to your Cloud Run backend URL.
|
||||
|
||||
## Building for Production
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
Output will be in the `dist/` directory, ready for deployment to Cloudflare Pages.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
src/
|
||||
├── components/ # React components
|
||||
│ ├── JobSubmission.tsx
|
||||
│ └── JobStatus.tsx
|
||||
├── hooks/ # Custom React hooks
|
||||
│ ├── useJobSubmit.ts
|
||||
│ └── useJobStatus.ts
|
||||
├── services/ # API service layer
|
||||
│ └── api.ts
|
||||
├── stores/ # Zustand state stores
|
||||
│ └── appStore.ts
|
||||
├── types/ # TypeScript types
|
||||
│ └── job.ts
|
||||
├── App.tsx # Main app component
|
||||
├── main.tsx # Entry point
|
||||
└── index.css # Global styles
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
### Job Submission
|
||||
|
||||
- Submit jobs from YouTube URLs
|
||||
- Upload audio files directly
|
||||
- Artist and title input for uploads
|
||||
|
||||
### Status Tracking
|
||||
|
||||
- Real-time job status updates with polling
|
||||
- Progress bar for active jobs
|
||||
- Timeline view of job events
|
||||
- Download links for completed jobs
|
||||
|
||||
### Error Handling
|
||||
|
||||
- User-friendly error messages
|
||||
- API error handling
|
||||
- Loading states
|
||||
|
||||
## Deployment to Cloudflare Pages
|
||||
|
||||
### Via Cloudflare Dashboard
|
||||
|
||||
1. Connect your GitHub repository
|
||||
2. Set build command: `npm run build`
|
||||
3. Set build output directory: `dist`
|
||||
4. Add environment variable: `VITE_API_URL=https://your-cloud-run-url/api`
|
||||
5. Deploy!
|
||||
|
||||
### Via Wrangler CLI
|
||||
|
||||
```bash
|
||||
npx wrangler pages deploy dist --project-name=karaoke-gen
|
||||
```
|
||||
|
||||
## API Integration
|
||||
|
||||
The frontend communicates with the FastAPI backend running on Google Cloud Run. See `src/services/api.ts` for API endpoints.
|
||||
|
||||
## Type Safety
|
||||
|
||||
TypeScript is used throughout for type safety. Types are defined in `src/types/` and match the backend API models.
|
||||
|
||||
Run type checking:
|
||||
|
||||
```bash
|
||||
npm run type-check
|
||||
```
|
||||
@@ -1,23 +0,0 @@
|
||||
import js from '@eslint/js'
|
||||
import globals from 'globals'
|
||||
import reactHooks from 'eslint-plugin-react-hooks'
|
||||
import reactRefresh from 'eslint-plugin-react-refresh'
|
||||
import tseslint from 'typescript-eslint'
|
||||
import { defineConfig, globalIgnores } from 'eslint/config'
|
||||
|
||||
export default defineConfig([
|
||||
globalIgnores(['dist']),
|
||||
{
|
||||
files: ['**/*.{ts,tsx}'],
|
||||
extends: [
|
||||
js.configs.recommended,
|
||||
tseslint.configs.recommended,
|
||||
reactHooks.configs.flat.recommended,
|
||||
reactRefresh.configs.vite,
|
||||
],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: globals.browser,
|
||||
},
|
||||
},
|
||||
])
|
||||
@@ -1,13 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>frontend-react</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
Generated
-3633
File diff suppressed because it is too large.
Load diff
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"name": "frontend-react",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "vite preview",
|
||||
"type-check": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "^5.90.11",
|
||||
"autoprefixer": "^10.4.22",
|
||||
"axios": "^1.13.2",
|
||||
"postcss": "^8.5.6",
|
||||
"react": "^19.2.0",
|
||||
"react-dom": "^19.2.0",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"zustand": "^5.0.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/react": "^19.2.5",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-react": "^5.1.1",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"eslint-plugin-react-refresh": "^0.4.24",
|
||||
"globals": "^16.5.0",
|
||||
"typescript": "~5.9.3",
|
||||
"typescript-eslint": "^8.46.4",
|
||||
"vite": "^7.2.4"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
@@ -1,42 +0,0 @@
|
||||
#root {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
height: 6em;
|
||||
padding: 1.5em;
|
||||
will-change: filter;
|
||||
transition: filter 300ms;
|
||||
}
|
||||
.logo:hover {
|
||||
filter: drop-shadow(0 0 2em #646cffaa);
|
||||
}
|
||||
.logo.react:hover {
|
||||
filter: drop-shadow(0 0 2em #61dafbaa);
|
||||
}
|
||||
|
||||
@keyframes logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
a:nth-of-type(2) .logo {
|
||||
animation: logo-spin infinite 20s linear;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
.read-the-docs {
|
||||
color: #888;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/**
|
||||
* Main App component
|
||||
*/
|
||||
import React from 'react';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { JobSubmission } from './components/JobSubmission';
|
||||
import { JobStatus } from './components/JobStatus';
|
||||
import './index.css';
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false,
|
||||
retry: 1,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100 py-12 px-4">
|
||||
<div className="max-w-4xl mx-auto">
|
||||
<header className="text-center mb-12">
|
||||
<h1 className="text-4xl font-bold text-gray-900 mb-2">
|
||||
Karaoke Generator
|
||||
</h1>
|
||||
<p className="text-gray-600">
|
||||
Generate professional karaoke videos with synchronized lyrics
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<main className="space-y-6">
|
||||
<JobSubmission />
|
||||
<JobStatus />
|
||||
</main>
|
||||
|
||||
<footer className="text-center mt-12 text-gray-500 text-sm">
|
||||
<p>Powered by Nomad Karaoke</p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
||||
|
Before Width: | Height: | Size: 4.0 KiB |
@@ -1,186 +0,0 @@
|
||||
/**
|
||||
* Job status display component with progress tracking
|
||||
*/
|
||||
import React from 'react';
|
||||
import { useJobStatus } from '../hooks/useJobStatus';
|
||||
import { JobStatus as JobStatusEnum } from '../types/job';
|
||||
import { useAppStore } from '../stores/appStore';
|
||||
|
||||
export const JobStatus: React.FC = () => {
|
||||
const currentJobId = useAppStore((state) => state.currentJobId);
|
||||
const { data: job, isLoading, isError, error } = useJobStatus(currentJobId, !!currentJobId);
|
||||
|
||||
if (!currentJobId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div className="w-full max-w-2xl mx-auto p-6 bg-white rounded-lg shadow-lg">
|
||||
<div className="animate-pulse">
|
||||
<div className="h-4 bg-gray-200 rounded w-1/4 mb-4"></div>
|
||||
<div className="h-8 bg-gray-200 rounded w-full"></div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (isError) {
|
||||
return (
|
||||
<div className="w-full max-w-2xl mx-auto p-6 bg-white rounded-lg shadow-lg">
|
||||
<div className="bg-red-50 border border-red-200 rounded-md p-4">
|
||||
<h3 className="text-red-800 font-medium mb-2">Error Loading Job</h3>
|
||||
<p className="text-red-600 text-sm">{error.message}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!job) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const getStatusColor = (status: JobStatusEnum) => {
|
||||
switch (status) {
|
||||
case JobStatusEnum.QUEUED:
|
||||
return 'bg-gray-500';
|
||||
case JobStatusEnum.PROCESSING:
|
||||
case JobStatusEnum.FINALIZING:
|
||||
return 'bg-blue-500';
|
||||
case JobStatusEnum.COMPLETE:
|
||||
return 'bg-green-500';
|
||||
case JobStatusEnum.ERROR:
|
||||
return 'bg-red-500';
|
||||
default:
|
||||
return 'bg-gray-500';
|
||||
}
|
||||
};
|
||||
|
||||
const getStatusText = (status: JobStatusEnum) => {
|
||||
switch (status) {
|
||||
case JobStatusEnum.QUEUED:
|
||||
return 'Queued';
|
||||
case JobStatusEnum.PROCESSING:
|
||||
return 'Processing';
|
||||
case JobStatusEnum.FINALIZING:
|
||||
return 'Finalizing';
|
||||
case JobStatusEnum.COMPLETE:
|
||||
return 'Complete';
|
||||
case JobStatusEnum.ERROR:
|
||||
return 'Error';
|
||||
default:
|
||||
return status;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="w-full max-w-2xl mx-auto p-6 bg-white rounded-lg shadow-lg mt-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h3 className="text-xl font-bold text-gray-800">
|
||||
Job Status: {job.job_id}
|
||||
</h3>
|
||||
<span
|
||||
className={`px-3 py-1 rounded-full text-white text-sm font-medium ${getStatusColor(
|
||||
job.status
|
||||
)}`}
|
||||
>
|
||||
{getStatusText(job.status)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Progress Bar */}
|
||||
{(job.status === JobStatusEnum.PROCESSING || job.status === JobStatusEnum.FINALIZING) && (
|
||||
<div className="mb-4">
|
||||
<div className="flex justify-between text-sm text-gray-600 mb-2">
|
||||
<span>Progress</span>
|
||||
<span>{job.progress}%</span>
|
||||
</div>
|
||||
<div className="w-full bg-gray-200 rounded-full h-2">
|
||||
<div
|
||||
className="bg-blue-600 h-2 rounded-full transition-all duration-300"
|
||||
style={{ width: `${job.progress}%` }}
|
||||
></div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Job Details */}
|
||||
<div className="space-y-2 text-sm">
|
||||
{job.artist && job.title && (
|
||||
<p className="text-gray-700">
|
||||
<span className="font-medium">Track:</span> {job.artist} - {job.title}
|
||||
</p>
|
||||
)}
|
||||
{job.url && (
|
||||
<p className="text-gray-700">
|
||||
<span className="font-medium">Source:</span> {job.url}
|
||||
</p>
|
||||
)}
|
||||
{job.filename && (
|
||||
<p className="text-gray-700">
|
||||
<span className="font-medium">File:</span> {job.filename}
|
||||
</p>
|
||||
)}
|
||||
<p className="text-gray-600">
|
||||
<span className="font-medium">Created:</span>{' '}
|
||||
{new Date(job.created_at).toLocaleString()}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Error Message */}
|
||||
{job.status === JobStatusEnum.ERROR && job.error_message && (
|
||||
<div className="mt-4 bg-red-50 border border-red-200 rounded-md p-4">
|
||||
<h4 className="text-red-800 font-medium mb-2">Error Details</h4>
|
||||
<p className="text-red-600 text-sm">{job.error_message}</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Download Links */}
|
||||
{job.status === JobStatusEnum.COMPLETE && job.download_urls && (
|
||||
<div className="mt-4">
|
||||
<h4 className="font-medium text-gray-800 mb-3">Download Results</h4>
|
||||
<div className="space-y-2">
|
||||
{Object.entries(job.download_urls).map(([key, url]) => (
|
||||
<a
|
||||
key={key}
|
||||
href={url}
|
||||
download
|
||||
className="block px-4 py-2 bg-green-50 border border-green-200 rounded-md text-green-700 hover:bg-green-100 transition-colors"
|
||||
>
|
||||
Download {key.replace(/_/g, ' ')}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Timeline */}
|
||||
{job.timeline && job.timeline.length > 0 && (
|
||||
<details className="mt-4">
|
||||
<summary className="cursor-pointer text-sm font-medium text-gray-700">
|
||||
View Timeline ({job.timeline.length} events)
|
||||
</summary>
|
||||
<div className="mt-2 space-y-2 pl-4 border-l-2 border-gray-200">
|
||||
{job.timeline.map((event, index) => (
|
||||
<div key={index} className="text-sm">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="font-medium text-gray-700">{event.status}</span>
|
||||
{event.progress !== undefined && (
|
||||
<span className="text-gray-500">({event.progress}%)</span>
|
||||
)}
|
||||
</div>
|
||||
{event.message && (
|
||||
<p className="text-gray-600">{event.message}</p>
|
||||
)}
|
||||
<p className="text-gray-400 text-xs">
|
||||
{new Date(event.timestamp).toLocaleString()}
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</details>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
/**
|
||||
* Job submission component with URL input and file upload
|
||||
*/
|
||||
import React, { useState } from 'react';
|
||||
import { useSubmitJobFromUrl, useSubmitJobFromUpload } from '../hooks/useJobSubmit';
|
||||
import { useAppStore } from '../stores/appStore';
|
||||
|
||||
export const JobSubmission: React.FC = () => {
|
||||
const [url, setUrl] = useState('');
|
||||
const [file, setFile] = useState<File | null>(null);
|
||||
const [artist, setArtist] = useState('');
|
||||
const [title, setTitle] = useState('');
|
||||
const [mode, setMode] = useState<'url' | 'upload'>('url');
|
||||
|
||||
const { isUploadMode, setUploadMode } = useAppStore();
|
||||
const setCurrentJobId = useAppStore((state) => state.setCurrentJobId);
|
||||
|
||||
const submitFromUrl = useSubmitJobFromUrl();
|
||||
const submitFromUpload = useSubmitJobFromUpload();
|
||||
|
||||
const handleSubmitUrl = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
const response = await submitFromUrl.mutateAsync({ url });
|
||||
setCurrentJobId(response.job_id);
|
||||
setUrl('');
|
||||
} catch (error) {
|
||||
console.error('Error submitting job:', error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleSubmitUpload = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!file) return;
|
||||
|
||||
try {
|
||||
const response = await submitFromUpload.mutateAsync({ file, artist, title });
|
||||
setCurrentJobId(response.job_id);
|
||||
setFile(null);
|
||||
setArtist('');
|
||||
setTitle('');
|
||||
} catch (error) {
|
||||
console.error('Error uploading file:', error);
|
||||
}
|
||||
};
|
||||
|
||||
const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
if (e.target.files && e.target.files.length > 0) {
|
||||
setFile(e.target.files[0]);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="w-full max-w-2xl mx-auto p-6 bg-white rounded-lg shadow-lg">
|
||||
<h2 className="text-2xl font-bold mb-6 text-gray-800">Create Karaoke Video</h2>
|
||||
|
||||
{/* Mode Toggle */}
|
||||
<div className="flex gap-4 mb-6">
|
||||
<button
|
||||
onClick={() => setMode('url')}
|
||||
className={`flex-1 py-2 px-4 rounded-md font-medium transition-colors ${
|
||||
mode === 'url'
|
||||
? 'bg-blue-600 text-white'
|
||||
: 'bg-gray-200 text-gray-700 hover:bg-gray-300'
|
||||
}`}
|
||||
>
|
||||
From URL
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setMode('upload')}
|
||||
className={`flex-1 py-2 px-4 rounded-md font-medium transition-colors ${
|
||||
mode === 'upload'
|
||||
? 'bg-blue-600 text-white'
|
||||
: 'bg-gray-200 text-gray-700 hover:bg-gray-300'
|
||||
}`}
|
||||
>
|
||||
Upload File
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* URL Mode */}
|
||||
{mode === 'url' && (
|
||||
<form onSubmit={handleSubmitUrl} className="space-y-4">
|
||||
<div>
|
||||
<label htmlFor="url" className="block text-sm font-medium text-gray-700 mb-2">
|
||||
YouTube URL or Audio Link
|
||||
</label>
|
||||
<input
|
||||
type="url"
|
||||
id="url"
|
||||
value={url}
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
placeholder="https://www.youtube.com/watch?v=..."
|
||||
required
|
||||
className="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={submitFromUrl.isPending || !url}
|
||||
className="w-full py-3 px-4 bg-blue-600 text-white font-medium rounded-md hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
{submitFromUrl.isPending ? 'Submitting...' : 'Generate Karaoke'}
|
||||
</button>
|
||||
{submitFromUrl.isError && (
|
||||
<p className="text-red-600 text-sm mt-2">
|
||||
Error: {submitFromUrl.error.message}
|
||||
</p>
|
||||
)}
|
||||
</form>
|
||||
)}
|
||||
|
||||
{/* Upload Mode */}
|
||||
{mode === 'upload' && (
|
||||
<form onSubmit={handleSubmitUpload} className="space-y-4">
|
||||
<div>
|
||||
<label htmlFor="file" className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Audio File
|
||||
</label>
|
||||
<input
|
||||
type="file"
|
||||
id="file"
|
||||
onChange={handleFileChange}
|
||||
accept=".mp3,.wav,.flac,.m4a,.ogg"
|
||||
required
|
||||
className="w-full px-4 py-2 border border-gray-300 rounded-md file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100"
|
||||
/>
|
||||
{file && (
|
||||
<p className="text-sm text-gray-600 mt-2">
|
||||
Selected: {file.name} ({(file.size / 1024 / 1024).toFixed(2)} MB)
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label htmlFor="artist" className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Artist
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="artist"
|
||||
value={artist}
|
||||
onChange={(e) => setArtist(e.target.value)}
|
||||
placeholder="Artist name"
|
||||
required
|
||||
className="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="title" className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Song Title
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
id="title"
|
||||
value={title}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
placeholder="Song title"
|
||||
required
|
||||
className="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="submit"
|
||||
disabled={submitFromUpload.isPending || !file || !artist || !title}
|
||||
className="w-full py-3 px-4 bg-blue-600 text-white font-medium rounded-md hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed transition-colors"
|
||||
>
|
||||
{submitFromUpload.isPending ? 'Uploading...' : 'Upload and Generate'}
|
||||
</button>
|
||||
{submitFromUpload.isError && (
|
||||
<p className="text-red-600 text-sm mt-2">
|
||||
Error: {submitFromUpload.error.message}
|
||||
</p>
|
||||
)}
|
||||
</form>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Job status hook using TanStack Query with polling
|
||||
*/
|
||||
import { useQuery, UseQueryResult } from '@tanstack/react-query';
|
||||
import { apiService } from '../services/api';
|
||||
import { Job, JobStatus } from '../types/job';
|
||||
|
||||
export function useJobStatus(jobId: string | null, enabled: boolean = true): UseQueryResult<Job, Error> {
|
||||
return useQuery({
|
||||
queryKey: ['job', jobId],
|
||||
queryFn: () => apiService.getJob(jobId!),
|
||||
enabled: enabled && !!jobId,
|
||||
refetchInterval: (data) => {
|
||||
// Poll every 3 seconds if job is in progress
|
||||
if (data?.status === JobStatus.PROCESSING ||
|
||||
data?.status === JobStatus.QUEUED ||
|
||||
data?.status === JobStatus.FINALIZING) {
|
||||
return 3000;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function useJobsList(): UseQueryResult<Job[], Error> {
|
||||
return useQuery({
|
||||
queryKey: ['jobs'],
|
||||
queryFn: () => apiService.listJobs(),
|
||||
refetchInterval: 10000, // Poll every 10 seconds
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* Job submission hook using TanStack Query
|
||||
*/
|
||||
import { useMutation, UseMutationResult } from '@tanstack/react-query';
|
||||
import { apiService } from '../services/api';
|
||||
import { JobCreateResponse } from '../types/job';
|
||||
|
||||
interface SubmitFromUrlParams {
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface SubmitFromUploadParams {
|
||||
file: File;
|
||||
artist: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export function useSubmitJobFromUrl(): UseMutationResult<JobCreateResponse, Error, SubmitFromUrlParams> {
|
||||
return useMutation({
|
||||
mutationFn: ({ url }: SubmitFromUrlParams) => apiService.createJobFromUrl(url),
|
||||
});
|
||||
}
|
||||
|
||||
export function useSubmitJobFromUpload(): UseMutationResult<JobCreateResponse, Error, SubmitFromUploadParams> {
|
||||
return useMutation({
|
||||
mutationFn: ({ file, artist, title }: SubmitFromUploadParams) =>
|
||||
apiService.uploadFile(file, artist, title),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
:root {
|
||||
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-width: 320px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './index.css'
|
||||
import App from './App.tsx'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
)
|
||||
@@ -1,81 +0,0 @@
|
||||
/**
|
||||
* API client service for karaoke generation backend
|
||||
*/
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
import { Job, JobCreateResponse, HealthResponse } from '../types/job';
|
||||
|
||||
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8080/api';
|
||||
|
||||
class ApiService {
|
||||
private client: AxiosInstance;
|
||||
|
||||
constructor() {
|
||||
this.client = axios.create({
|
||||
baseURL: API_URL,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Health check
|
||||
*/
|
||||
async health(): Promise<HealthResponse> {
|
||||
const response = await this.client.get<HealthResponse>('/health');
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create job from URL (YouTube, etc.)
|
||||
*/
|
||||
async createJobFromUrl(url: string): Promise<JobCreateResponse> {
|
||||
const response = await this.client.post<JobCreateResponse>('/jobs', { url });
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload file and create job
|
||||
*/
|
||||
async uploadFile(file: File, artist: string, title: string): Promise<JobCreateResponse> {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('artist', artist);
|
||||
formData.append('title', title);
|
||||
|
||||
const response = await this.client.post<JobCreateResponse>('/upload', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get job status and details
|
||||
*/
|
||||
async getJob(jobId: string): Promise<Job> {
|
||||
const response = await this.client.get<Job>(`/jobs/${jobId}`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* List all jobs
|
||||
*/
|
||||
async listJobs(): Promise<Job[]> {
|
||||
const response = await this.client.get<Job[]>('/jobs');
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete job
|
||||
*/
|
||||
async deleteJob(jobId: string, deleteFiles: boolean = true): Promise<void> {
|
||||
await this.client.delete(`/jobs/${jobId}`, {
|
||||
params: { delete_files: deleteFiles },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const apiService = new ApiService();
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Global application store using Zustand
|
||||
*/
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface AppState {
|
||||
currentJobId: string | null;
|
||||
setCurrentJobId: (jobId: string | null) => void;
|
||||
|
||||
isUploadMode: boolean;
|
||||
setUploadMode: (mode: boolean) => void;
|
||||
}
|
||||
|
||||
export const useAppStore = create<AppState>((set) => ({
|
||||
currentJobId: null,
|
||||
setCurrentJobId: (jobId) => set({ currentJobId: jobId }),
|
||||
|
||||
isUploadMode: false,
|
||||
setUploadMode: (mode) => set({ isUploadMode: mode }),
|
||||
}));
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* Job TypeScript types
|
||||
*/
|
||||
|
||||
export enum JobStatus {
|
||||
QUEUED = 'queued',
|
||||
PROCESSING = 'processing',
|
||||
AWAITING_REVIEW = 'awaiting_review',
|
||||
READY_FOR_FINALIZATION = 'ready_for_finalization',
|
||||
FINALIZING = 'finalizing',
|
||||
COMPLETE = 'complete',
|
||||
ERROR = 'error',
|
||||
}
|
||||
|
||||
export interface TimelineEvent {
|
||||
status: string;
|
||||
timestamp: string;
|
||||
progress?: number;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface Job {
|
||||
job_id: string;
|
||||
status: JobStatus;
|
||||
progress: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
url?: string;
|
||||
artist?: string;
|
||||
title?: string;
|
||||
filename?: string;
|
||||
track_output_dir?: string;
|
||||
audio_hash?: string;
|
||||
timeline: TimelineEvent[];
|
||||
output_files: Record<string, string>;
|
||||
download_urls: Record<string, string>;
|
||||
error_message?: string;
|
||||
}
|
||||
|
||||
export interface JobCreateResponse {
|
||||
status: string;
|
||||
job_id: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface HealthResponse {
|
||||
status: string;
|
||||
service: string;
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: [
|
||||
"./index.html",
|
||||
"./src/**/*.{js,ts,jsx,tsx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {},
|
||||
},
|
||||
plugins: [],
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"types": ["vite/client"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{ "path": "./tsconfig.app.json" },
|
||||
{ "path": "./tsconfig.node.json" }
|
||||
]
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
"target": "ES2023",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedSideEffectImports": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
})
|
||||
File renamed without changes.
File renamed without changes.
@@ -4,40 +4,40 @@
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
:root {
|
||||
/* Karaoke theme with vibrant pink/magenta primary and gold accents on dark background */
|
||||
--background: oklch(0.15 0.01 270); /* Dark charcoal with slight blue tint */
|
||||
--foreground: oklch(0.95 0.01 270); /* Light gray/white */
|
||||
--card: oklch(0.18 0.015 270); /* Slightly lighter than background */
|
||||
--card-foreground: oklch(0.95 0.01 270);
|
||||
--popover: oklch(0.18 0.015 270);
|
||||
--popover-foreground: oklch(0.95 0.01 270);
|
||||
--primary: oklch(0.58 0.24 345); /* Vibrant pink/magenta #E91E8C */
|
||||
--primary-foreground: oklch(0.98 0.01 0); /* White for contrast */
|
||||
--secondary: oklch(0.75 0.15 85); /* Gold/yellow #FFD54F */
|
||||
--secondary-foreground: oklch(0.15 0.01 270); /* Dark text on gold */
|
||||
--muted: oklch(0.25 0.015 270);
|
||||
--muted-foreground: oklch(0.65 0.01 270);
|
||||
--accent: oklch(0.58 0.24 345); /* Same as primary for consistency */
|
||||
/* Nomad Karaoke brand colors - matching nomadkaraoke.com */
|
||||
--background: oklch(0.22 0.04 260); /* Dark slate blue #2b3544 */
|
||||
--foreground: oklch(0.95 0.01 0); /* White text */
|
||||
--card: oklch(0.26 0.04 260); /* Slightly lighter slate for cards */
|
||||
--card-foreground: oklch(0.95 0.01 0);
|
||||
--popover: oklch(0.26 0.04 260);
|
||||
--popover-foreground: oklch(0.95 0.01 0);
|
||||
--primary: oklch(0.68 0.22 340); /* Pink #ff7acc */
|
||||
--primary-foreground: oklch(0.98 0.01 0);
|
||||
--secondary: oklch(0.78 0.15 85); /* Gold/yellow #ffc857 */
|
||||
--secondary-foreground: oklch(0.15 0.01 270);
|
||||
--muted: oklch(0.3 0.04 260);
|
||||
--muted-foreground: oklch(0.65 0.01 260);
|
||||
--accent: oklch(0.68 0.22 340);
|
||||
--accent-foreground: oklch(0.98 0.01 0);
|
||||
--destructive: oklch(0.55 0.22 25);
|
||||
--destructive-foreground: oklch(0.98 0.01 0);
|
||||
--border: oklch(0.28 0.015 270);
|
||||
--input: oklch(0.28 0.015 270);
|
||||
--ring: oklch(0.58 0.24 345);
|
||||
--chart-1: oklch(0.58 0.24 345);
|
||||
--chart-2: oklch(0.75 0.15 85);
|
||||
--border: oklch(0.32 0.04 260);
|
||||
--input: oklch(0.32 0.04 260);
|
||||
--ring: oklch(0.68 0.22 340);
|
||||
--chart-1: oklch(0.68 0.22 340);
|
||||
--chart-2: oklch(0.78 0.15 85);
|
||||
--chart-3: oklch(0.55 0.2 280);
|
||||
--chart-4: oklch(0.6 0.18 180);
|
||||
--chart-5: oklch(0.65 0.2 60);
|
||||
--radius: 0.5rem;
|
||||
--sidebar: oklch(0.18 0.015 270);
|
||||
--sidebar-foreground: oklch(0.95 0.01 270);
|
||||
--sidebar-primary: oklch(0.58 0.24 345);
|
||||
--sidebar: oklch(0.26 0.04 260);
|
||||
--sidebar-foreground: oklch(0.95 0.01 0);
|
||||
--sidebar-primary: oklch(0.68 0.22 340);
|
||||
--sidebar-primary-foreground: oklch(0.98 0.01 0);
|
||||
--sidebar-accent: oklch(0.25 0.015 270);
|
||||
--sidebar-accent-foreground: oklch(0.95 0.01 270);
|
||||
--sidebar-border: oklch(0.28 0.015 270);
|
||||
--sidebar-ring: oklch(0.58 0.24 345);
|
||||
--sidebar-accent: oklch(0.3 0.04 260);
|
||||
--sidebar-accent-foreground: oklch(0.95 0.01 0);
|
||||
--sidebar-border: oklch(0.32 0.04 260);
|
||||
--sidebar-ring: oklch(0.68 0.22 340);
|
||||
}
|
||||
|
||||
@theme inline {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,143 @@
|
||||
"use client"
|
||||
|
||||
import type React from "react"
|
||||
|
||||
import { useState } from "react"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { useAuth } from "@/lib/auth"
|
||||
import { Logo } from "@/components/logo"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Sparkles } from "lucide-react"
|
||||
|
||||
export default function LandingPage() {
|
||||
const [token, setToken] = useState("")
|
||||
const [error, setError] = useState("")
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const { login } = useAuth()
|
||||
const router = useRouter()
|
||||
|
||||
const handleLogin = async (e: React.FormEvent) => {
|
||||
e.preventDefault()
|
||||
setError("")
|
||||
setIsLoading(true)
|
||||
|
||||
if (!token.trim()) {
|
||||
setError("Please enter your access token")
|
||||
setIsLoading(false)
|
||||
return
|
||||
}
|
||||
|
||||
const success = await login(token)
|
||||
setIsLoading(false)
|
||||
|
||||
if (success) {
|
||||
router.push("/dashboard")
|
||||
} else {
|
||||
setError("Invalid token. Please try again.")
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-gradient-to-b from-background via-background to-card">
|
||||
{/* Animated background effects */}
|
||||
<div className="fixed inset-0 -z-10 overflow-hidden">
|
||||
<div className="absolute top-1/4 left-1/4 w-96 h-96 bg-primary/10 rounded-full blur-3xl animate-pulse" />
|
||||
<div className="absolute bottom-1/4 right-1/4 w-96 h-96 bg-secondary/10 rounded-full blur-3xl animate-pulse delay-1000" />
|
||||
</div>
|
||||
|
||||
<div className="container mx-auto px-4 py-8 lg:py-12">
|
||||
{/* Hero Section - horizontal layout on desktop */}
|
||||
<div className="max-w-6xl mx-auto">
|
||||
<div className="grid lg:grid-cols-2 gap-8 lg:gap-12 items-center">
|
||||
{/* Left: Hero Content */}
|
||||
<div className="text-center lg:text-left">
|
||||
<Logo size="lg" className="mb-8 justify-center lg:justify-start" />
|
||||
|
||||
<div className="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-6">
|
||||
<Sparkles className="w-4 h-4 text-primary" />
|
||||
<span className="text-sm text-primary font-medium">AI-Powered Karaoke Generation</span>
|
||||
</div>
|
||||
|
||||
<h1 className="text-4xl md:text-4xl lg:text-4xl font-bold mb-4 text-balance leading-tight">
|
||||
Wherever you are, <span className="text-primary">sing!</span>
|
||||
</h1>
|
||||
|
||||
<p className="text-base md:text-lg text-muted-foreground text-pretty leading-relaxed">
|
||||
Transform any song into professional karaoke videos with AI-powered vocal separation, synchronized
|
||||
lyrics, and stunning visuals.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Right: Login Card */}
|
||||
<div>
|
||||
<Card className="border-border/50 backdrop-blur">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-2xl">Get Started</CardTitle>
|
||||
<CardDescription>Enter your access token to begin creating karaoke videos</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={handleLogin} className="space-y-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="token">Access Token</Label>
|
||||
<Input
|
||||
id="token"
|
||||
type="text"
|
||||
placeholder="Enter your token"
|
||||
value={token}
|
||||
onChange={(e) => setToken(e.target.value)}
|
||||
className="bg-background"
|
||||
/>
|
||||
{error && <p className="text-sm text-destructive">{error}</p>}
|
||||
</div>
|
||||
|
||||
<Button type="submit" className="w-full bg-primary hover:bg-primary/90" disabled={isLoading}>
|
||||
{isLoading ? "Logging in..." : "Login"}
|
||||
</Button>
|
||||
|
||||
<div className="text-center text-sm text-muted-foreground">
|
||||
Don't have access?{" "}
|
||||
<a href="#" className="text-primary hover:underline">
|
||||
Request a token
|
||||
</a>{" "}
|
||||
or{" "}
|
||||
<a href="#" className="text-primary hover:underline">
|
||||
purchase access
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div className="pt-4 border-t border-border">
|
||||
<p className="text-xs text-muted-foreground mb-2">Demo tokens:</p>
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="flex-1 text-xs bg-transparent"
|
||||
onClick={() => setToken("demo-user-token")}
|
||||
>
|
||||
User Demo
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="flex-1 text-xs bg-transparent"
|
||||
onClick={() => setToken("demo-admin-token")}
|
||||
>
|
||||
Admin Demo
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
File renamed without changes.
+2
-2
@@ -29,8 +29,8 @@ export function AppHeader() {
|
||||
return (
|
||||
<header className="sticky top-0 z-50 border-b border-border/50 bg-background/80 backdrop-blur supports-[backdrop-filter]:bg-background/60">
|
||||
<div className="container mx-auto px-4 h-16 flex items-center justify-between">
|
||||
<Link href="/dashboard">
|
||||
<Logo />
|
||||
<Link href="/dashboard" className="h-10">
|
||||
<Logo className="h-10" />
|
||||
</Link>
|
||||
|
||||
<nav className="hidden md:flex items-center gap-6">
|
||||
@@ -0,0 +1,18 @@
|
||||
import Image from "next/image"
|
||||
|
||||
export function Logo({ className = "", size = "sm" }: { className?: string; size?: "sm" | "lg" }) {
|
||||
const sizeClasses = size === "lg" ? "max-w-[600px] max-h-[120px]" : "max-w-[200px] max-h-10"
|
||||
|
||||
return (
|
||||
<div className={`flex items-center ${className}`}>
|
||||
<Image
|
||||
src="https://nomadkaraoke.com/wp-content/uploads/2024/07/Nomad-Karaoke-Logo-TextOnly-Cropped-FromSVG-HQ-2048x1088.png"
|
||||
alt="Nomad Karaoke"
|
||||
width={200}
|
||||
height={106}
|
||||
className={`w-auto h-auto ${sizeClasses} object-contain`}
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 141 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user