convex-quickstart

Set up authenticated Convex backend with schema, auth integration, and CRUD for web apps.

Updated Jun 8, 2024
One-click install
npx skills add https://github.com/shadeiskndr/portfolio --skill convex-quickstart-shadeiskndr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-quickstart
Source: https://github.com/shadeiskndr/portfolio/tree/main/.agents/skills/convex-quickstart
Command: npx skills add https://github.com/shadeiskndr/portfolio --skill convex-quickstart-shadeiskndr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the challenge of setting up a Convex backend quickly and correctly, including schema setup, authentication wiring, and the first working CRUD endpoints.

Core Features & Use Cases

  • Initialize a Convex project: Create the convex/ directory, generate TypeScript types, and start a local dev server.
  • Define a schema with indexes: Model users and related entities (e.g., tasks) with practical index strategies for efficient queries.
  • Add authentication and auth helpers: Secure operations by retrieving the current user identity and enforcing authorization checks.
  • Implement CRUD with real frontend hooks: Connect Convex queries/mutations to a React/Next.js page for end-to-end task management.

Use cases include starting a new Convex project, adding Convex to an existing Next.js/React app, and prototyping real-time features with authenticated, per-user data.

Quick Start

Initialize Convex in your project, add a schema with user and task tables, configure WorkOS AuthKit authentication, then implement and use authenticated CRUD functions for tasks.

Frequently Asked Questions about convex-quickstart

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a Convex backend with authentication in Next.js?

Setting up an authenticated Convex backend involves creating the convex/ directory, defining schema.ts with user and task tables, wiring WorkOS AuthKit to ctx.auth, and implementing authorized query and mutation handlers for your Next.js app.

How do I define schema indexes for per-user data in Convex?

Defining schema indexes for per-user data in Convex requires modeling users and related entities in schema.ts with practical index strategies to ensure efficient, secure queries for individual user records.

Can I use WorkOS AuthKit for secure Convex mutations and queries?

Yes, you can use WorkOS AuthKit for secure Convex mutations and queries by wiring the auth provider to ctx.auth, implementing auth helpers like getCurrentUser, and enforcing authorization checks inside your query and mutation handlers.

What is the best way to connect Convex CRUD operations to React hooks?

The best way to connect Convex CRUD operations to React hooks is by implementing authenticated query and mutation handlers in your backend and linking them directly to your React or Next.js page for end-to-end real-time task management.

How do I enforce authorization in Convex backend endpoints?

To enforce authorization in Convex backend endpoints, implement a getCurrentUser helper that retrieves the current user identity from ctx.auth, then apply authorization checks within your query and mutation handlers before processing data.