Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data/
# Uploads folder (if you have one)
uploads/
server/uploads/
Extra_docs

# Session store
sessions/
Expand Down
7 changes: 5 additions & 2 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" href="/app-icon.svg" />
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="theme-color" content="#10131A" />
<meta name="theme-color" content="#0a0b0d" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Beacon</title>
<title>Beacon — Watch & Share Directly</title>
<meta name="description" content="Watch videos in sync and send files directly between browsers." />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600&family=JetBrains+Mono:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
<script>
// Polyfill for simple-peer and other Node.js modules
if (typeof global === 'undefined') {
Expand Down
21 changes: 16 additions & 5 deletions client/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/images/hero-dunes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/images/room-lighthouse.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/images/room-neon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
201 changes: 122 additions & 79 deletions client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ import { AuthProvider, useAuth } from './context/AuthContext'
import { SocketProvider } from './context/SocketContext'
import { TransfersProvider } from './context/TransfersContext'
import { ThemeProvider } from './context/ThemeContext'
import { ToastProvider } from './context/ToastContext'
import { BeaconMark } from './components/Logo'
import ThemeReset from './components/ThemeReset'
import Layout from './components/Layout'
import Login from './pages/Login'
import Signup from './pages/Signup'
import Home from './pages/Home'
import Files from './pages/Files'
import Rooms from './pages/Rooms'
import WatchParty from './pages/WatchParty'
import Settings from './pages/Settings'
import Files from './pages/Files'
import Messages from './pages/Messages'
import Profile from './pages/Profile'
import Leaderboard from './pages/Leaderboard'
import Layout from './components/Layout'
import Profile from './pages/Profile'
import Settings from './pages/Settings'
import { sweepOrphanedTransfers } from './lib/p2p/transfer'
import { Gem, AlertTriangle, RefreshCw } from 'lucide-react'
import { AlertTriangle, RefreshCw } from 'lucide-react'

// Reclaim disk from transfers abandoned more than a week ago.
sweepOrphanedTransfers()
Expand All @@ -25,11 +29,11 @@ function ProtectedRoute({ children }) {

if (loading) {
return (
<div className="min-h-screen flex flex-col items-center justify-center" style={{ background: 'var(--bg-primary)' }}>
<div className="beacon-mark w-12 h-12 rounded-xl grid place-items-center animate-beacon">
<Gem size={22} className="text-white" />
<div className="min-h-screen flex flex-col items-center justify-center bg-app">
<div className="animate-pulse">
<BeaconMark size={48} />
</div>
<p className="mt-5 text-xs font-semibold" style={{ color: 'var(--text-secondary)' }}>
<p className="mt-5 text-xs font-semibold text-muted">
Lighting the beacon…
</p>
</div>
Expand All @@ -52,18 +56,23 @@ class ErrorBoundary extends React.Component {
render() {
if (this.state.hasError) {
return (
<div className="min-h-screen flex items-center justify-center p-6" style={{ background: 'var(--bg-primary)', color: 'var(--text-primary)' }}>
<div className="glass-card max-w-md w-full p-10 text-center">
<div className="w-14 h-14 rounded-xl flex items-center justify-center mx-auto mb-6" style={{ background: 'rgb(var(--accent) / 0.12)' }}>
<AlertTriangle className="h-7 w-7" style={{ color: 'rgb(var(--accent))' }} />
</div>
<h1 className="text-xl font-bold mb-3">Something went wrong</h1>
<p className="text-sm mb-8 font-mono" style={{ color: 'var(--text-secondary)' }}>{this.state.error?.message || 'An unexpected error broke the page.'}</p>
<button onClick={() => window.location.reload()} className="btn btn-primary w-full">
<RefreshCw className="h-4 w-4 mr-2" />
Reload
</button>
</div>
<div className="min-h-screen flex items-center justify-center p-6 bg-app text-ink">
<div className="panel max-w-md w-full p-10 text-center">
<div className="w-14 h-14 rounded-xl bg-accent-soft text-accent flex items-center justify-center mx-auto mb-6">
<AlertTriangle className="h-7 w-7" />
</div>
<h1 className="font-serif text-xl font-bold mb-3">Something went wrong</h1>
<p className="text-sm mb-8 font-mono text-muted">
{this.state.error?.message || 'An unexpected error broke the page.'}
</p>
<button
onClick={() => window.location.reload()}
className="btn btn-primary w-full"
>
<RefreshCw className="h-4 w-4 mr-2" />
Reload
</button>
</div>
</div>
)
}
Expand All @@ -72,67 +81,101 @@ class ErrorBoundary extends React.Component {
}
}

function App() {
export default function App() {
return (
<ErrorBoundary>
<ThemeProvider>
<AuthProvider>
<SocketProvider>
<TransfersProvider>
<Router>
<Layout>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} />
<Route path="/" element={
<ProtectedRoute>
<Home />
</ProtectedRoute>
} />
<Route path="/files" element={
<ProtectedRoute>
<Files />
</ProtectedRoute>
} />
<Route path="/party/:id" element={
<ProtectedRoute>
<WatchParty />
</ProtectedRoute>
} />
<Route path="/settings" element={
<ProtectedRoute>
<Settings />
</ProtectedRoute>
} />
<Route path="/messages" element={
<ProtectedRoute>
<Messages />
</ProtectedRoute>
} />
<Route path="/leaderboard" element={
<ProtectedRoute>
<Leaderboard />
</ProtectedRoute>
} />
<Route path="/u/:id" element={
<ProtectedRoute>
<Profile />
</ProtectedRoute>
} />
<Route path="/profile" element={
<ProtectedRoute>
<Profile />
</ProtectedRoute>
} />
</Routes>
</Layout>
</Router>
</TransfersProvider>
</SocketProvider>
</AuthProvider>
</ThemeProvider>
<ThemeReset />
<ToastProvider>
<AuthProvider>
<SocketProvider>
<TransfersProvider>
<Router>
<Layout>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/signup" element={<Signup />} />
<Route
path="/"
element={
<ProtectedRoute>
<Home />
</ProtectedRoute>
}
/>
<Route
path="/rooms"
element={
<ProtectedRoute>
<Rooms />
</ProtectedRoute>
}
/>
<Route
path="/files"
element={
<ProtectedRoute>
<Files />
</ProtectedRoute>
}
/>
<Route
path="/party/:id"
element={
<ProtectedRoute>
<WatchParty />
</ProtectedRoute>
}
/>
<Route
path="/settings"
element={
<ProtectedRoute>
<Settings />
</ProtectedRoute>
}
/>
<Route
path="/messages"
element={
<ProtectedRoute>
<Messages />
</ProtectedRoute>
}
/>
<Route
path="/leaderboard"
element={
<ProtectedRoute>
<Leaderboard />
</ProtectedRoute>
}
/>
<Route
path="/u/:id"
element={
<ProtectedRoute>
<Profile />
</ProtectedRoute>
}
/>
<Route
path="/profile"
element={
<ProtectedRoute>
<Profile />
</ProtectedRoute>
}
/>
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Layout>
</Router>
</TransfersProvider>
</SocketProvider>
</AuthProvider>
</ToastProvider>
</ThemeProvider>
</ErrorBoundary>
)
}

export default App
Loading
Loading