feat: Redesign entire frontend with DAW-inspired interface
🎛️ Complete UI/UX overhaul simulating a Digital Audio Workstation ✨ New Features: - Transport Bar with Play/Stop/Next controls - Live session mode with BPM/Key/Swing stats display - Scene Matrix panel with pre-configured musical scenes - Macro Channels with real-time level visualization - Arrangement View showing chat as music clips - Project Rack for managing generated tracks 🎨 Visual Design: - Dark theme optimized for music production - Glassmorphism effects throughout - Violet/Purple gradient accents - Professional audio equipment aesthetics - Smooth animations and transitions 📁 Files Modified: - frontend/src/App.tsx: New DAW layout with transport controls - frontend/src/components/ChatInterface.tsx: Complete rewrite with DAW panels - frontend/src/index.css: New styles for DAW aesthetic - frontend/src/services/api.ts: Improved API handling 🎵 UI Panels: 1. Scene Panel: Curated scene matrix for inspiration 2. Console Panel: Chat arranged as music clips in timeline 3. Project Rack: Visual track management with meters The interface now feels like a professional music production environment, making MusiaIA's AI music generation feel native and intuitive. 🔥 Built with: - React + TypeScript - Lucide React icons - Custom CSS with glassmorphism - Inline styles for dynamic elements - Responsive design for all screen sizes Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
* Handles all communication with the FastAPI backend
|
||||
*/
|
||||
|
||||
const API_BASE_URL = 'http://localhost:8000';
|
||||
const API_BASE_URL = typeof window !== 'undefined'
|
||||
? `${window.location.protocol}//${window.location.hostname}:8000`
|
||||
: 'http://localhost:8000';
|
||||
|
||||
export interface ChatMessageRequest {
|
||||
user_id: string;
|
||||
@@ -49,44 +51,54 @@ class ApiService {
|
||||
* Send a chat message to the AI
|
||||
*/
|
||||
async sendChatMessage(message: string): Promise<ChatMessageResponse> {
|
||||
const response = await fetch(`${API_BASE_URL}/api/chat`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
user_id: this.userId,
|
||||
message,
|
||||
} as ChatMessageRequest),
|
||||
});
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/api/chat`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
user_id: this.userId,
|
||||
message,
|
||||
} as ChatMessageRequest),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Chat request failed: ${response.statusText}`);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Chat request failed: ${response.statusText}`);
|
||||
}
|
||||
|
||||
return response.json();
|
||||
} catch (error) {
|
||||
console.error('Chat API Error:', error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
return response.json();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a music project from requirements
|
||||
*/
|
||||
async generateProject(requirements: string): Promise<ProjectResponse> {
|
||||
const response = await fetch(`${API_BASE_URL}/api/generate`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
user_id: this.userId,
|
||||
requirements,
|
||||
} as ProjectRequest),
|
||||
});
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/api/generate`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
user_id: this.userId,
|
||||
requirements,
|
||||
} as ProjectRequest),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Project generation failed: ${response.statusText}`);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Project generation failed: ${response.statusText}`);
|
||||
}
|
||||
|
||||
return response.json();
|
||||
} catch (error) {
|
||||
console.error('Generate API Error:', error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
return response.json();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user