Skip to content

Commit 403d9bb

Browse files
committed
Merge feat/public-migration: public/private modes, scoped imports/exports, UI cleanup
2 parents c4361c0 + ba8b477 commit 403d9bb

28 files changed

+3612
-890
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
".": "0.0.12"
2+
".": "0.0.2"
33
}
44

DOCKER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ volumes:
184184
```bash
185185
# Clone and deploy
186186
git clone <repo-url>
187-
cd stremio-family-manager
187+
cd syncio
188188
cp env.example .env
189189
# Edit .env for your environment
190190
make prod
@@ -193,7 +193,7 @@ make prod
193193
### Manual Steps
194194
```bash
195195
# 1. Build the image
196-
docker build -t stremio-family-manager .
196+
docker build -t syncio .
197197

198198
# 2. Run with docker-compose
199199
docker-compose up -d

Dockerfile

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -65,57 +65,8 @@ COPY --from=builder --chown=appuser:nodejs /app/client/node_modules ./client/nod
6565
COPY --from=builder --chown=appuser:nodejs /app/client/public ./client/public
6666
COPY --from=builder --chown=appuser:nodejs /app/client/next.config.js ./client/
6767

68-
# Create startup script
69-
RUN echo '#!/bin/sh' > /app/start.sh && \
70-
echo 'set -e' >> /app/start.sh && \
71-
echo '' >> /app/start.sh && \
72-
echo 'echo "🚀 Starting Syncio..."' >> /app/start.sh && \
73-
echo '' >> /app/start.sh && \
74-
echo '# Ensure SQLite directory exists and is writable' >> /app/start.sh && \
75-
echo 'DB_URL="${DATABASE_URL:-file:/app/data/sqlite.db}"' >> /app/start.sh && \
76-
echo 'if echo "$DB_URL" | grep -q "^file:"; then' >> /app/start.sh && \
77-
echo ' DB_FILE=${DB_URL#file:}' >> /app/start.sh && \
78-
echo ' DB_DIR=$(dirname "$DB_FILE")' >> /app/start.sh && \
79-
echo ' mkdir -p "$DB_DIR" || true' >> /app/start.sh && \
80-
echo ' chmod 755 "$DB_DIR" || true' >> /app/start.sh && \
81-
echo 'fi' >> /app/start.sh && \
82-
echo '' >> /app/start.sh && \
83-
echo '# Apply Prisma schema (migrations or push fallback)' >> /app/start.sh && \
84-
echo 'echo "📊 Applying Prisma schema..."' >> /app/start.sh && \
85-
echo 'npx prisma migrate deploy || true' >> /app/start.sh && \
86-
echo 'echo "ℹ️ Ensuring schema is applied (db push)..."' >> /app/start.sh && \
87-
echo 'npx prisma db push --accept-data-loss' >> /app/start.sh && \
88-
echo '' >> /app/start.sh && \
89-
echo '# Prefer IPv4 for localhost resolution (avoid ::1 issues)' >> /app/start.sh && \
90-
echo 'export NODE_OPTIONS="--dns-result-order=ipv4first"' >> /app/start.sh && \
91-
echo '' >> /app/start.sh && \
92-
echo '# Start both services using a process manager approach' >> /app/start.sh && \
93-
echo 'echo "🌐 Starting frontend server on port ${FRONTEND_PORT:-3000}..."' >> /app/start.sh && \
94-
echo 'cd /app/client && PORT=${FRONTEND_PORT:-3000} npm start &' >> /app/start.sh && \
95-
echo 'FRONTEND_PID=$!' >> /app/start.sh && \
96-
echo '' >> /app/start.sh && \
97-
echo '# Wait a moment for frontend to start' >> /app/start.sh && \
98-
echo 'sleep 5' >> /app/start.sh && \
99-
echo '' >> /app/start.sh && \
100-
echo 'echo "🔧 Starting backend server on port ${BACKEND_PORT:-4000}..."' >> /app/start.sh && \
101-
echo 'cd /app && PORT=${BACKEND_PORT:-4000} node server/database-backend.js &' >> /app/start.sh && \
102-
echo 'BACKEND_PID=$!' >> /app/start.sh && \
103-
echo '' >> /app/start.sh && \
104-
echo '# Function to handle shutdown' >> /app/start.sh && \
105-
echo 'cleanup() {' >> /app/start.sh && \
106-
echo ' echo "🛑 Shutting down services..."' >> /app/start.sh && \
107-
echo ' kill $BACKEND_PID 2>/dev/null || true' >> /app/start.sh && \
108-
echo ' kill $FRONTEND_PID 2>/dev/null || true' >> /app/start.sh && \
109-
echo ' wait' >> /app/start.sh && \
110-
echo ' exit 0' >> /app/start.sh && \
111-
echo '}' >> /app/start.sh && \
112-
echo '' >> /app/start.sh && \
113-
echo '# Set up signal handlers' >> /app/start.sh && \
114-
echo 'trap cleanup SIGTERM SIGINT' >> /app/start.sh && \
115-
echo '' >> /app/start.sh && \
116-
echo '# Wait for both processes' >> /app/start.sh && \
117-
echo 'wait $BACKEND_PID $FRONTEND_PID' >> /app/start.sh
118-
68+
# Use maintained startup script that selects Prisma schema based on DATABASE_URL
69+
COPY --from=builder --chown=appuser:nodejs /app/scripts/start.sh /app/start.sh
11970
RUN chmod +x /app/start.sh
12071

