Skip to content
Projects

88lin/lofi-radio-web

View on GitHub

88lin/lofi-radio-web has 99 GitHub stars and 25 forks. GitHot measured +1 stars in 24 hours and +3 in 7 days. Last checked 2026-11-17 03:14 UTC. Last push 2026-11-09.

How these counts are measured

Measured star growth

in 24h
+1
in 7 days
+3
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

一个为专注场景而做的 Lofi Radio 网页版。Lofi音乐因节奏平稳、旋律循环、干扰较少,长期被公认为学习和工作场景中更适合作为背景音的音乐类型之一。项目采用 macOS 风格灵动岛设计,收录 21 个精选电台,打开即用,无需下载。

Productivity

README.en-US.md

Original

🎧 Lofi Radio Web

🌐 简体中文 · English

Lofi Radio Next.js TypeScript License

With steady rhythms, minimal vocals, and a relaxed atmosphere, Lofi (Low Fidelity) music is a natural fit for studying, working, and creating.

Featuring a macOS-style Dynamic Island design and 21 curated stations. Open the site and listen with no account or download required.

🎧 Live Experience · ✨ Features · 🚀 Quick Start · ☁️ Deployment Guide · 💬 Discussions


🖼️ Home Preview

Lofi Radio Web dark-mode home preview

Dark mode · Dynamic Island player, live focus clock, and keyboard controls


📖 Project Introduction

Lofi Radio Web is a web-based implementation of labilio/lofi-radio, transforming the original Electron desktop application into a modern Web application.

It's like bringing the background music of a coffee shop into your study — no local audio files needed, no need to pick playlists, just open the page and listen.

🎯 Design Philosophy

  • Focus Experience: A compact Dynamic Island player that stays present without getting in the way.
  • Cross-Platform: A responsive web experience for desktop and mobile devices.
  • Instant Use: No registration, login, download, or local music library required.
  • PWA Support: Installable as a standalone window for a more app-like experience.

🧠 Why Lofi is Suitable for Focus

Lofi (Low Fidelity) music is often used for high-concentration tasks such as studying, programming, writing, and office work. Its typical characteristics include:

  • Slow and steady tempo (usually 60-90 BPM)
  • Simple melodies with a strong sense of loop
  • Minimal or no lyrics
  • Soft tones, often accompanied by rain sounds, vinyl crackle, or ambient noise
  • Restrained emotion, avoiding artificial climaxes

These characteristics can make Lofi a less distracting choice for background listening:

  1. Fewer linguistic interruptions: Minimal vocals are less likely to interrupt language-heavy work such as reading, writing, or coding.
  2. A predictable listening pattern: Steady rhythms and loops avoid abrupt changes during longer sessions.
  3. A gentle sense of presence: Soft textures can fill an overly quiet room without forcing an emotional climax.

[!NOTE] Music affects everyone differently. Choose a sound and volume that suit your task, preferences, and environment.


✨ Features

🎵 Music Playback

Feature Description
21 Curated Stations Covers various styles including Lofi, Chillhop, Jazz, Classical, Hip-Hop, Ambient, and more
Bilibili Live Sources Supports the Lofi Girl Bilibili stream with HLS/FLV candidates and recovery paths
Global Streaming Sources Integrates sources like Lofi Cafe, SomaFM, Code Radio, Swiss Classic, etc.
Quick Switching Switch stations with one click and automatically load the selected stream

🎨 Interface Design

Feature Description
Dynamic Island Player macOS-style Dynamic Island design, freely draggable to any position on the screen
Glassmorphism Effect Uses blur and layered transparency to keep the interface visually light
Vinyl Animation Beautiful rotating vinyl record animation that triggers during playback
Dark/Light Themes One-click switching or automatic synchronization with system theme
Responsive Design Adapts the experience to desktop and mobile screen sizes

⌨️ Keyboard Shortcuts

Shortcut Function
Space Play / Pause
← Previous Station
→ Next Station
M Mute / Unmute
T Switch Theme (Dark/Light)

⏱️ Focus Timer

  • Tracks daily focus duration (only counts while playing)
  • Helps cultivate efficient work habits
  • Data stored locally, automatically resets daily

🌙 Sleep Timer

  • Fast presets for 15/30/45/60/90/120 minutes
  • Custom duration from 1 to 480 minutes
  • Automatically pauses playback when the timer ends
  • Sleep timer state supports local persistence

📻 Station List (21 Total)

Study (3)

