create-varity-app 2.0.0-beta.5 → 2.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -19
- package/dist/create.js +5 -6
- package/package.json +7 -7
- package/template/.env.example +3 -3
- package/template/.turbo/turbo-build.log +1 -44
- package/template/KNOWN_ISSUES.md +27 -37
- package/template/README.md +61 -43
- package/template/next.config.js +1 -1
- package/template/package.json +3 -3
- package/template/src/app/dashboard/layout.tsx +23 -26
- package/template/src/app/dashboard/settings/page.tsx +12 -12
- package/template/src/app/layout.tsx +1 -1
- package/template/src/app/login/page.tsx +22 -25
- package/template/src/components/providers.tsx +1 -1
- package/template/src/components/shared/Footer.tsx +1 -1
- package/template/src/lib/hooks.ts +7 -7
- package/template/src/services/dashboardService.ts +589 -0
- package/template/varity.config.json +1 -1
package/README.md
CHANGED
|
@@ -23,12 +23,12 @@ yarn create varity-app my-app
|
|
|
23
23
|
## What You Get
|
|
24
24
|
|
|
25
25
|
- **Next.js 15** app with TypeScript and Tailwind CSS
|
|
26
|
-
- **Authentication**
|
|
27
|
-
- **Database**
|
|
28
|
-
- **Dashboard**
|
|
29
|
-
- **Landing page**
|
|
30
|
-
- **Settings**
|
|
31
|
-
- **
|
|
26
|
+
- **Authentication** -- email, social login, and more (zero config)
|
|
27
|
+
- **Database** -- ready-to-use collections with typed queries
|
|
28
|
+
- **Dashboard** -- professional layout with sidebar navigation
|
|
29
|
+
- **Landing page** -- hero, features, pricing, how it works, testimonials, CTA
|
|
30
|
+
- **Settings** -- General, Security, Billing, and Account tabs
|
|
31
|
+
- **8 pages** -- landing, login, dashboard, projects, tasks, team, settings, 404
|
|
32
32
|
|
|
33
33
|
## Project Structure
|
|
34
34
|
|
|
@@ -36,15 +36,16 @@ yarn create varity-app my-app
|
|
|
36
36
|
my-app/
|
|
37
37
|
├── src/
|
|
38
38
|
│ └── app/
|
|
39
|
-
│ ├──
|
|
40
|
-
│ ├──
|
|
41
|
-
│ │ ├──
|
|
39
|
+
│ ├── login/ # Login page
|
|
40
|
+
│ ├── dashboard/ # Protected dashboard pages
|
|
41
|
+
│ │ ├── page.tsx # Overview with KPIs
|
|
42
42
|
│ │ ├── projects/ # Project management
|
|
43
43
|
│ │ ├── tasks/ # Task tracking
|
|
44
44
|
│ │ ├── team/ # Team members
|
|
45
|
-
│ │ └── settings/ # App settings (
|
|
45
|
+
│ │ └── settings/ # App settings (4 tabs)
|
|
46
|
+
│ ├── not-found.tsx # 404 page
|
|
46
47
|
│ └── page.tsx # Landing page
|
|
47
|
-
├── tailwind.config.
|
|
48
|
+
├── tailwind.config.js
|
|
48
49
|
├── next.config.js
|
|
49
50
|
└── package.json
|
|
50
51
|
```
|
|
@@ -60,26 +61,26 @@ varitykit app deploy
|
|
|
60
61
|
|
|
61
62
|
Your app will be live in under 60 seconds.
|
|
62
63
|
|
|
63
|
-
Or deploy from your AI editor with the [Varity MCP server](
|
|
64
|
+
Or deploy from your AI editor with the [Varity MCP server](https://www.npmjs.com/package/@varity-labs/mcp) -- just ask "deploy this project".
|
|
64
65
|
|
|
65
66
|
## Related Packages
|
|
66
67
|
|
|
67
|
-
- **[@varity-labs/sdk](
|
|
68
|
-
- **[@varity-labs/ui-kit](
|
|
69
|
-
- **[@varity-labs/mcp](
|
|
68
|
+
- **[@varity-labs/sdk](https://www.npmjs.com/package/@varity-labs/sdk)** -- Core SDK (database, credentials)
|
|
69
|
+
- **[@varity-labs/ui-kit](https://www.npmjs.com/package/@varity-labs/ui-kit)** -- React UI components
|
|
70
|
+
- **[@varity-labs/mcp](https://www.npmjs.com/package/@varity-labs/mcp)** -- MCP server for AI editors (Cursor, Claude Code, VS Code)
|
|
70
71
|
|
|
71
72
|
## Learn More
|
|
72
73
|
|
|
73
74
|
- [Documentation](https://docs.varity.so)
|
|
74
75
|
- [GitHub](https://github.com/varity-labs/varity-sdk)
|
|
75
|
-
- [Discord](https://discord.gg/
|
|
76
|
+
- [Discord](https://discord.gg/7vWsdwa2Bg)
|
|
76
77
|
|
|
77
78
|
---
|
|
78
79
|
|
|
79
|
-
**Part of the [Varity SDK](https://github.com/varity-labs/varity-sdk)**
|
|
80
|
+
**Part of the [Varity SDK](https://github.com/varity-labs/varity-sdk)** -- Build, deploy, and monetize apps 70% cheaper than AWS.
|
|
80
81
|
|
|
81
|
-
[Documentation](https://docs.varity.so)
|
|
82
|
+
[Documentation](https://docs.varity.so) | [GitHub](https://github.com/varity-labs/varity-sdk) | [Discord](https://discord.gg/7vWsdwa2Bg)
|
|
82
83
|
|
|
83
84
|
## License
|
|
84
85
|
|
|
85
|
-
MIT
|
|
86
|
+
MIT -- [Varity Labs](https://www.varity.so)
|
package/dist/create.js
CHANGED
|
@@ -7,11 +7,10 @@ import ora from "ora";
|
|
|
7
7
|
import { getInstallCommand } from "./utils.js";
|
|
8
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
9
|
const __dirname = path.dirname(__filename);
|
|
10
|
-
const VARITY_PACKAGE_VERSION = "^2.0.0-beta.2";
|
|
11
10
|
const WORKSPACE_DEPS = {
|
|
12
|
-
"@varity-labs/sdk": "
|
|
13
|
-
"@varity-labs/types": "
|
|
14
|
-
"@varity-labs/ui-kit": "
|
|
11
|
+
"@varity-labs/sdk": "2.0.0-beta.4",
|
|
12
|
+
"@varity-labs/types": "2.0.0-beta.4",
|
|
13
|
+
"@varity-labs/ui-kit": "2.0.0-beta.7",
|
|
15
14
|
};
|
|
16
15
|
const EXCLUDED_FILES = new Set([
|
|
17
16
|
".env.local",
|
|
@@ -33,7 +32,7 @@ function rewritePackageJson(content, projectName) {
|
|
|
33
32
|
for (const [name, version] of Object.entries(deps)) {
|
|
34
33
|
if (typeof version === "string" &&
|
|
35
34
|
version.startsWith("workspace:")) {
|
|
36
|
-
deps[name] = WORKSPACE_DEPS[name] ||
|
|
35
|
+
deps[name] = WORKSPACE_DEPS[name] || "2.0.0-beta.4";
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
}
|
|
@@ -136,6 +135,6 @@ export async function createApp(projectName, packageManager) {
|
|
|
136
135
|
console.log(chalk.cyan(" varitykit app deploy"));
|
|
137
136
|
console.log();
|
|
138
137
|
console.log(` Docs: ${chalk.underline("https://docs.varity.so")}`);
|
|
139
|
-
console.log(` Help: ${chalk.underline("https://discord.gg/
|
|
138
|
+
console.log(` Help: ${chalk.underline("https://discord.gg/7vWsdwa2Bg")}`);
|
|
140
139
|
console.log();
|
|
141
140
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-varity-app",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.7",
|
|
4
4
|
"description": "Create production-ready apps with auth, database, and payments built in",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,11 +38,6 @@
|
|
|
38
38
|
"LICENSE"
|
|
39
39
|
],
|
|
40
40
|
"type": "module",
|
|
41
|
-
"scripts": {
|
|
42
|
-
"prebuild": "node scripts/copy-template.mjs",
|
|
43
|
-
"build": "tsc",
|
|
44
|
-
"clean": "rm -rf dist template"
|
|
45
|
-
},
|
|
46
41
|
"dependencies": {
|
|
47
42
|
"chalk": "^5.3.0",
|
|
48
43
|
"commander": "^12.1.0",
|
|
@@ -57,5 +52,10 @@
|
|
|
57
52
|
"@types/prompts": "^2.4.9",
|
|
58
53
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
59
54
|
"typescript": "^5.5.0"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"prebuild": "node scripts/copy-template.mjs",
|
|
58
|
+
"build": "tsc",
|
|
59
|
+
"clean": "rm -rf dist template"
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|
package/template/.env.example
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
# For production: `varitykit app deploy` injects all credentials automatically.
|
|
7
7
|
# You never need to manually set these values.
|
|
8
8
|
|
|
9
|
-
# Auth
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
# Auth (optional — dev credentials used automatically when blank)
|
|
10
|
+
NEXT_PUBLIC_PRIVY_APP_ID=
|
|
11
|
+
NEXT_PUBLIC_THIRDWEB_CLIENT_ID=
|
|
12
12
|
|
|
13
13
|
# Database (optional — dev database used automatically when blank)
|
|
14
14
|
NEXT_PUBLIC_VARITY_APP_TOKEN=
|
|
@@ -1,49 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
> my-saas-app@0.1.0 build /home/macoding/varity-workspace/varity-sdk-
|
|
2
|
+
> my-saas-app@0.1.0 build /home/macoding/varity-workspace/varity-sdk-private/templates/saas-starter
|
|
3
3
|
> next build
|
|
4
4
|
|
|
5
|
-
⚠ Warning: Next.js inferred your workspace root, but it may not be correct.
|
|
6
|
-
We detected multiple lockfiles and selected the directory of /home/macoding/varity-workspace/package-lock.json as the root directory.
|
|
7
|
-
To silence this warning, set `outputFileTracingRoot` in your Next.js config, or consider removing one of the lockfiles if it's not needed.
|
|
8
|
-
See https://nextjs.org/docs/app/api-reference/config/next-config-js/output#caveats for more information.
|
|
9
|
-
Detected additional lockfiles:
|
|
10
|
-
* /home/macoding/varity-workspace/varity-sdk-impl/pnpm-lock.yaml
|
|
11
|
-
|
|
12
5
|
▲ Next.js 15.5.11
|
|
13
6
|
|
|
14
|
-
Creating an optimized production build ...
|
|
15
|
-
⚠ Mismatching @next/swc version, detected: 15.5.7 while Next.js is on 15.5.11. Please ensure these match
|
|
16
|
-
✓ Compiled successfully in 36.9s
|
|
17
|
-
Linting and checking validity of types ...
|
|
18
|
-
Collecting page data ...
|
|
19
|
-
Generating static pages (0/11) ...
|
|
20
|
-
[Varity Database] Using shared development database. Data is stored in an isolated dev schema.
|
|
21
|
-
Deploy with `varitykit app deploy` to get your own private database.
|
|
22
|
-
Generating static pages (2/11)
|
|
23
|
-
Generating static pages (5/11)
|
|
24
|
-
Generating static pages (8/11)
|
|
25
|
-
✓ Generating static pages (11/11)
|
|
26
|
-
Finalizing page optimization ...
|
|
27
|
-
Collecting build traces ...
|
|
28
|
-
Exporting (0/2) ...
|
|
29
|
-
✓ Exporting (2/2)
|
|
30
|
-
|
|
31
|
-
Route (app) Size First Load JS
|
|
32
|
-
┌ ○ / 5.69 kB 125 kB
|
|
33
|
-
├ ○ /_not-found 132 B 116 kB
|
|
34
|
-
├ ○ /dashboard 3.75 kB 1.37 MB
|
|
35
|
-
├ ○ /dashboard/projects 4.95 kB 1.37 MB
|
|
36
|
-
├ ○ /dashboard/settings 5.88 kB 1.37 MB
|
|
37
|
-
├ ○ /dashboard/tasks 3.17 kB 1.37 MB
|
|
38
|
-
├ ○ /dashboard/team 3.06 kB 1.37 MB
|
|
39
|
-
├ ○ /icon.svg 0 B 0 B
|
|
40
|
-
└ ○ /login 1.32 kB 1.37 MB
|
|
41
|
-
+ First Load JS shared by all 116 kB
|
|
42
|
-
├ chunks/79135-4ac590d187e38d6f.js 45.3 kB
|
|
43
|
-
├ chunks/f0439f7a-76e885cef8778491.js 54.3 kB
|
|
44
|
-
├ chunks/webpack-8c7850c3c7158c7b.js 16.1 kB
|
|
45
|
-
└ other shared chunks (total) 241 B
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
○ (Static) prerendered as static content
|
|
49
|
-
|
package/template/KNOWN_ISSUES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Known Issues
|
|
1
|
+
# Known Issues — SaaS Starter Template
|
|
2
2
|
|
|
3
|
-
> **Last Updated:** March
|
|
3
|
+
> **Last Updated:** March 8, 2026
|
|
4
4
|
> **Template:** `saas-starter` (TaskFlow)
|
|
5
5
|
> **Status:** All features functional, builds with 0 errors (8 routes + _not-found)
|
|
6
6
|
|
|
@@ -10,60 +10,50 @@
|
|
|
10
10
|
|
|
11
11
|
| Feature | Status | Notes |
|
|
12
12
|
|---------|--------|-------|
|
|
13
|
-
| Landing Page | Working | 6 sections, scroll animations, social proof
|
|
14
|
-
| Login | Working | Email/Google
|
|
15
|
-
| Dashboard | Working | KPI cards,
|
|
16
|
-
| Projects CRUD | Working |
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
| Protected Routes | Working | Automatic redirect for unauthenticated users |
|
|
23
|
-
| Color Themes | Working | 4 built-in presets (Blue, Purple, Green, Orange) via CSS variables |
|
|
24
|
-
| Static Export | Working | `output: 'export'` for static hosting deployment |
|
|
25
|
-
| Mobile Nav | Working | Hamburger menu with responsive sidebar |
|
|
26
|
-
| CSV Export | Working | One-click export for tasks and projects |
|
|
27
|
-
| SEO | Working | OpenGraph, Twitter cards, robots.txt, sitemap template |
|
|
13
|
+
| Landing Page | Working | 6 sections, scroll animations, social proof |
|
|
14
|
+
| Auth (Login) | Working | Email/Google via Privy, zero-config dev credentials |
|
|
15
|
+
| Dashboard | Working | KPI cards, checklist, activity feed |
|
|
16
|
+
| Projects/Tasks/Team CRUD | Working | Full create, read, update, delete with validation |
|
|
17
|
+
| Settings | Working | 4 tabs with backend persistence via DB Proxy |
|
|
18
|
+
| Command Palette | Working | Cmd+K / Ctrl+K |
|
|
19
|
+
| Color Themes | Working | 4 presets (Blue, Purple, Green, Orange) |
|
|
20
|
+
| Static Export | Working | `output: 'export'` for IPFS deployment |
|
|
21
|
+
| Mobile Nav | Working | Responsive sidebar with hamburger menu |
|
|
28
22
|
|
|
29
23
|
## Known Issues
|
|
30
24
|
|
|
31
|
-
### 1.
|
|
32
|
-
|
|
25
|
+
### 1. Auth Uses Privy Directly (Abstraction Coming Post-Beta)
|
|
26
|
+
The template uses `usePrivy()` and `NEXT_PUBLIC_PRIVY_APP_ID`. The planned `useAuth()` hook and `NEXT_PUBLIC_VARITY_AUTH_ID` env var are post-beta tasks. No action required -- current auth works correctly.
|
|
33
27
|
|
|
34
|
-
### 2.
|
|
35
|
-
|
|
28
|
+
### 2. Payments Section is Placeholder
|
|
29
|
+
Settings > Billing shows mock UI. Credit card payment integration (on/off ramp) is coming soon. Wire your own billing provider (Stripe, etc.) if needed now.
|
|
36
30
|
|
|
37
|
-
### 3.
|
|
38
|
-
|
|
31
|
+
### 3. No Server-Side Rendering
|
|
32
|
+
All pages are statically exported. No SSR, API routes, or middleware. Do not use dynamic routes (`[id]` patterns) -- use client-side state for detail views instead.
|
|
39
33
|
|
|
40
|
-
### 4.
|
|
41
|
-
|
|
34
|
+
### 4. Navigation Flash
|
|
35
|
+
Brief "Initializing Dashboard" screen when navigating between pages. Caused by `PrivyReadyGate` re-checking auth state. Resolves in under 1 second.
|
|
42
36
|
|
|
43
|
-
### 5.
|
|
44
|
-
|
|
37
|
+
### 5. Team Email Invites Are Local Only
|
|
38
|
+
No SMTP integration. Team members are added to the database but no invitation email is sent. Integrate your own email service if needed.
|
|
45
39
|
|
|
46
|
-
### 6.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### 7. Team Email Invites
|
|
50
|
-
No SMTP integration -- team members are added to the database only. No invitation email is sent. Developers should integrate their own email service.
|
|
40
|
+
### 6. Sessions and Password Are Auth-Provider Managed
|
|
41
|
+
Settings > Security shows mock session data. Password changes and profile photos are managed by the auth provider (Privy), not the template.
|
|
51
42
|
|
|
52
43
|
## Environment
|
|
53
44
|
|
|
54
45
|
### Development (Zero Config)
|
|
55
46
|
```bash
|
|
56
|
-
npm install
|
|
57
|
-
npm run dev
|
|
47
|
+
npm install && npm run dev
|
|
58
48
|
```
|
|
59
|
-
No `.env` file, API keys, or accounts needed.
|
|
49
|
+
No `.env` file, API keys, or accounts needed.
|
|
60
50
|
|
|
61
51
|
### Production
|
|
62
52
|
```bash
|
|
63
53
|
varitykit app deploy
|
|
64
54
|
```
|
|
65
|
-
The CLI provisions a private database, injects production credentials, and deploys automatically.
|
|
66
55
|
|
|
67
56
|
## Reporting Issues
|
|
68
57
|
|
|
69
|
-
|
|
58
|
+
- GitHub: https://github.com/varity-labs/varity-sdk/issues
|
|
59
|
+
- Discord: https://discord.gg/7vWsdwa2Bg
|
package/template/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# TaskFlow
|
|
1
|
+
# TaskFlow — SaaS Starter Template
|
|
2
2
|
|
|
3
|
-
[](https://varity.so)
|
|
3
|
+
[](https://www.varity.so)
|
|
4
4
|
|
|
5
|
-
A full-featured project management app built with [Varity](https://varity.so). Everything works immediately
|
|
5
|
+
A full-featured project management app built with [Varity](https://www.varity.so). Everything works immediately — no configuration, no API keys, no setup.
|
|
6
6
|
|
|
7
7
|
## Quick Start
|
|
8
8
|
|
|
@@ -23,12 +23,12 @@ No `.env` file needed. No accounts to create. No credentials to configure.
|
|
|
23
23
|
|
|
24
24
|
Transform this into your own branded SaaS app:
|
|
25
25
|
|
|
26
|
-
1. **App name**
|
|
27
|
-
2. **Logo**
|
|
28
|
-
3. **Colors**
|
|
29
|
-
4. **Meta title**
|
|
30
|
-
5. **Navigation**
|
|
31
|
-
6. **Landing page**
|
|
26
|
+
1. **App name** — Edit `APP_NAME` in `src/lib/constants.ts`
|
|
27
|
+
2. **Logo** — Replace `public/logo.svg` with your logo
|
|
28
|
+
3. **Colors** — Open `src/app/globals.css` and uncomment a color preset (Purple, Green, or Orange) or set your own
|
|
29
|
+
4. **Meta title** — Update the `title` and `description` in `src/app/layout.tsx`
|
|
30
|
+
5. **Navigation** — Edit `NAVIGATION_ITEMS` in `src/lib/constants.ts` to rename or add sidebar links
|
|
31
|
+
6. **Landing page** — Edit the sections in `src/components/landing/` (Hero, Features, Pricing, etc.)
|
|
32
32
|
|
|
33
33
|
## Built-in Color Themes
|
|
34
34
|
|
|
@@ -44,53 +44,71 @@ Switch your entire app's color scheme by editing `src/app/globals.css`:
|
|
|
44
44
|
|
|
45
45
|
## What's Included
|
|
46
46
|
|
|
47
|
-
- **Zero-Config Auth**
|
|
48
|
-
- **Zero-Config Database**
|
|
49
|
-
- **Dashboard**
|
|
50
|
-
- **Full CRUD**
|
|
51
|
-
- **Command Palette**
|
|
52
|
-
- **Protected Routes**
|
|
53
|
-
- **Landing Page**
|
|
54
|
-
- **Mobile Responsive**
|
|
55
|
-
- **TypeScript**
|
|
56
|
-
- **Tailwind CSS**
|
|
47
|
+
- **Zero-Config Auth** — Email and social login works out of the box
|
|
48
|
+
- **Zero-Config Database** — Data persistence with isolated dev environment
|
|
49
|
+
- **Dashboard** — KPI cards, data tables, status badges, getting started guide
|
|
50
|
+
- **Full CRUD** — Create, read, update, delete for projects, tasks, and team members
|
|
51
|
+
- **Command Palette** — Cmd+K search across all data
|
|
52
|
+
- **Protected Routes** — Automatic redirect for unauthenticated users
|
|
53
|
+
- **Landing Page** — Professional marketing page with hero, features, pricing, testimonials
|
|
54
|
+
- **Mobile Responsive** — Hamburger menu, responsive layouts, touch-friendly
|
|
55
|
+
- **TypeScript** — Full type safety throughout
|
|
56
|
+
- **Tailwind CSS** — Utility-first styling with CSS variable theming
|
|
57
57
|
|
|
58
|
-
## Zero Configuration Required
|
|
58
|
+
## ✅ Zero Configuration Required
|
|
59
59
|
|
|
60
60
|
This template works immediately with **zero setup**:
|
|
61
61
|
|
|
62
62
|
### Instant Auth
|
|
63
|
-
- Email login (
|
|
64
|
-
-
|
|
65
|
-
- Dev credentials built-in
|
|
66
|
-
- No env vars needed
|
|
63
|
+
- ✅ Email login (built-in)
|
|
64
|
+
- ✅ Google/Apple social login
|
|
65
|
+
- ✅ Dev credentials built-in
|
|
66
|
+
- ❌ No env vars needed
|
|
67
67
|
|
|
68
68
|
### Instant Database
|
|
69
|
-
- Create, read, update, delete data
|
|
70
|
-
- Dev token built-in
|
|
71
|
-
- Production-ready
|
|
72
|
-
- No credentials needed
|
|
69
|
+
- ✅ Create, read, update, delete data
|
|
70
|
+
- ✅ Dev token built-in
|
|
71
|
+
- ✅ Production-ready proxy
|
|
72
|
+
- ❌ No credentials needed
|
|
73
73
|
|
|
74
74
|
### Instant Deploy
|
|
75
75
|
```bash
|
|
76
|
-
|
|
76
|
+
npm run deploy
|
|
77
77
|
```
|
|
78
|
-
- Deploys to production
|
|
79
|
-
- Auto-
|
|
80
|
-
- No accounts needed
|
|
78
|
+
- ✅ Deploys to production
|
|
79
|
+
- ✅ Auto-fetches credentials
|
|
80
|
+
- ❌ No extra accounts needed
|
|
81
81
|
|
|
82
82
|
---
|
|
83
83
|
|
|
84
|
+
## 🏗️ Architecture
|
|
85
|
+
|
|
86
|
+
### Workspace Dependencies
|
|
87
|
+
This template uses `workspace:^` protocol for Varity packages:
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"dependencies": {
|
|
91
|
+
"@varity-labs/sdk": "workspace:^",
|
|
92
|
+
"@varity-labs/ui-kit": "workspace:^",
|
|
93
|
+
"@varity-labs/types": "workspace:^"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Why?** Ensures you always use the latest local package versions during development.
|
|
99
|
+
|
|
100
|
+
**Publishing:** When published to npm, `workspace:^` converts to `^2.0.0-alpha.1` automatically.
|
|
101
|
+
|
|
84
102
|
### Static Export Ready
|
|
85
|
-
- `output: 'export'` in next.config.js
|
|
86
|
-
- All pages pre-rendered to static HTML
|
|
87
|
-
- No server-side dependencies
|
|
88
|
-
- CDN deployable
|
|
103
|
+
- ✅ `output: 'export'` in next.config.js
|
|
104
|
+
- ✅ All pages pre-rendered to static HTML
|
|
105
|
+
- ✅ No server-side dependencies
|
|
106
|
+
- ✅ CDN deployable
|
|
89
107
|
|
|
90
108
|
### Type Safety
|
|
91
|
-
- TypeScript strict mode enabled
|
|
92
|
-
- All errors surface during build
|
|
93
|
-
- No `ignoreBuildErrors` flag
|
|
109
|
+
- ✅ TypeScript strict mode enabled
|
|
110
|
+
- ✅ All errors surface during build
|
|
111
|
+
- ✅ No `ignoreBuildErrors` flag
|
|
94
112
|
|
|
95
113
|
## Project Structure
|
|
96
114
|
|
|
@@ -187,17 +205,17 @@ export function useInvoices(): UseCollectionReturn<Invoice> {
|
|
|
187
205
|
const { data, loading, create, update, remove } = useInvoices();
|
|
188
206
|
```
|
|
189
207
|
|
|
190
|
-
The database collection is created automatically on first use
|
|
208
|
+
The database collection is created automatically on first use — no migrations needed.
|
|
191
209
|
|
|
192
210
|
## Environment Variables
|
|
193
211
|
|
|
194
212
|
**For development:** Leave everything blank. Shared development credentials are used automatically.
|
|
195
213
|
|
|
196
|
-
**For production:** Run `varitykit app deploy`
|
|
214
|
+
**For production:** Run `varitykit app deploy` — it injects all credentials into your build automatically. You never need to manually set API keys.
|
|
197
215
|
|
|
198
216
|
| Variable | Required | Notes |
|
|
199
217
|
|----------|----------|-------|
|
|
200
|
-
| `
|
|
218
|
+
| `NEXT_PUBLIC_VARITY_AUTH_ID` | No | Auth provider (auto-configured) |
|
|
201
219
|
| `NEXT_PUBLIC_VARITY_APP_TOKEN` | No | Database token (auto-configured) |
|
|
202
220
|
| `NEXT_PUBLIC_VARITY_APP_ID` | No | App ID (auto-configured) |
|
|
203
221
|
|
|
@@ -211,7 +229,7 @@ varitykit app deploy
|
|
|
211
229
|
varitykit app deploy --submit-to-store
|
|
212
230
|
```
|
|
213
231
|
|
|
214
|
-
The CLI builds your app, provisions a private database, injects production credentials, and deploys
|
|
232
|
+
The CLI builds your app, provisions a private database, injects production credentials, and deploys — all in one command.
|
|
215
233
|
|
|
216
234
|
**Deploy from your AI editor:** Set up the [Varity MCP server](https://docs.varity.so/mcp) (`npx @varity-labs/mcp`) and ask your AI to "deploy this project".
|
|
217
235
|
|
package/template/next.config.js
CHANGED
|
@@ -5,7 +5,7 @@ const nextConfig = {
|
|
|
5
5
|
trailingSlash: true,
|
|
6
6
|
productionBrowserSourceMaps: false,
|
|
7
7
|
webpack: (config, { isServer, dev }) => {
|
|
8
|
-
// Suppress
|
|
8
|
+
// Suppress MetaMask SDK warning for @react-native-async-storage
|
|
9
9
|
config.resolve.fallback = {
|
|
10
10
|
...config.resolve.fallback,
|
|
11
11
|
'@react-native-async-storage/async-storage': false,
|
package/template/package.json
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"deploy": "varitykit app deploy"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@varity-labs/sdk": "
|
|
21
|
-
"@varity-labs/types": "
|
|
22
|
-
"@varity-labs/ui-kit": "
|
|
20
|
+
"@varity-labs/sdk": "workspace:^",
|
|
21
|
+
"@varity-labs/types": "workspace:^",
|
|
22
|
+
"@varity-labs/ui-kit": "workspace:^",
|
|
23
23
|
"lucide-react": "^0.400.0",
|
|
24
24
|
"next": "^15.0.0",
|
|
25
25
|
"react": "^18.3.0",
|
|
@@ -7,20 +7,18 @@ import { useProjects, useTasks, useTeam } from '@/lib/hooks';
|
|
|
7
7
|
import { CommandPalette } from '@varity-labs/ui-kit';
|
|
8
8
|
import { Menu, X } from 'lucide-react';
|
|
9
9
|
|
|
10
|
-
// Conditionally import UI-Kit components
|
|
10
|
+
// Conditionally import Privy/UI-Kit components
|
|
11
11
|
let DashboardLayout: any = null;
|
|
12
|
-
let
|
|
13
|
-
let
|
|
14
|
-
let
|
|
15
|
-
let useAuthHook: any = null;
|
|
12
|
+
let PrivyProtectedRoute: any = null;
|
|
13
|
+
let PrivyStackComponent: any = null;
|
|
14
|
+
let usePrivyHook: any = null;
|
|
16
15
|
|
|
17
16
|
try {
|
|
18
17
|
const uiKit = require('@varity-labs/ui-kit');
|
|
19
18
|
DashboardLayout = uiKit.DashboardLayout;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
useAuthHook = uiKit.useAuth;
|
|
19
|
+
PrivyProtectedRoute = uiKit.PrivyProtectedRoute;
|
|
20
|
+
PrivyStackComponent = uiKit.PrivyStack;
|
|
21
|
+
usePrivyHook = uiKit.usePrivy;
|
|
24
22
|
} catch {}
|
|
25
23
|
|
|
26
24
|
function RedirectToLogin() {
|
|
@@ -113,8 +111,8 @@ function MobileNav({
|
|
|
113
111
|
|
|
114
112
|
function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
115
113
|
// eslint-disable-next-line react-hooks/rules-of-hooks -- conditional on require() success, stable across renders
|
|
116
|
-
const
|
|
117
|
-
const { user, logout } =
|
|
114
|
+
const privy = usePrivyHook ? usePrivyHook() : { user: null, logout: async () => {} };
|
|
115
|
+
const { user, logout } = privy;
|
|
118
116
|
const pathname = usePathname();
|
|
119
117
|
const router = useRouter();
|
|
120
118
|
const isMobile = useIsMobile();
|
|
@@ -154,7 +152,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
154
152
|
const userName = user?.email?.address?.split('@')[0] || 'User';
|
|
155
153
|
const userEmail = user?.email?.address || '';
|
|
156
154
|
|
|
157
|
-
const
|
|
155
|
+
const handleLogout = async () => {
|
|
158
156
|
await logout();
|
|
159
157
|
router.push('/');
|
|
160
158
|
};
|
|
@@ -196,7 +194,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
196
194
|
</nav>
|
|
197
195
|
<div className="mt-8 px-3 border-t border-gray-200 pt-4">
|
|
198
196
|
<button
|
|
199
|
-
onClick={
|
|
197
|
+
onClick={handleLogout}
|
|
200
198
|
className="flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium text-red-600 hover:bg-red-50 transition-colors"
|
|
201
199
|
>
|
|
202
200
|
Sign Out
|
|
@@ -212,7 +210,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
212
210
|
onClose={() => setMobileMenuOpen(false)}
|
|
213
211
|
navItems={navWithActive}
|
|
214
212
|
userEmail={userEmail}
|
|
215
|
-
onLogout={
|
|
213
|
+
onLogout={handleLogout}
|
|
216
214
|
onNavigate={(path) => router.push(path)}
|
|
217
215
|
/>
|
|
218
216
|
)}
|
|
@@ -243,7 +241,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
243
241
|
onClose={() => setMobileMenuOpen(false)}
|
|
244
242
|
navItems={navWithActive}
|
|
245
243
|
userEmail={userEmail}
|
|
246
|
-
onLogout={
|
|
244
|
+
onLogout={handleLogout}
|
|
247
245
|
onNavigate={(path) => router.push(path)}
|
|
248
246
|
/>
|
|
249
247
|
)}
|
|
@@ -259,7 +257,7 @@ function DashboardShell({ children }: { children: React.ReactNode }) {
|
|
|
259
257
|
name: userName,
|
|
260
258
|
address: userEmail,
|
|
261
259
|
}}
|
|
262
|
-
onLogout={
|
|
260
|
+
onLogout={handleLogout}
|
|
263
261
|
onNavigateToProfile={() => router.push('/dashboard/settings')}
|
|
264
262
|
onNavigateToSettings={() => router.push('/dashboard/settings')}
|
|
265
263
|
onSearchClick={() => setCommandPaletteOpen(true)}
|
|
@@ -279,23 +277,22 @@ export default function DashboardRootLayout({
|
|
|
279
277
|
}: {
|
|
280
278
|
children: React.ReactNode;
|
|
281
279
|
}) {
|
|
282
|
-
//
|
|
283
|
-
if (!
|
|
280
|
+
// Always wrap in PrivyStack + PrivyProtectedRoute - uses dev credentials automatically when env vars are empty
|
|
281
|
+
if (!PrivyProtectedRoute || !PrivyStackComponent) {
|
|
284
282
|
// Fallback if ui-kit package isn't installed
|
|
285
283
|
return <DashboardShell>{children}</DashboardShell>;
|
|
286
284
|
}
|
|
287
285
|
|
|
288
286
|
return (
|
|
289
|
-
<
|
|
290
|
-
appId={process.env.
|
|
287
|
+
<PrivyStackComponent
|
|
288
|
+
appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID}
|
|
289
|
+
thirdwebClientId={process.env.NEXT_PUBLIC_THIRDWEB_CLIENT_ID}
|
|
291
290
|
loginMethods={['email', 'google']}
|
|
292
291
|
appearance={{ theme: 'light', accentColor: '#2563EB', logo: '/logo.svg' }}
|
|
293
292
|
>
|
|
294
|
-
<
|
|
295
|
-
<
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
</ZeroDevProviderComponent>
|
|
299
|
-
</AuthStackComponent>
|
|
293
|
+
<PrivyProtectedRoute fallback={<RedirectToLogin />}>
|
|
294
|
+
<DashboardShell>{children}</DashboardShell>
|
|
295
|
+
</PrivyProtectedRoute>
|
|
296
|
+
</PrivyStackComponent>
|
|
300
297
|
);
|
|
301
298
|
}
|