12172
# Switch to non-root user

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ db-reset:
8383
# Build commands
8484
build:
8585
@echo "Building Docker image..."
86-
docker build -t stremio-family-manager .
86+
docker build -t syncio .
8787

8888
# Maintenance commands
8989
clean:

client/next.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
/** @type {import('next').NextConfig} */
2+
// Read app version from root package.json (Syncio version)
3+
let APP_VERSION = 'dev'
4+
try {
5+
// parent of client/
6+
// eslint-disable-next-line @typescript-eslint/no-var-requires
7+
APP_VERSION = require('fs').readFileSync(require('path').join(__dirname, '..', 'package.json'), 'utf8')
8+
APP_VERSION = JSON.parse(APP_VERSION).version || 'dev'
9+
} catch {}
10+
211
const nextConfig = {
312
reactStrictMode: true,
413
swcMinify: true,
514

615
// Environment variables
716
env: {
817
NEXT_PUBLIC_API_URL: 'http://localhost:4000/api',
18+
NEXT_PUBLIC_APP_VERSION: APP_VERSION,
919
},
1020

1121
// Image optimization

client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"name": "stremio-family-manager-client",
2+
"name": "syncio-client",
33
"version": "1.0.0",
4-
"description": "Frontend for Syncio",
4+
"description": "Syncio frontend",
55
"private": true,
66
"scripts": {
77
"dev": "next dev",
8+
"dev:public": "cross-env NEXT_PUBLIC_AUTH_ENABLED=true next dev",
89
"build": "next build",
910
"start": "next start",
1011
"lint": "next lint",

client/src/app/api/health/route.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

client/src/app/globals.css

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,73 @@
44

55
/* Prevent theme flash on page load - set default background */
66
html {
7-
background-color: #000000;
7+
background-color: #000000; /* safe default for dark/mono to avoid white flash */
8+
color-scheme: light; /* default */
89
}
910

11+
/* Match browser chrome/overscroll color to theme by default */
12+
@media (prefers-color-scheme: light) {
13+
html { background-color: #f9fafb; }
14+
}
15+
@media (prefers-color-scheme: dark) {
16+
html { background-color: #111827; color-scheme: dark; }
17+
}
18+
19+
/* Themed scrollbars (WebKit + Firefox) */
20+
/* Base (light) */
21+
html {
22+
scrollbar-width: thin; /* Firefox */
23+
scrollbar-color: #cbd5e1 transparent; /* thumb + transparent track */
24+
}
25+
/* WebKit */
26+
*::-webkit-scrollbar {
27+
width: 8px;
28+
height: 8px;
29+
}
30+
*::-webkit-scrollbar-track { background: transparent; }
31+
*::-webkit-scrollbar-thumb {
32+
background-color: #cbd5e1; /* gray-300 */
33+
border-radius: 8px;
34+
border: 2px solid #f3f4f6; /* creates padding effect */
35+
}
36+
*::-webkit-scrollbar-thumb:hover {
37+
background-color: #9ca3af; /* gray-400 */
38+
}
39+
40+
/* Dark */
41+
.dark html, .modern-dark html, .mono html { scrollbar-color: #0f172a transparent; }
42+
.dark html, .modern-dark html, .mono html { color-scheme: dark; }
43+
.dark *::-webkit-scrollbar-track,
44+
.modern-dark *::-webkit-scrollbar-track,
45+
.mono *::-webkit-scrollbar-track { background: transparent; }
46+
.dark *::-webkit-scrollbar-thumb,
47+
.modern-dark *::-webkit-scrollbar-thumb { background-color: #0f172a; border-color: #111827; }
48+
.dark *::-webkit-scrollbar-thumb:hover,
49+
.modern-dark *::-webkit-scrollbar-thumb:hover { background-color: #1f2937; }
50+
51+
/* Mono (pure black theme) */
52+
.mono *::-webkit-scrollbar-track { background: transparent; }
53+
.mono *::-webkit-scrollbar-thumb { background-color: #2a2a2a; border-color: #000000; }
54+
.mono *::-webkit-scrollbar-thumb:hover { background-color: #3a3a3a; }
55+
.mono html { scrollbar-color: #2a2a2a #000000; }
56+
57+
/* Modern (light gradient) - subtle purple/indigo thumb */
58+
.modern html { scrollbar-color: rgba(99,102,241,0.6) transparent; }
59+
.modern *::-webkit-scrollbar-track { background: transparent; }
60+
.modern *::-webkit-scrollbar-thumb {
61+
background-color: rgba(99,102,241,0.6); /* indigo-500 @ 0.6 */
62+
border-color: transparent;
63+
}
64+
.modern *::-webkit-scrollbar-thumb:hover {
65+
background-color: rgba(79,70,229,0.75); /* indigo-600 @ 0.75 */
66+
}
67+
68+
/* Modern-dark (dark gradient) - lighter lavender thumb */
69+
.modern-dark html { scrollbar-color: rgba(255,255,255,0.2) transparent; }
70+
.modern-dark *::-webkit-scrollbar-track { background: transparent; }
71+
.modern-dark *::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.2); border-color: transparent; }
72+
.modern-dark *::-webkit-scrollbar-thumb:hover { background-color: rgba(255,255,255,0.3); }
73+
1074
/* Ensure proper theme is applied immediately */
1175
html:not(.light):not(.dark):not(.modern):not(.modern-dark):not(.mono) {
1276
background-color: #000000;
@@ -27,15 +91,23 @@ body.theme-loaded {
2791
}
2892

2993
body {
30-
@apply bg-gray-50 text-gray-900;
94+
@apply bg-gray-50 text-gray-900; /* light fallback */
95+
}
96+
97+
/* Ensure overscroll/rubber-band shows correct theme color (html/body) */
98+
.light html, .light body {
99+
@apply bg-gray-50;
100+
}
101+
.dark html, .dark body {
102+
@apply bg-gray-900;
31103
}
32104

33105
/* Override body background for modern themes */
34-
.modern body {
106+
.modern html, .modern body {
35107
@apply bg-gradient-to-br from-purple-100 via-blue-100 to-indigo-100 text-purple-900;
36108
}
37109

38-
.modern-dark body {
110+
.modern-dark html, .modern-dark body {
39111
@apply bg-gradient-to-br from-purple-900 via-blue-900 to-indigo-900 text-purple-100;
40112
}
41113

@@ -88,7 +160,7 @@ body.theme-loaded {
88160
}
89161

90162
/* Mono theme: fully black UI with white text and subtle borders */
91-
.mono body {
163+
.mono html, .mono body {
92164
@apply bg-black text-white;
93165
}
94166

client/src/app/layout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ThemeProvider } from '@/contexts/ThemeContext'
77
import Head from 'next/head'
88

99
import './globals.css'
10+
import AuthGate from '@/components/auth/AuthGate'
1011

1112
const inter = Inter({ subsets: ['latin'] })
1213

@@ -42,7 +43,9 @@ export default function RootLayout({
4243
<body className={inter.className}>
4344
<QueryClientProvider client={queryClient}>
4445
<ThemeProvider>
45-
{children}
46+
<AuthGate>
47+
{children}
48+
</AuthGate>
4649
<Toaster
4750
position="top-right"
4851
toastOptions={{

0 commit comments

Comments
 (0)