Station Genre Tags Note
Lofi Girl Lofi / Chill Bilibili live source, Bilibili-friendly
Lofi Box Lofi / Chill Classic Lofi stream
Lofi Studying Lofi / Study Specifically for studying scenarios

Programming (2)

Station Genre Tags Note
Groove Salad Chill / Ambient Friendly for long coding sessions
Code Radio Lofi / Coding freeCodeCamp programming radio

Reading (4)

Station Genre Tags Note
Chill Sky Chill / Electro Light electronic atmosphere
Lofi Japanese Japanese / Lofi Japanese-style Lofi vibes
Jazz Box Jazz / Smooth Smooth jazz stream
B3cks Radio Lofi / Relax Relaxation-oriented Lofi

Relaxing (3)

Station Genre Tags Note
Chill Wave Chill / Electro Ambient electronic
Lofi Chilling Lofi / Chill Low-pressure companion background audio
Paradise Chill / Alt Diverse relaxing styles

Sleep (4)

Station Genre Tags Note
Rain Sounds Ambient / Nature White noise and nature sounds
Lofi Sleeping Lofi / Sleep Low-stimulus stream for bedtime
Drone Zone Ambient / Deep Deep ambient sound wall
ASP Ambient / Sleep Minimalist sleep atmosphere

Focus (1)

Station Genre Tags Note
Swiss Classic Classical / Symphony Classical symphony for focus

Others (4)

Station Genre Tags Scenario
Jazz Groove Jazz / Groove Writing
Jazz Smooth Jazz / Mellow Office Work
Rap Beats Hip-Hop / Beats Exercise
Lofi Gaming Lofi / Gaming Entertainment

[!NOTE] This repository does not host station audio. Third-party streams may become temporarily unavailable because of upstream maintenance, regional restrictions, or network conditions. Try another station if a stream fails.


🧰 Tech Stack

Tech Description
Next.js 16 Full-stack React framework, App Router
React 19 UI Library
TypeScript Type safety
Tailwind CSS v4 Utility-first CSS
Framer Motion Animation library
Zustand Lightweight state management
HLS.js HLS streaming playback
flv.js Bilibili FLV live stream playback
Lucide Icons Icon library

🚀 Quick Start

Prerequisites

  • Node.js 20.9 or higher (required by Next.js 16)
  • npm, yarn, pnpm, or bun

[!TIP] The repository includes package-lock.json. Use npm ci for a reproducible first install or in CI, and use npm install when intentionally updating dependencies.

Local Development

# Clone the repository
git clone https://github.com/88lin/lofi-radio-web.git
cd lofi-radio-web

# Install locked dependencies
npm ci

# Start development server
npm run dev

Open http://localhost:3000 in your browser.

Production Build

# Build the project
npm run build

# Start production server
npm run start

☁️ Deployment Guide

[!TIP] Before deploying your own copy, fork this repository.

  1. Visit the lofi-radio-web repository homepage.
  2. Click the Fork button in the top right.
  3. Once complete, you will see a copy of the lofi-radio-web repository under your own GitHub account.

The deployment options below assume that you are using your fork.

Pre-deployment Checklist

[!IMPORTANT] This project includes server-side APIs and is not a static site. The platform must support the Next.js Node.js server runtime and permit outbound server requests.

The runtime must provide:

  • Runtime requirement: Node.js >= 20.9.0
  • Application type: Standard Next.js server-side application (not a pure static site)
  • API dependency: /api/bilibili-stream explicitly uses the Node.js runtime
  • Outbound access: The deployment environment must allow server-side access to api.live.bilibili.com and api.github.com

Bilibili bandwidth and proxies

  • Streams connect only after a play request. Pausing cancels pending resolution, playlist probes, and media downloads. Resuming reconnects to the live stream and resolves fresh Bilibili URLs, so a short buffering period is possible and the previous playback position is not preserved.
  • Bilibili selection probes at most two playlists at once, giving compatible candidates in different formats an early opportunity, then starts one player. Probes do not fetch media fragments, and HLS/FLV fallbacks remain available. This can reduce startup delays from trying slow candidates serially; results still depend on the network and CDN.
  • Bilibili playback through hls.js targets a position five segments behind the live edge to leave more buffer for brief network interruptions. Actual latency depends on the upstream playlist. This does not reduce bandwidth usage or eliminate stalls when sustained bandwidth is insufficient.
  • The Bilibili stream API requests the low quality tier (qn=80) for stations such as Lofi Girl. Bilibili may return a higher actual tier (for example, current_qn=250); this is a best-effort request, with no guarantee of bandwidth savings or reduced buffering.
  • HLS/FLV streams generally still contain video. Hiding the picture, using <audio>, or setting hasVideo: false in flv.js only changes local playback processing; video data is still downloaded.
  • Fixed-URL proxies such as bili-live-flv-proxy simplify URL configuration in external players, but forwarding the original audio and video does not extract audio. This project's API only resolves URLs; browsers connect directly to the CDN using the existing HLS/FLV fallback paths, without relaying the continuous stream through the application server.
  • Substantial listener bandwidth savings require an audio-only station or a separately hosted, long-running service that removes video before sending audio to the browser. Such a service incurs upstream traffic, audio distribution, and maintenance costs; an ordinary FLV proxy does not perform this extraction.

