components-guide

Guide Convex backend feature extraction into reusable components with isolated schemas.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of tangled, monolithic Convex backend code by guiding you to encapsulate features into self-contained components with clear boundaries and isolated data models.

Core Features & Use Cases

  • Encapsulated mini-backends: Organizes each feature with its own schema, functions (queries/mutations/actions), and isolated tables.
  • Maintainable separation of concerns: Replaces scattered logic (auth, storage, payments, notifications, analytics) with focused component APIs.
  • Reuse and swap implementations: Enables sharing the same backend capability across multiple features, and replacing providers without rewriting the whole app.

Use Case: When building a SaaS backend, you can keep payments, analytics tracking, and email notifications in separate components, then orchestrate them from parent functions to create cleaner, safer workflows like subscription creation and user onboarding.

Quick Start

Ask the AI to explain how to create a Convex component for notifications, including its schema and mutation APIs, and how to wire it into convex.config.ts for use from your main app.

Frequently Asked Questions about components-guide

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

FAQPage Schema
How do I structure reusable Convex backend features instead of monolithic functions?

To structure reusable Convex backend features, you define a component boundary with its own schema and query/mutation/action functions, wire it in convex.config.ts, and use component APIs from the parent app.

How does separating concerns in a Convex backend work?

Separating concerns in a Convex backend works by encapsulating features like storage, billing, and notifications into self-contained components with isolated data models and focused APIs, keeping parent-table access out of component code.

What's the best way to refactor a SaaS backend for payments and analytics in Convex?

The best way to refactor a SaaS backend in Convex is extracting payments, analytics tracking, and email notifications into separate components, then orchestrating them from parent functions to create cleaner subscription and onboarding workflows.

Can I swap implementations for notifications or billing without rewriting my Convex app?

Yes, you can swap implementations for notifications or billing without rewriting your Convex app by encapsulating those backend capabilities into reusable components, allowing you to replace providers through their component APIs.

Do I need convex.config.ts to wire a component into my main app?

Yes, you need convex.config.ts to wire a component into your main app, as it connects the encapsulated mini-backend with its own schema and mutation APIs to the parent app for orchestration.

Why should I keep parent-table access out of Convex component code?

You should keep parent-table access out of Convex component code to maintain maintainable separation of concerns, ensuring features like auth and payments remain isolated mini-backends with clear boundaries and reusable component APIs.