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
5 changes: 5 additions & 0 deletions .changeset/quick-ends-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@proofkit/typegen": patch
---

Add type import to the `InferZodPortals` import
8 changes: 5 additions & 3 deletions .changeset/ui-default-shadcn.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
---
"@proofkit/cli": minor
"@proofkit/cli": major
---

CLI defaults to shadcn/ui for new projects. Legacy Mantine templates are still available via a hidden `--ui mantine` flag during `init`. The selected UI is persisted in `proofkit.json` as `ui`. Existing projects using Mantine are auto-detected and remain fully supported. For shadcn-based projects, adding new pages or auth via `proofkit add` requires passing the name of the component you want to add, such as `proofkit add table/basic`. Interactive selection of templates will come back soon!
Learn more about v2 in the docs: [https://proofkit.com/docs/cli/v2](https://proofkit.com/docs/cli/v2)

This release also deprecates the `mantine` UI templates. In the next major release of the CLI, the `mantine` UI templates will no longer be supported for new projects.
CLI now defaults to shadcn/ui for new projects. Legacy Mantine templates are still available via a hidden `--ui mantine` flag during `init`. The selected UI is persisted in `proofkit.json` as `ui`. Existing projects using Mantine may not be fully supported.

For adding new pages or auth via `proofkit add`, you will need to pass the name of the component you want to add, such as `proofkit add table/basic`. See new templates in the [docs](/docs/templates).
11 changes: 11 additions & 0 deletions apps/docs/cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"aliases": {
"uiDir": "./components/ui",
"componentsDir": "./components",
"blockDir": "./components",
"cssDir": "./styles",
"libDir": "./lib"
},
"baseDir": "src",
"commands": {}
}
42 changes: 28 additions & 14 deletions apps/docs/content/docs/better-auth/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,27 @@ title: Installation & Usage

import { Callout } from "fumadocs-ui/components/callout";

import { CliCommand } from "@/components/CliCommand";