Deploy to Vercel (Recommended)

Vercel matches the current repository structure and is the recommended hosting option.

Deploy with Vercel

  1. Click the button above, or visit the Vercel Dashboard.
  2. Import your forked lofi-radio-web repository.
  3. Keep the default Framework Preset as Next.js.
  4. Use the default Build Command, or explicitly enter npm run build.
  5. Use the default Install Command, or explicitly enter npm install.
  6. Set the Node.js version to 20.x or higher.
  7. Current default public features usually don't require extra environment variables; just click Deploy.

If you later enable databases, authentication, or other extensions in your own branch, add the corresponding environment variables then.

Deploy to Standard Node.js Server (Recommended)

If you use your own Linux server, cloud VM, PaaS, or panel, it is recommended to deploy as a standard Next.js Node service.

# Install dependencies
npm install

# Build
npm run build

# Start production service
npm run start

The default listening port is 3000. If you need a reverse proxy, you can point Nginx / Caddy directly to this port.

A reference Caddyfile is included in the repository, suitable for reverse proxying in local or self-hosted scenarios.

Docker Deployment (Recommended)

A ready-to-use Dockerfile is provided in the root directory.

# Build image
docker build -t lofi-radio-web .

# Run container
docker run -d --name lofi-radio-web -p 3000:3000 --restart unless-stopped lofi-radio-web

Once the container starts, the application will execute npm run start inside the container, exposing port 3000 by default.

Cloudflare Pages / Netlify / Other Platforms

[!CAUTION] A static export cannot provide this project's server APIs. Before using Cloudflare Pages, Netlify, or another platform, verify its Next.js server adapter, Node.js version, and outbound network policy.

Check these requirements carefully:

  • This project contains server-side APIs, not just pure static pages.
  • /api/bilibili-stream relies on the Node.js runtime and server-side outbound requests.
  • Different platforms vary significantly in their support for Next.js server runtime, adapters, Node.js versions, and network policies.

If you are familiar with these platforms, you can validate a custom setup. Otherwise, prefer:

  • Vercel
  • Standard Node.js Server
  • Docker + Reverse Proxy

🗂️ Project Structure

lofi-radio-web/
├── src/
│   ├── app/                      # Next.js App Router
│   │   ├── page.tsx             # Home server shell (emits home JSON-LD)
│   │   ├── layout.tsx           # Root layout (metadata + site-level JSON-LD)
│   │   ├── globals.css          # Global styles
│   │   ├── stations/page.tsx    # Station directory (server-rendered)
│   │   ├── faq/page.tsx         # FAQ (server-rendered)
│   │   ├── about/page.tsx       # About page (server-rendered)
│   │   ├── llms.txt/route.ts    # AI site overview (generated from data)
│   │   ├── llms-full.txt/route.ts # AI full-content file
│   │   ├── pricing.md/route.ts  # Machine-readable pricing
│   │   ├── robots.ts            # robots.txt route
│   │   ├── sitemap.ts           # sitemap.xml route
│   │   └── api/                 # API routes
│   │       └── bilibili-stream/ # Bilibili live stream parsing
│   ├── components/              # Components
│   │   ├── lofi/                # Lofi-related components
│   │   │   ├── home-client.tsx  # Home client body (player / timers / theme)
│   │   │   └── floating-player.tsx  # Floating player
│   │   ├── seo/                 # SEO components
│   │   │   └── site-chrome.tsx  # Content-page header/footer/JSON-LD
│   │   ├── ui/                  # UI base components
│   │   └── theme-provider.tsx   # Theme provider
│   ├── hooks/                   # Custom Hooks
│   │   ├── useAudioPlayer.ts    # Audio playback logic
│   │   ├── useFocusTimer.ts     # Focus timer
│   │   ├── useSleepTimer.ts     # Sleep timer
│   │   └── use-toast.ts         # Toast notifications
│   ├── lib/                     # Utility libraries
│   │   ├── stations.ts          # Station configurations
│   │   ├── seo.ts               # SEO config and metadata/schema construction
│   │   ├── seo-content.ts       # SEO copy (FAQs, definitions, comparison table)
│   │   ├── llms.ts              # llms.txt / llms-full.txt / pricing.md builders
│   │   └── utils.ts             # Utility functions
│   └── store/                   # State management
│       └── audioStore.ts        # Audio state
├── assets/                      # README image assets
├── public/                      # Static assets
│   ├── logo.svg                 # Logo
│   └── manifest.json            # PWA configuration
├── scripts/                     # Build helper scripts
│   └── submit-indexnow.ts       # Manual IndexNow submission
├── tests/                       # Unit tests (including SEO assertions)
├── package.json
├── Dockerfile
├── tailwind.config.ts
├── next.config.ts
└── LICENSE

