Have something to say?

Tell us how we could make the product more useful to you.

Completed

[Portability] - Workspace Drivers Architecture

Adds an ‘npm collect:drivers‘ script Scans for `{driverName}.{driverType}.ts` files Searches within ‘/drivers/‘ directories Supported {driverType} values: db - Data persistence (e.g. → ‘@db/mongoose‘) auth - Authentication (e.g. → ‘@auth/clerk‘) files - File Storage (e.g. → ‘@files/uploadthing‘) email - Sending emails (e.g. → ‘@email/resend‘) Provider selection is configured in ‘@app/config’ { db: 'mongoose', // from options 'mongoose' | 'supabase' | ... auth: 'clerk', // options 'clerk' | 'supabase' | 'workos' | ... } Driver packages ‘@{driverType}/driver’ re-export the selected provider’s core modules: ‘@db/driver‘ → insert / update / delete methods from ‘@db/mongoose‘ ‘@auth/driver‘ → SignIn / SignUp / useUser() / … from ‘@auth/clerk‘ All driver options must conform to a common driverType structure, enforced with Zod Key Benefits ❇️ Uses Zod to ensure a common interface for driver options Alternative to just Typescript for enforcing the driver “contract” ❇️ Swapping providers becomes a config change, not a rewrite Business logic stays mostly untouched ❇️ You can still use the drivers separately by importing from them directly e.g. ‘@db/mongoose‘ instead of ‘@db/driver‘ in some places Enables you to use different provider if required e.g. during a migration to a new provider 🚧 Caveats The architecture and script supporting this workspace driver architecture are finished, BUT, most of the actual drivers are still in progress: @[Plugin] - @db/driver @[Plugin] - @auth/driver You can already add your own custom drivers if you think this is an interesting approach Have a look at ‘mock.db.ts‘ as an example

Thorr Stevens 7 months ago

Completed

[Plugin] - Route, Form & API Generators

Expand the list of Turborepo Generators: ❇️ npm run add:route → New universal route & screen + link to data-fetcher? ❇️ npm run add:resolver → Add new API route & GraphQL resolver ❇️ npm run add:form → Add new Form State Hook All linked / linkable to the same resolver (DataBridge or input / output schemas) Interactive terminal UI to pick the destination / schema / resolver / … Single Source of Truth = Nothing gets out of sync, e.g. Recommended Workflow 💡 ❇️ Gen new schema → e.g. ‘/schemas/Post’ ⚙️ Turn schema into DB model → e.g. ‘/models/Posts’ Reuse ‘Post’ schema to create typed DB model ❇️ Gen new resolver → e.g. ‘getPost.resolver.ts‘ Reuse ‘Post’ schema as (DataBridge) output Reuse ‘Posts‘ model in actual business logic Choose option to also generate fetcher fn ❇️ Gen new route → e.g. ‘/posts/[id]‘ → Choose option to pick `getPost()` as initial data provider ❇️ Gen new form → e.g. `useUpdatePost()` Pick `Post` schema option to create form state hook for Updating the ‘Post‘ schema will now automatically update all the rest

Thorr Stevens 7 months ago

[Plugin] - Add @db/driver options (1/4)

Generic database driver Starts with mock / memory implementation (will warn you) Can also be hooked up to a custom implementation (e.g. → REST API) Merge a specific DB plugin to hook it up to an actual Database Solution, e.g. with/db-mongoose → ‘@db/mongoose‘ → (✅ done, but to be published) with/db-supabase → ‘@db/supabase‘ → (📆 planned) with/db-drizzle → ‘@db/drizzle‘ → (📆 planned) with/db-convex → ‘@db/convex‘ → (📆 planned) … Follows the “workspace driver“ pattern: Import DB essentials from @auth/driver (workspace) Create / Import DB models with common interfaces from Zod schemas insert(), insertOne(), insertMany(), … find(), findOne(), findMany(), … update(), updateOne(), updateMany(), … delete(), deleteOne(), deleteMany(), … findOrCreate(), upsertOne(), … … Can config / add / swap actual implementations without changing app code

Thorr Stevens 7 months ago

Completed

[Essentials] - Automated GraphQL API

Automatic GraphQL API → From linking Zod Input / Output schemas to resolver logic Creates ‘schema.graphql’ type & input defs from linked resolver zod schemas Automatically collects and links resolvers to their i/o schemas (👇) Builds an executable schema from them Sets up an `/api/graphql` endpoint using the Executable schema Fetchers automatically build their graphql query string from schemas as well Uses the Zod input & output schemas (DataBridge) as Single Source of Truth Automatically validates inputs → Executes the linkes resolver logic Basically, MOST of the GraphQL benefits without ANY of the hassle ✅ Strictly typed API contract between front-end & back-end ✅ Auto-documented API layer (using zod descriptions, etc.) 🙌 Never manually maintain graphql defs 🙌 Never manually write query definitions 🙌 Nothing can / will ever get out of sync this way More info: https://fullproduct.dev/docs/data-resolvers

Thorr Stevens 7 months ago

Completed

[Plugin] - with/automatic-docs

Adds automatic Nextra MDX docs generation from schemas npm run regenerate:docs Automatics MDX docs for Schemas (if put into a /schemas/ folder OR named .schema.ts) Resolvers (using DataBridges → linking Input & Output schemas to logic) Components (using Prop schemas → getDocumentationProps) Picks up additional developer notes or custom docs Look for {subject}.docs.mdx files If {subject} matches a schema / resolver / component with auto-docs Add the contents of .docs.mdx to the resulting Nextra MDX doc If {subject} is not one of the above, create its own Nextra MDX doc page Also sets the project up with `@app/docs` workspace Includes all the official docs from fullproduct.dev/docs /pages/ dir = Destination for all auto-generated docs ✅ Easy onboardings and handovers ✅ Docs will automatically grow as you build new features

Thorr Stevens 7 months ago