<Callout type="warning">
This package is currently in beta. Please report any issues you find to the [GitHub repository](https://github.com/proofgeist/proofkit/issues), or reach out to us in the [Community](https://community.ottomatic.cloud/c/proofkit/13)
</Callout>

# Prerequisites
- Ensure OData is enabled on your FileMaker server.
- Ensure your credentials have the `fmodata` privilege enabled.
- If you are using OttoFMS 4.11+ and you want to use a Data API key instead of plain credentials, ensure OData is enabled for that key.

# Step 1a: Automated Setup with the ProofKit CLI
<Callout type="warning">
This automated setup expects you to have Next.js and shadcn/ui set up in your project. It will also setup various auth pages for you, but these may not work if you have a prefix configured for tailwindcss. You can use this opinionated setup to get you started, or if you need more control you should refer to the manual setup.
</Callout>

Run the following command to add the necessary packages and config files to your project. You will not need to follow the better-auth installation guide.
<CliCommand command="add better-auth" exec />

# Step 1b: Manual Setup

Follow the [Better-Auth installation guide](https://better-auth.com/docs/installation) to get started in your app, but come back here for special instructions for anything related to your Database Setup or schema migrations.

Expand Down Expand Up @@ -39,26 +55,24 @@ export const auth = betterAuth({
database: process.env.FM_DATABASE,
},
}),
// ...rest of your config
});
```

### Create Database Tables
# Step 2: Create/Update Database Tables

Run the following command to create the necessary tables and fields in your FileMaker file.
```bash
pnpm dlx @proofkit/better-auth@latest migrate
```
[Full Access] credentials are required for the schema changes to be applied automatically, but you may want to use a more restricted account for the rest of better-auth usage. If your credentials that you entered eariler in the `auth.ts` file do not have the [Full Access] permissions, you can override them in the CLI.
```bash
pnpm dlx @proofkit/better-auth@latest migrate --username "full_access_username" --password "full_access_password"
```
Run the following command to create the necessary tables and fields in your FileMaker file. It will show you a confirmation before any changes are applied, so you can review them.
<CliCommand command="migrate" exec execPackage="@proofkit/better-auth@latest" />

<Callout type="info">
If you make any schema-related changes to the better-auth config, such as adding plugins, you will need to run the migration command again to apply the changes to your FileMaker file.
</Callout>
[Full Access] credentials are required for the schema changes to be applied automatically, but you may want to use a more restricted account for the rest of better-auth usage. If your credentials that you entered earlier in the `auth.ts` file do not have the [Full Access] permissions, you can override them in the CLI.
<CliCommand command={`migrate --username "full_access_username" --password "full_access_password"`} exec execPackage="@proofkit/better-auth@latest" />

These changes affect database schema only. No layouts or relationships are created or modified during this process.

The tables/fields that are created will be dependent on how your `auth.ts` file is setup. If you want to use any of your existing tables, just set [custom table names](https://www.better-auth.com/docs/concepts/database#custom-table-names) in the `auth.ts` file before running the migration command.

Comment on lines +72 to 73
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typos/wording: “is setup” → “is set up”.

Also simplify phrasing.

Apply this diff:

-The tables/fields that are created will be dependent on how your `auth.ts` file is setup. If you want to use any of your existing tables, just set [custom table names](https://www.better-auth.com/docs/concepts/database#custom-table-names) in the `auth.ts` file before running the migration command.
+The tables/fields that are created will depend on how your `auth.ts` file is set up. If you want to use any of your existing tables, set [custom table names](https://www.better-auth.com/docs/concepts/database#custom-table-names) in the `auth.ts` file before running the migration command.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The tables/fields that are created will be dependent on how your `auth.ts` file is setup. If you want to use any of your existing tables, just set [custom table names](https://www.better-auth.com/docs/concepts/database#custom-table-names) in the `auth.ts` file before running the migration command.
The tables/fields that are created will depend on how your `auth.ts` file is set up. If you want to use any of your existing tables, set [custom table names](https://www.better-auth.com/docs/concepts/database#custom-table-names) in the `auth.ts` file before running the migration command.
🤖 Prompt for AI Agents
In apps/docs/content/docs/better-auth/installation.mdx around lines 72-73, fix
the wording "is setup" to "is set up" and simplify the sentence for clarity;
reword the two sentences into a single concise sentence that advises the reader
that created tables/fields depend on their auth.ts configuration and that
existing tables can be used by setting custom table names in auth.ts before
running the migration command.

## Next Steps
You may see fields added to your tables that you don't plan on using, but it's best to keep them in your database anyway to avoid potential errors.

Now that you have your database setup and your tables created, you can continue with the [Better-Auth installation guide](https://better-auth.com/docs/installation) to get your app up and running.
<Callout type="info">
If you make any schema-related changes to the better-auth config, such as adding plugins, you will need to run the migration command again to apply the changes to your FileMaker file.
</Callout>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ icon: puzzle

import { CliCommand } from "@/components/CliCommand";

After initilizing a new ProofKit project, you can use the CLI to add new components and features.

After initializing a new ProofKit project, you can use the CLI to add new components and features.

<Callout title="Major changes in v2!">
The `add` is now more dynamic and may change over time. To see all available items you can add via this command, see the [full list of templates available here](/docs/templates)
</Callout>

The ProofKit package is installed in your project, and as a script in your `package.json`, so you can run the following command (as long as your current directory is your project root):


<CliCommand command="proofkit"/>


Expand Down
6 changes: 6 additions & 0 deletions apps/docs/content/docs/cli/guides/adding-components/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "Adding Components",
"icon": "puzzle",
"pages": ["templates"],
"defaultOpen": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: All Templates
icon: ExternalLink
---

import Redirect from "@/components/redirect";

# ProofKit Templates
<Redirect href="/docs/templates" />
4 changes: 4 additions & 0 deletions apps/docs/content/docs/cli/guides/auth/add-on.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ description: How to add FileMaker Add-on Auth to your FileMaker file
import { CliCommand } from "@/components/CliCommand";


<Callout type="warning" title="Deprecated">
This component is no longer the recommended approach for self-hosting your web app's authentication in FileMaker. Instead, check out the [Better-Auth installation guide](/docs/better-auth/installation) for a more flexible and customizable solution.
</Callout>

ProofKit includes a self-hosted authentication solution that is built to be flexible and easy to customize. Rather than using a third-party library or authentication service, the ProofKit CLI installs all of the necessary functions into your project and then you just have to install the FileMaker add-on in your FileMaker file to get the necessary tables in your database.

While FileMaker Add-on Auth is built to be secure, it is more advanced than a typical third-party authentication service and does warrant a good understanding of how it works before you customize it beyond the default settings. For more details about the security principles behind it, see the [Lucia documentation](https://lucia-auth.com/).
Expand Down
31 changes: 15 additions & 16 deletions apps/docs/content/docs/cli/guides/motivation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sidebar:

import { Card } from "fumadocs-ui/components/card";
import { Callout } from "fumadocs-ui/components/callout";
import { Badge } from "@/components/ui/badge";

The ProofKit CLI aims to make web development easier for beginners and more efficient for experienced devs. Its _opinionated_ structure allows for more than just a starter template or bootstrapping tool, but code-mod scripts that can modify a project after the initial setup.

Expand Down Expand Up @@ -36,11 +37,20 @@ Here is a list of the frameworks and packages that you'll come across in a Proof

A well-supported open-source React framework for full-stack web applications. This means it runs code on your frontend (in the client's web browser) and backend (on the web server, or API routes). It makes it easy to get a web app up and running with all the features that we expect from a modern web app and is used by companies of all sizes to power their online presence.

#### [Mantine](https://mantine.dev/)
#### [Shadcn/ui](https://ui.shadcn.com/) <Badge className="bg-blue-200 text-blue-700 dark:bg-blue-500 dark:text-blue-50 ">NEW</Badge>

A vast, themeable component library for React. We use their default components and styles to build apps very quickly, but with the option of adding custom styles or themes later if needed. Mantine also includes many helpful React hooks, and they provide a Modal and Notification system to ProofKit apps.
A themeable component library for React. We use their default components and styles to build apps very quickly, but with the option of adding custom styles or themes later if needed. Shadcn/ui also includes many helpful React hooks, and they provide a Modal and Notification system to ProofKit apps.

Why not tailwind css and/or shadcn/ui? We've chosen to focus on Mantine because it has allowed our team to work much faster for the kinds of web apps that we build for our clients. When you're working on multiple projects at once, it's actually a benefit to **not** own the component code within an individual codebase, so that it can be more easily upgraded when the time comes. However, we have not ruled out other components and style systems and may add support for them in the future.
Using the shadcn CLI, you can install any component or utility from any compatible library. This makes shadcn the best choice for the most flexible and customizable apps. Some of our favorite shadcn-compatible libraries are:
- [Kibu Ui](https://www.kibo-ui.com/)
- [reui](https://reui.io/)
- [Magic UI](https://magicui.design/)
- [tweakcn (easily theme your components)](https://tweakcn.com/)
- [A longer list of more...](https://github.com/birobirobiro/awesome-shadcn-ui)

#### [Tailwind CSS](https://tailwindcss.com/) <Badge className="bg-blue-200 text-blue-700 dark:bg-blue-500 dark:text-blue-50 ">NEW</Badge>
Comment on lines +40 to +51
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typos/brand casing and a factual correction for TanStack Query.

  • Use “shadcn/ui” casing; fix “Kibu Ui” → “Kibo UI”; “neccesary” → “necessary”.
  • TanStack Query manages server state/caching; it doesn’t ensure data “shape” — that’s Zod.

Apply this diff:

-#### [Shadcn/ui](https://ui.shadcn.com/) <Badge className="bg-blue-200 text-blue-700 dark:bg-blue-500 dark:text-blue-50 ">NEW</Badge>
+#### [shadcn/ui](https://ui.shadcn.com/) <Badge className="bg-blue-200 text-blue-700 dark:bg-blue-500 dark:text-blue-50 ">NEW</Badge>-Some of our favorite shadcn-compatible libraries are:
-- [Kibu Ui](https://www.kibo-ui.com/)
+Some of our favorite shadcn-compatible libraries are:
+- [Kibo UI](https://www.kibo-ui.com/)
 - [reui](https://reui.io/)
 - [Magic UI](https://magicui.design/)
 - [tweakcn (easily theme your components)](https://tweakcn.com/)
 - [A longer list of more...](https://github.com/birobirobiro/awesome-shadcn-ui)
…
-#### [Tanstack Query](https://tanstack.com/query)
+#### [TanStack Query](https://tanstack.com/query)-Sometimes also known as "React Query"; a library for managing server state in React. It's used by ProofKit to fetch data from external sources, such as REST APIs, so we can be certain that the "shape" of our data matches what we expected during development.
+Sometimes also known as "React Query"; a library for managing server state in React. It's used by ProofKit for fetching, caching, deduping, background updates, and invalidation of server data.-For when you need a bit more flexibility or if you want to self-host the authentication layer within your existing FileMaker solution. Better-auth is a great choice for this, and the [proofkit/better-auth](/docs/better-auth) adapter allows you to use FileMaker as your backend database, including automated schema migrations to easily add any neccesary tables and fields to your FileMaker file.
+For when you need a bit more flexibility or if you want to self-host the authentication layer within your existing FileMaker solution. Better-auth is a great choice for this, and the [proofkit/better-auth](/docs/better-auth) adapter allows you to use FileMaker as your backend database, including automated schema migrations to easily add any necessary tables and fields to your FileMaker file.

Also applies to: 55-62, 73-76

🤖 Prompt for AI Agents
In apps/docs/content/docs/cli/guides/motivation.mdx around lines 40-51 (and also
apply the same fixes to lines 55-62 and 73-76), fix branding/casing typos and
one factual statement: change “shadcn/ui” to lowercase exactly as "shadcn/ui",
rename “Kibu Ui” to “Kibo UI”, correct “neccesary” to “necessary” wherever
present, and update the TanStack Query sentence to state that TanStack Query
manages server state/caching (not data shape) and attribute validation/ensuring
data shape to Zod (reword the sentence to reflect that distinction).


A utility-first CSS framework for rapidly building custom user interfaces. It's used by shadcn (and related libraries) to style the components and pages in your app.

#### [Tanstack Query](https://tanstack.com/query)

Expand All @@ -60,17 +70,6 @@ A wrapper around Next.js actions that include middleware (for easily checking th

A hosted authentication service that is extremely easy to set up and use. It's a great choice to secure most customer-facing web apps, including built-in features such as Social logins, magic link, multi-factor authentication, and more.

#### Self-Hosted Auth

For when you need a bit more flexibility or if you want to self-host the authentication layer, ProofKit can also scaffold out all the security functions required for you to manage your own authentication. Learn more in this guide: [FileMaker Add-on Auth](/docs/cli/guides/auth/add-on)


### Data Sources

#### [Supabase](https://supabase.com/)

An open-source set of tools that are centered around a Postgres database. They also offer an authentication layer to handle user logins all under one roof.

#### [FileMaker](https://www.claris.com/)
#### [Better-Auth](https://better-auth.com/) (self-hosted)

A database and application development platform that allows users to create custom apps and automate processes.
For when you need a bit more flexibility or if you want to self-host the authentication layer within your existing FileMaker solution. Better-auth is a great choice for this, and the [proofkit/better-auth](/docs/better-auth) adapter allows you to use FileMaker as your backend database, including automated schema migrations to easily add any necessary tables and fields to your FileMaker file.
32 changes: 29 additions & 3 deletions apps/docs/content/docs/cli/index.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,38 @@
---
title: ProofKit CLI
icon: terminal
title: Introduction
description: Build a web-app quicker than ever before.
---

import { InitCommand } from "@/components/InitCommand";
import { Card } from "fumadocs-ui/components/card";

Build a web-app quicker than ever before.

## What is ProofKit?
ProofKit is a collection of TypeScript tools and libraries for building modern web applications, with a focus on seamless integration with Claris FileMaker.

The ProofKit CLI aims to make web development easier for beginners and more efficient for experienced devs. Its opinionated structure allows for more than just a starter template or bootstrapping tool, but code-mod scripts that can modify a project after the initial setup.

Think of it as our experience building web apps encapsulated into a CLI tool to help you structure your project and add to it over time. Each template is just a starting point, and you are free to modify any part of it as you see fit.

## Core Libraries

The ProofKit CLI will automatically install these other packages for you (depending on what you choose to build), but they are published separately if you want to use them in your own projects, without the opinionated structure provided by the CLI.
<Cards>
<Card href="/docs/fmdapi" title="@proofkit/fmdapi">
A library for interacting with the FileMaker Data API.
</Card>
<Card href="/docs/typegen" title="@proofkit/typegen">
A library for generating TypeScript types and validation schemas from FileMaker layouts.
</Card>
<Card href="/docs/webviewer" title="@proofkit/webviewer">
A library for interacting with the FileMaker WebViewer.
</Card>
<Card href="/docs/better-auth" title="@proofkit/better-auth">
Self-hosted auth for your web apps, backed by your FileMaker database.
</Card>
</Cards>



## Quick Start
<InitCommand />
Expand Down
3 changes: 2 additions & 1 deletion apps/docs/content/docs/cli/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"icon": "Terminal",
"root": true,
"pages": [
"index",
"guides/motivation",
"v2",
"---Guides---",
"guides/getting-started",
"guides/adding-components",
Expand All @@ -14,7 +16,6 @@
"webviewer",
"---Reference---",
"reference/cli-commands",
"reference/folder-structure",
"guides/resources"
]
}
12 changes: 12 additions & 0 deletions apps/docs/content/docs/cli/registry/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: ProofKit Registry
description: A collection of ProofKit templates for building great apps
---

The ProofKit Registry is a collection of ProofKit templates for building great apps.

## Templates

### @proofkit/template-basic

A basic ProofKit template for building great apps.
51 changes: 51 additions & 0 deletions apps/docs/content/docs/cli/v2.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: What's new in v2?
description: In this major release, the ProofKit CLI has been reimagined as a more powerful tool for building web apps.
---

# The Highlights

### A new starting point

When you start a new app using the ProofKit CLI, the new template is based on shadcn and tailwindcss instead of Mantine. This new simple template still includes the best practices from the Proof+Geist team, but now with even more flexibility.

### A new way to add [anything]

The `proofkit add` command leverages the shadcn CLI to install any component or utility into your app, or you can use the shadcn CLI directly to install any component from any compatible library. Even better, these templates are now published right here on the docs site, so we can more easily release updates and new components that you can use right away.

### A new level of compatibility

You can now use the ProofKit CLI in an existing Next.js app, even if it wasn’t bootstrapped with the CLI, as long as it's already using shadcn. This unlocks the ability for more advanced developers to leverage the power of ProofKit, while still trying out the latest and greatest in the JavaScript ecosystem.

# Why the change?

Adding new templates to the ProofKit CLI was always a challenge, and arguably the most lacking of the whole system. The templates are meant to be just a starting place, so they needed to be generic to fit any project, yet useful enough to warrant inclusion in the binary everyone downloads to run the CLI. That wasn’t scalable. But shadcn has taken the JavaScript world by storm over the past few years, especially with the rise of AI and especially tools like v0. We needed to unlock the ability to easily add anything to your JavaScript projects, whether it was a template from Proof, shadcn, v0 (AI-generated), or from any of the other emerging UI libraries built on the shadcn CLI.

But this required a new starting point. While mantine and tailwind can be used together in the same project, they get in each other’s way. At Proof+Geist, we’ve been building new projects without ProofKit for a few months now, so it was time to bring those learnings back to the framework so we could all move more quickly. New projects will start with a new foundation based on tailwindcss. It’s easier for AI to understand, and more compatible with any UI component built for shadcn to install for you.

But the shadcn CLI isn’t just about UI components. It can install any utility or set of components into your app. Take the new `@proofkit/better-auth` package that was recently released. It’s the best way to quickly and easily add self-hosted authentication to your web app, without having to compromise on login options or pay for an external auth service. But setting it up was not easy...until now! Check out our @proofkit/better-auth [guide](/docs/better-auth/installation) for more details.

# Upgrade from v1

Unfortunately, there is not an easy path for you to upgrade projects that were created with v1 to be fully compatible with v2. But if you are able to setup tailwindcss and shadcn in your existing project, you can still use the ProofKit CLI to add new components and utilities to your app.

Basic steps:

1. Configure [tailwindcss](https://tailwindcss.com/) in your project.
- If possible, you should replace any use of the Mantine UI library with tailwind-based components. You could also configure tailwind with a prefix so as not to conflict with the Mantine classes, but not all of the new components are compatible.
2. Install [shadcn](https://ui.shadcn.com/).
3. Add/change the "ui" key in your `proofkit.json` file and set to "shadcn".

```json title="proofkit.json"
{
"ui": "shadcn"
}
```

4. Install/update the ProofKit CLI, or use the npx commands to run the CLI without needing to install it in your project

<Callout title="We want your feedback!">
Please report any issues you find to the [GitHub
repository](https://github.com/proofgeist/proofkit/issues), or reach out to us
in the [Community](https://community.ottomatic.cloud/c/proofkit/13)
</Callout>
4 changes: 4 additions & 0 deletions apps/docs/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ A library for generating TypeScript types and validation schemas from FileMaker
### @proofkit/webviewer

A library for interacting with the FileMaker WebViewer. [Learn more](/docs/webviewer)

### @proofkit/better-auth

Self-hosted auth for your web apps, backed by your FileMaker database. [Learn more](/docs/better-auth)
2 changes: 1 addition & 1 deletion apps/docs/content/docs/meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"pages": ["cli", "fmdapi", "webviewer", "typegen", "better-auth"]
"pages": ["cli", "templates", "fmdapi", "webviewer", "typegen", "better-auth"]
}
3 changes: 3 additions & 0 deletions apps/docs/content/docs/templates/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: ProofKit Templates
---
6 changes: 6 additions & 0 deletions apps/docs/content/docs/templates/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"title": "Templates",
"description": "Quickly install via CLI",
"icon": "Puzzle",
"root": true
}
Loading
Loading