🔄 Station Resource Maintenance

This project uses a "Base Source + Manually Curated Extensions" strategy for station resources:

  • Base reference source: labilio/lofi-radio
  • Extension sources: Lofi Cafe, SomaFM, Code Radio, and other public streaming stations.

How to update:

  1. Evaluate the availability and stability of a new station source.
  2. Update the stations array in src/lib/stations.ts.
  3. Synchronize the station list and total count in README.md and README.en-US.md.
  4. Bump siteLastUpdated in src/lib/seo-content.ts — it drives the visible "last updated" label, the sitemap lastmod, and the llms.txt header.
  5. Submit the changes.

SEO Related Files

File Purpose
src/lib/seo.ts Metadata, Open Graph, Twitter, Schema, robots and sitemap configuration
src/lib/seo-content.ts FAQs, Lofi definition block, scene comparison table, source list; holds siteLastUpdated
src/lib/llms.ts Builds llms.txt / llms-full.txt / pricing.md from station data
src/app/robots.ts /robots.txt — declares 16 AI crawlers + Bingbot one by one, disallows /api/ for all
src/app/sitemap.ts /sitemap.xml — the four indexable pages
src/app/llms.txt/route.ts /llms.txt — AI site overview
src/app/llms-full.txt/route.ts /llms-full.txt — full FAQ text and comparison table
src/app/pricing.md/route.ts /pricing.md — machine-readable pricing and limits
tests/seo.test.ts Asserts sitemap / robots / llms stay consistent with station data

Four maintenance rules

  1. Never hardcode the station count. llms.txt, pricing.md and the JSON-LD all derive it from stations.ts; the READMEs are the only place that needs a manual sync.
  2. Bump siteLastUpdated whenever copy changes. AI search weights freshness, and a stale hard-coded date is worse than none.
  3. Use native <details> for FAQs, not Radix Accordion. Radix does not render collapsed content into the DOM, so non-rendering AI crawlers see zero answers.
  4. Keep the root layout to site-level JSON-LD only (Organization + WebSite). Page-level nodes (WebPage, CollectionPage, FAQPage, ItemList) must be emitted by their own page, otherwise every sub-page also claims to be the homepage. A regression test in tests/seo.test.ts enforces this.

💬 Feedback and Collaboration

To ensure your feedback is processed as quickly as possible, please choose the correct entry point based on the content:

The repository uses structured Issue templates, PR templates, and an automated maintenance flow. The more complete your report, the faster it will be handled.

🤝 Contribution Guide

All forms of contribution are welcome, but please keep your changes focused and provide full context.

  1. Fork this repository.
  2. Create a branch, e.g., fix/player-bug or feat/new-station-source.
  3. Complete the changes and perform local self-testing.
  4. Push the branch and create a Pull Request.

Before submitting a PR, it is recommended to read CONTRIBUTING.md, which includes:

  • Recommended submission flow for Issues / PRs.
  • Local development and minimum verification commands.
  • Precautions for station sources and content maintenance.
  • Collaboration conventions friendly to new contributors.

📜 License

This project is open-sourced under the MIT License.

  • ✅ You are free to use, copy, modify, and distribute this project.
  • 📝 Please retain the original author's copyright notice in derivative works.

🙏 Acknowledgments

  • labilio/lofi-radio - Provided rich station resources and creative inspiration.
  • Lofi Girl - Provided high-quality Lofi music streams.
  • All station providers.

📬 Contact

If you have questions or suggestions, feel free to:


⭐ Star History

Star History

If this project helped you, please give it a ⭐ Star for support!

Made with ❤️ by Moling Knowledge Base · GitHub