Skip to content

Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.

feat(settings): say who needs to set up scheduling

spacesdrive73a065064b72
diff --git a/frontend/src/features/settings/SchedulingSetupGuide.jsx b/frontend/src/features/settings/SchedulingSetupGuide.jsx
index 31d02bc..d77e152 100644
--- a/frontend/src/features/settings/SchedulingSetupGuide.jsx
+++ b/frontend/src/features/settings/SchedulingSetupGuide.jsx
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
-import { GitFork, KeyRound, Lock, Power, PlayCircle, Check, Copy, ExternalLink, Save } from 'lucide-react';
+import { Link } from 'react-router-dom';
+import { GitFork, KeyRound, Lock, Power, PlayCircle, Check, Copy, ExternalLink, Save, ChevronDown, BookOpen } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Spinner } from '@/components/ui/spinner';
@@ -88,17 +89,34 @@ export default function SchedulingSetupGuide({ owner, repo, onOwnerChange, onRep
const name = (repo || 'twiligent').trim();
const base = user ? `https://github.com/${user}/${name}` : null;
const completed = ['fork', 'supabase', 'secrets', 'enable', 'test'].filter(k => done[k]).length;
+ // Members never need these steps, so the guide stays folded unless someone has already started it.
+ const [open, setOpen] = useState(() => completed > 0 || Boolean(user));
return (
<SurfaceBox
- title="Set up your own scheduling with GitHub"
- subheader="About 5 minutes. You need a free GitHub account and access to the Supabase project this Twiligent uses."
- secondary={<span className="text-small text-ink-faint tabular-nums">{completed} of 5 done</span>}
+ title="Backup scheduler on GitHub"
+ subheader="Optional, for administrators running their own Twiligent. About 5 minutes."
+ secondary={(
+ <Button variant="ghost" size="sm" onClick={() => setOpen(o => !o)} aria-expanded={open} aria-controls="gh-guide-steps">
+ {open ? 'Hide steps' : 'Show steps'}
+ <ChevronDown data-icon="inline-end" className={cn('transition-transform duration-(--duration-base)', open && 'rotate-180')} />
+ </Button>
+ )}
>
<div className="flex flex-col gap-5">
<p className="text-sm text-ink-muted">
- GitHub will check your scheduled posts every 15 minutes and publish the ones that are due, for free. This is a backup for the server, so posts still go out if the server is ever paused. You do this once.
+ A second copy of the publisher that runs on GitHub every 15 minutes, for free, so posts still go out if the server is ever paused. Step 2 needs the secret key of the Supabase project behind this Twiligent, which only its administrator has. If you only sign in here, skip this: the server already publishes your posts.
</p>
+ <div className="flex flex-wrap items-center gap-2">
+ <Button variant="outline" size="sm" render={<Link to="/docs/self-host/github" />}>
+ <BookOpen data-icon="inline-start" />
+ Read the full guide
+ </Button>
+ {completed > 0 && <span className="text-small text-ink-faint tabular-nums">{completed} of 5 done</span>}
+ </div>
+
+ {open && (
+ <div id="gh-guide-steps" className="flex flex-col gap-5">
<form onSubmit={onSave} className="flex flex-col gap-2 rounded-field bg-surface-sunken/60 p-4">
<label htmlFor="gh-user" className="text-sm font-medium text-ink">Your GitHub username</label>
@@ -196,9 +214,11 @@ export default function SchedulingSetupGuide({ owner, repo, onOwnerChange, onRep
<p className="text-sm text-ink-muted">GitHub now checks every 15 minutes. You do not need to keep anything open. Two things to know:</p>
<ul className="flex list-disc flex-col gap-1 pl-5 text-sm text-ink-muted marker:text-ink-faint">
<li>If nothing changes in your copy for 60 days, GitHub pauses the schedule and emails you. Repeat step 4 to switch it back on.</li>
- <li>If you made your copy private, GitHub's free minutes run out. Keep it public, or ask your administrator to lower the frequency to every 30 minutes.</li>
+ <li>If you made your copy private, GitHub's free minutes run out. Keep it public, or change the schedule in <code className="font-mono text-small text-ink">.github/workflows/publish-scheduled.yml</code> to every 30 minutes.</li>
</ul>
</div>
+ </div>
+ )}
</div>
</SurfaceBox>
);
diff --git a/frontend/src/features/settings/Settings.jsx b/frontend/src/features/settings/Settings.jsx
index ac7aa48..ed9b270 100644
--- a/frontend/src/features/settings/Settings.jsx
+++ b/frontend/src/features/settings/Settings.jsx
@@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react';
import { useSmoothTheme } from '@/hooks/use-smooth-theme';
-import { useLocation } from 'react-router-dom';
+import { Link, useLocation } from 'react-router-dom';
import {
- RefreshCw, CheckCircle2, AlertTriangle, ExternalLink, Sun, Moon, Monitor, Activity, Clock,
+ RefreshCw, CheckCircle2, AlertTriangle, ExternalLink, Sun, Moon, Monitor, Activity, Clock, Users, Server, BookOpen, ArrowRight,
} from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
@@ -21,6 +21,12 @@ import { useAppContext } from '../../context/AppContext';
import { api } from '../../services/api';
import { cn } from '@/lib/utils';
+const DOC_LINKS = [
+ { label: 'Using Twiligent', to: '/docs/use/getting-started' },
+ { label: 'Run your own Twiligent', to: '/docs/self-host' },
+ { label: 'Environment variables', to: '/docs/reference/environment' },
+];
+
const LINKS = [
{ label: 'Supabase API keys', href: 'https://supabase.com/dashboard/project/_/settings/api-keys' },
{ label: 'Cloudinary console', href: 'https://cloudinary.com/console' },
@@ -203,8 +209,24 @@ export default function Settings() {
<SettingsSection
id="scheduling"
title="Scheduled publishing"
- description="How scheduled Instagram posts go out, and how to set up your own GitHub publisher in five steps."
+ description="How scheduled Instagram posts go out, and who needs to set anything up."
>
+ <SurfaceBox title="Who needs to set this up">
+ <div className="grid gap-3 sm:grid-cols-2">
+ <div className="flex flex-col gap-2 rounded-field border border-line p-4">
+ <p className="flex items-center gap-2 text-sm font-semibold text-ink"><Users className="size-4 stroke-[1.75] text-ink-faint" />You sign in to this Twiligent</p>
+ <p className="text-sm text-ink-muted">Nothing to set up. The server publishes your scheduled posts. You do not need GitHub, Supabase or any keys.</p>
+ </div>
+ <div className="flex flex-col gap-2 rounded-field border border-line p-4">
+ <p className="flex items-center gap-2 text-sm font-semibold text-ink"><Server className="size-4 stroke-[1.75] text-ink-faint" />You run your own Twiligent</p>
+ <p className="text-sm text-ink-muted">Deploying the backend is enough; scheduling starts with it. The GitHub backup below is optional.</p>
+ <Link to="/docs/self-host" className="mt-auto inline-flex items-center gap-1 text-sm font-medium text-brand-text underline-offset-4 hover:underline">
+ Self-hosting guide<ArrowRight className="size-3.5" />
+ </Link>
+ </div>
+ </div>
+ </SurfaceBox>
+
<SurfaceBox title="How it works for you">
<Steps steps={[
{ title: 'Schedule a post', body: 'In Publish, choose an account, the content type and the file, write the caption, pick Schedule, then a date and time, and choose Schedule post. The file uploads straight away.' },
@@ -256,6 +278,16 @@ export default function Settings() {
<SettingsSection id="links" title="Useful links">
<SurfaceBox content={false} className="divide-y divide-divider">
+ {DOC_LINKS.map(({ label, to }) => (
+ <Link
+ key={label}
+ to={to}
+ className="flex items-center justify-between gap-2 px-5 py-3 text-sm text-ink transition-colors duration-(--duration-fast) hover:bg-surface-hover"
+ >
+ <span className="flex items-center gap-2"><BookOpen className="size-4 shrink-0 stroke-[1.75] text-ink-faint" />{label}</span>
+ <ArrowRight className="size-4 shrink-0 text-ink-faint" />
+ </Link>
+ ))}
{LINKS.map(({ label, href }) => (
<a
key={label}