forked from weroperking/Betterbase
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(dashboard): scaffold BetterBase Next.js dashboard app #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,21 @@ | ||
| # Dashboard App (Scaffold) | ||
| # BetterBase Dashboard | ||
|
|
||
| Future BetterBase dashboard/studio app. | ||
| Next.js 15 dashboard for managing BetterBase projects (Supabase Studio-style UX). | ||
|
|
||
| ## Planned Features (Optional) | ||
| ## Stack | ||
|
|
||
| - [ ] Table browser and editor | ||
| - [ ] API explorer / request runner | ||
| - [ ] Auth and session management views | ||
| - [ ] Project settings and environment controls | ||
| - Next.js 15 App Router | ||
| - React 19 + TypeScript strict mode | ||
| - Tailwind CSS + shadcn-style UI primitives | ||
| - TanStack Query v5 | ||
| - Recharts + Lucide React | ||
| - `@betterbase/client` for API access | ||
|
|
||
| ## Tech Stack (Optional) | ||
| ## Development | ||
|
|
||
| - Framework: _TBD_ (e.g., Next.js / Astro / React) | ||
| - UI: _TBD_ (e.g., Tailwind CSS / shadcn/ui) | ||
| - State/Data: _TBD_ (e.g., TanStack Query) | ||
| ```bash | ||
| bun install | ||
| bun run dev | ||
| ``` | ||
|
|
||
| ## Setup (Placeholder) | ||
|
|
||
| - `cd betterbase/apps/dashboard` | ||
| - `bun install` | ||
| - `bun run dev` | ||
|
|
||
| ## Related Docs / Links (Optional) | ||
|
|
||
| - Design doc: _TBD_ | ||
| - Roadmap ticket(s): _TBD_ | ||
| - UX references: _TBD_ | ||
| Set `NEXT_PUBLIC_BETTERBASE_URL` to your BetterBase server URL. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import type { NextConfig } from 'next'; | ||
|
|
||
| const nextConfig: NextConfig = { | ||
| reactStrictMode: true, | ||
| }; | ||
|
|
||
| export default nextConfig; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "name": "@betterbase/dashboard", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "scripts": { | ||
| "dev": "next dev", | ||
| "build": "next build", | ||
| "start": "next start", | ||
| "lint": "next lint", | ||
| "typecheck": "tsc --noEmit" | ||
| }, | ||
| "dependencies": { | ||
| "@betterbase/client": "workspace:*", | ||
| "@radix-ui/react-dialog": "^1.1.0", | ||
| "@radix-ui/react-dropdown-menu": "^2.1.0", | ||
| "@radix-ui/react-slot": "^1.1.0", | ||
| "@radix-ui/react-tabs": "^1.1.0", | ||
| "@tanstack/react-query": "^5.67.0", | ||
| "class-variance-authority": "^0.7.1", | ||
| "clsx": "^2.1.1", | ||
| "lucide-react": "^0.468.0", | ||
| "next": "^15.2.0", | ||
| "react": "^19.0.0", | ||
| "react-dom": "^19.0.0", | ||
| "recharts": "^2.15.0", | ||
| "tailwind-merge": "^2.6.0", | ||
| "tailwindcss-animate": "^1.0.7", | ||
| "zod": "^3.25.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^22.0.0", | ||
| "@types/react": "^19.0.0", | ||
| "@types/react-dom": "^19.0.0", | ||
| "autoprefixer": "^10.4.0", | ||
| "postcss": "^8.4.0", | ||
| "tailwindcss": "^4.0.0", | ||
| "typescript": "^5.9.3", | ||
| "@tailwindcss/postcss": "^4.0.0" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export default { | ||
| plugins: { | ||
| '@tailwindcss/postcss': {}, | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import Link from 'next/link'; | ||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; | ||
|
|
||
| export default function LoginPage() { | ||
| return ( | ||
| <div className="flex min-h-screen items-center justify-center bg-zinc-50 p-4 dark:bg-zinc-950"> | ||
| <Card className="w-full max-w-md"> | ||
| <CardHeader> | ||
| <CardTitle>Sign in</CardTitle> | ||
| <CardDescription>Connect to your BetterBase project.</CardDescription> | ||
| </CardHeader> | ||
| <CardContent className="text-sm"> | ||
| Auth form wiring is next. Need an account?{' '} | ||
| <Link href="/signup" className="text-blue-600 hover:underline"> | ||
| Sign up | ||
| </Link> | ||
| . | ||
| </CardContent> | ||
| </Card> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import Link from 'next/link'; | ||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; | ||
|
|
||
| export default function SignupPage() { | ||
| return ( | ||
| <div className="flex min-h-screen items-center justify-center bg-zinc-50 p-4 dark:bg-zinc-950"> | ||
| <Card className="w-full max-w-md"> | ||
| <CardHeader> | ||
| <CardTitle>Create account</CardTitle> | ||
| <CardDescription>Start managing your BetterBase backend.</CardDescription> | ||
| </CardHeader> | ||
| <CardContent className="text-sm"> | ||
| Signup flow wiring is next. Already have an account?{' '} | ||
| <Link href="/login" className="text-blue-600 hover:underline"> | ||
| Sign in | ||
| </Link> | ||
| . | ||
| </CardContent> | ||
| </Card> | ||
| </div> | ||
| ); | ||
| } |
13 changes: 13 additions & 0 deletions
13
betterbase/apps/dashboard/src/app/(dashboard)/api-explorer/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; | ||
|
|
||
| export default function ApiPage() { | ||
| return ( | ||
| <Card> | ||
| <CardHeader> | ||
| <CardTitle>API Explorer</CardTitle> | ||
| <CardDescription>Inspect generated endpoints and test requests.</CardDescription> | ||
| </CardHeader> | ||
| <CardContent className="text-sm text-zinc-600 dark:text-zinc-400">API explorer ships in Phase 9.3.</CardContent> | ||
| </Card> | ||
| ); | ||
| } |
13 changes: 13 additions & 0 deletions
13
betterbase/apps/dashboard/src/app/(dashboard)/auth/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; | ||
|
|
||
| export default function AuthManagerPage() { | ||
| return ( | ||
| <Card> | ||
| <CardHeader> | ||
| <CardTitle>Authentication Manager</CardTitle> | ||
| <CardDescription>Manage users, sessions, and auth providers.</CardDescription> | ||
| </CardHeader> | ||
| <CardContent className="text-sm text-zinc-600 dark:text-zinc-400">Authentication manager ships in Phase 9.4.</CardContent> | ||
| </Card> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { Header } from '@/components/layout/header'; | ||
| import { Sidebar } from '@/components/layout/sidebar'; | ||
|
|
||
| export default function DashboardLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| return ( | ||
| <div className="flex h-screen bg-zinc-50 dark:bg-zinc-950"> | ||
| <Sidebar /> | ||
| <div className="flex flex-1 flex-col overflow-hidden"> | ||
| <Header /> | ||
| <main className="flex-1 overflow-y-auto p-4 md:p-6">{children}</main> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
13 changes: 13 additions & 0 deletions
13
betterbase/apps/dashboard/src/app/(dashboard)/logs/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; | ||
|
|
||
| export default function LogsPage() { | ||
| return ( | ||
| <Card> | ||
| <CardHeader> | ||
| <CardTitle>Logs Viewer</CardTitle> | ||
| <CardDescription>Track database, auth, and function logs in real-time.</CardDescription> | ||
| </CardHeader> | ||
| <CardContent className="text-sm text-zinc-600 dark:text-zinc-400">Logs viewer ships in Phase 9.5.</CardContent> | ||
| </Card> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { ApiUsageChart } from '@/components/charts/api-usage-chart'; | ||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; | ||
| import { Activity, Code, Database, Users } from 'lucide-react'; | ||
|
|
||
| export default function DashboardPage() { | ||
| const stats = [ | ||
| { name: 'Total Tables', value: '12', icon: Database, change: '+2 this week' }, | ||
| { name: 'API Calls', value: '45.2K', icon: Code, change: '+12% from last week' }, | ||
| { name: 'Active Users', value: '2,547', icon: Users, change: '+234 this week' }, | ||
| { name: 'Uptime', value: '99.9%', icon: Activity, change: '30 days' }, | ||
| ]; | ||
|
|
||
| return ( | ||
| <div className="space-y-6"> | ||
| <div> | ||
| <h2 className="text-3xl font-bold tracking-tight">Dashboard</h2> | ||
| <p className="text-zinc-600 dark:text-zinc-400">Welcome back! Here's an overview of your project.</p> | ||
| </div> | ||
|
|
||
| <div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-4"> | ||
| {stats.map((stat) => ( | ||
| <Card key={stat.name}> | ||
| <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> | ||
| <CardTitle className="text-sm font-medium">{stat.name}</CardTitle> | ||
| <stat.icon className="h-4 w-4 text-zinc-600 dark:text-zinc-400" /> | ||
| </CardHeader> | ||
| <CardContent> | ||
| <div className="text-2xl font-bold">{stat.value}</div> | ||
| <p className="text-xs text-zinc-600 dark:text-zinc-400">{stat.change}</p> | ||
| </CardContent> | ||
| </Card> | ||
| ))} | ||
| </div> | ||
|
|
||
| <div className="grid gap-4 lg:grid-cols-2"> | ||
| <Card> | ||
| <CardHeader> | ||
| <CardTitle>API Usage</CardTitle> | ||
| <CardDescription>Requests over the last 7 days</CardDescription> | ||
| </CardHeader> | ||
| <CardContent> | ||
| <ApiUsageChart /> | ||
| </CardContent> | ||
| </Card> | ||
|
|
||
| <Card> | ||
| <CardHeader> | ||
| <CardTitle>Quick Actions</CardTitle> | ||
| <CardDescription>Common tasks and shortcuts</CardDescription> | ||
| </CardHeader> | ||
| <CardContent> | ||
| <div className="space-y-2"> | ||
| {['Create new table', 'Test API endpoint', 'View logs'].map((action) => ( | ||
| <button | ||
| type="button" | ||
| key={action} | ||
| className="w-full rounded-lg border border-zinc-200 p-3 text-left text-sm hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-900" | ||
| > | ||
| {action} | ||
| </button> | ||
| ))} | ||
| </div> | ||
| </CardContent> | ||
| </Card> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } | ||
13 changes: 13 additions & 0 deletions
13
betterbase/apps/dashboard/src/app/(dashboard)/settings/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; | ||
|
|
||
| export default function SettingsPage() { | ||
| return ( | ||
| <Card> | ||
| <CardHeader> | ||
| <CardTitle>Project Settings</CardTitle> | ||
| <CardDescription>Environment variables, integrations, and billing controls.</CardDescription> | ||
| </CardHeader> | ||
| <CardContent className="text-sm text-zinc-600 dark:text-zinc-400">Configure your project settings here.</CardContent> | ||
| </Card> | ||
| ); | ||
| } |
10 changes: 10 additions & 0 deletions
10
betterbase/apps/dashboard/src/app/(dashboard)/tables/[table]/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { TableEditor } from '@/components/tables/table-editor'; | ||
|
|
||
| export default async function TableDetailPage({ | ||
| params, | ||
| }: { | ||
| params: Promise<{ table: string }>; | ||
| }) { | ||
| const { table } = await params; | ||
| return <TableEditor tableName={table} />; | ||
| } |
5 changes: 5 additions & 0 deletions
5
betterbase/apps/dashboard/src/app/(dashboard)/tables/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { TableBrowser } from '@/components/tables/table-browser'; | ||
|
|
||
| export default function TablesPage() { | ||
| return <TableBrowser />; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| @import 'tailwindcss'; | ||
|
|
||
| :root { | ||
| --background: 0 0% 100%; | ||
| --foreground: 240 10% 3.9%; | ||
| --card: 0 0% 100%; | ||
| --card-foreground: 240 10% 3.9%; | ||
| --popover: 0 0% 100%; | ||
| --popover-foreground: 240 10% 3.9%; | ||
| --primary: 221 83% 53%; | ||
| --primary-foreground: 210 40% 98%; | ||
| --secondary: 240 4.8% 95.9%; | ||
| --secondary-foreground: 240 5.9% 10%; | ||
| --muted: 240 4.8% 95.9%; | ||
| --muted-foreground: 240 3.8% 46.1%; | ||
| --accent: 240 4.8% 95.9%; | ||
| --accent-foreground: 240 5.9% 10%; | ||
| --destructive: 0 84.2% 60.2%; | ||
| --destructive-foreground: 0 0% 98%; | ||
| --border: 240 5.9% 90%; | ||
| --input: 240 5.9% 90%; | ||
| --ring: 221 83% 53%; | ||
| --radius: 0.75rem; | ||
| } | ||
|
|
||
| .dark { | ||
| --background: 240 10% 3.9%; | ||
| --foreground: 0 0% 98%; | ||
| --card: 240 10% 3.9%; | ||
| --card-foreground: 0 0% 98%; | ||
| --popover: 240 10% 3.9%; | ||
| --popover-foreground: 0 0% 98%; | ||
| --primary: 217 91% 60%; | ||
| --primary-foreground: 222 47% 11%; | ||
| --secondary: 240 3.7% 15.9%; | ||
| --secondary-foreground: 0 0% 98%; | ||
| --muted: 240 3.7% 15.9%; | ||
| --muted-foreground: 240 5% 64.9%; | ||
| --accent: 240 3.7% 15.9%; | ||
| --accent-foreground: 0 0% 98%; | ||
| --destructive: 0 62.8% 30.6%; | ||
| --destructive-foreground: 0 0% 98%; | ||
| --border: 240 3.7% 15.9%; | ||
| --input: 240 3.7% 15.9%; | ||
| --ring: 224.3 76.3% 48%; | ||
| } | ||
|
|
||
| * { | ||
| border-color: hsl(var(--border)); | ||
| } | ||
|
|
||
| body { | ||
| background: hsl(var(--background)); | ||
| color: hsl(var(--foreground)); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import type { Metadata } from 'next'; | ||
| import { Inter } from 'next/font/google'; | ||
| import './globals.css'; | ||
| import { Providers } from '@/components/providers'; | ||
|
|
||
| const inter = Inter({ subsets: ['latin'] }); | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: 'BetterBase Dashboard', | ||
| description: 'Manage your BetterBase backends', | ||
| }; | ||
|
|
||
| export default function RootLayout({ | ||
| children, | ||
| }: Readonly<{ | ||
| children: React.ReactNode; | ||
| }>) { | ||
| return ( | ||
| <html lang="en" suppressHydrationWarning> | ||
| <body className={inter.className}> | ||
| <Providers>{children}</Providers> | ||
| </body> | ||
| </html> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick Actions are non-functional — wire to routes or mark disabled.
These buttons render without handlers or navigation, so clicks do nothing. That’s a small but visible UX break. Suggest turning them into links (if the routes exist) or explicitly disabled with a “coming soon” affordance.
🛠️ Example: wire to routes via
next/link📝 Committable suggestion
🤖 Prompt for AI Agents