A modern, beautiful, and secure SvelteKit frontend for the Musical Zoe music API platform. Built with Svelte
& Typescript
and designed for optimal user experience across all devices. A quick deployment.
/dashboard
)/dashboard/lyrics
)/dashboard/news
)Project Setup & Configuration
Homepage & Landing
Authentication & Security
Music Dashboard
API Integration
UI/UX Excellence
Theming System
Component Library
Advanced Music Features
User Experience
Analytics & Insights
Clone the repository
git clone https://github.com/yourusername/MusicalZoe-FE.git
cd MusicalZoe-FE
Install dependencies
npm install
# or
pnpm install
# or
yarn install
Set up environment variables
cp .env.example .env
# Edit .env with your configuration
Required Environment Variables:
The .env
file contains both server-side and client-side variables:
# Server-side API Configuration (used by +server.ts files)
API_BASE_URL="http://localhost:4000/v1"
API_SIGNUP_URL="${API_BASE_URL}/api"
API_ACTIVATION_URL="${API_BASE_URL}/api/activated"
API_AUTHENTICATION_URL="${API_BASE_URL}/api/authentication"
# Server-side Music API Endpoints
MUSIC_API_NEWS_URL="${API_BASE_URL}/musical/news"
MUSIC_API_TRENDS_URL="${API_BASE_URL}/musical/trends"
MUSIC_API_LYRICS_URL="${API_BASE_URL}/musical/lyrics"
MUSIC_API_TRACK_INFO_URL="${API_BASE_URL}/musical/track-info"
# Client-side variables (accessible in browser, prefixed with VITE_)
VITE_API_BASE_URL="http://localhost:4000/v1"
VITE_APP_NAME="Musical Zoe"
VITE_DEBUG_MODE="true"
Note: Server-side variables (without VITE* prefix) are only accessible in server files like
+server.ts
and+page.server.ts
. Client-side variables (with VITE* prefix) are accessible in both server and client code.
Start development server
npm run dev
Open your browser
Navigate to http://localhost:5173
src/
āāā lib/
ā āāā web-components/
ā ā āāā homepage/ # Homepage-specific components
ā ā ā āāā Hero.svelte
ā ā ā āāā Features.svelte
ā ā ā āāā Services.svelte
ā ā ā āāā Contact.svelte
ā ā ā āāā Footer.svelte
ā ā āāā dashboard/ # Dashboard widgets
ā ā ā āāā LyricsSearchWidget.svelte
ā ā ā āāā TrendingWidget.svelte
ā ā ā āāā MusicNewsWidget.svelte
ā ā āāā ui/ # Reusable UI components
ā ā āāā Header.svelte
ā ā āāā Button.svelte
ā ā āāā Card.svelte
ā ā āāā Container.svelte
ā ā āāā ServiceCard.svelte
ā āāā types/ # TypeScript interfaces
ā ā āāā music-api.ts # API response types
ā āāā utils/ # Utility functions
ā ā āāā token-helpers.ts # Authentication utilities
ā ā āāā logger.ts # Logging utilities
ā āāā components/ # shadcn-svelte components
āāā routes/
ā āāā (home)/ # Homepage route group
ā ā āāā +layout.svelte # Homepage-specific layout
ā ā āāā +page.svelte # Homepage
ā āāā (app)/ # Protected app routes
ā ā āāā dashboard/ # Dashboard pages
ā ā ā āāā +page.svelte # Main dashboard
ā ā ā āāā lyrics/ # Lyrics search page
ā ā ā āāā news/ # Music news page
ā ā ā āāā trends/ # Trending content page
ā ā āāā +layout.svelte # App layout with auth
ā āāā api/music/ # Server-side API proxies
ā ā āāā lyrics/+server.ts
ā ā āāā news/+server.ts
ā ā āāā trends/+server.ts
ā ā āāā track-info/+server.ts
ā āāā +layout.svelte # Root layout
āāā documentation/ # Project documentation
ā āāā DASHBOARD_IMPLEMENTATION.md
ā āāā API_CONFIGURATION.md
āāā app.css # Global styles and theme variables
āāā app.html # App shell
āāā .env # Environment configuration (single file)
# Development
npm run dev # Start development server
npm run dev:host # Start server accessible on network
# Building
npm run build # Build for production
npm run preview # Preview production build
# Quality
npm run check # Run type checking
npm run check:watch # Watch mode type checking
npm run lint # Run ESLint
npm run format # Format with Prettier
This project uses a sophisticated modular component architecture:
src/lib/web-components/homepage/
): Landing page sectionssrc/lib/web-components/dashboard/
): Interactive music service widgetssrc/lib/web-components/ui/
): Reusable interface elementssrc/lib/components/ui/
): High-quality component libraryEach dashboard widget is a self-contained component:
// Example: LyricsSearchWidget.svelte
- Handles its own state with Svelte 5 runes
- Integrates with API endpoints via fetch
- Includes loading states and error handling
- Responsive design for all screen sizes
The app uses server-side proxy routes for secure API communication:
// src/routes/api/music/[service]/+server.ts
- Extracts bearer tokens from cookies
- Proxies requests to backend API
- Handles authentication and error states
- Returns typed responses to frontend
The project uses CSS variables for theming with shadcn-svelte:
/* Light mode variables */
:root {
--background: oklch(1 0 0);
--foreground: oklch(0.129 0.042 264.695);
/* ... more variables */
}
/* Dark mode variables */
.dark {
--background: oklch(0.129 0.042 264.695);
--foreground: oklch(0.984 0.003 247.858);
/* ... more variables */
}
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
/documentation
folder for detailed implementation guidesThe project follows a comprehensive design system:
Built with ā¤ļø using SvelteKit, and modern web technologies