Reference
Contributing
Project structure and how to extend InkHive.
Contributing
Project structure
├── app/ # Next.js App Router pages and layouts
├── components/ # Shared UI components
├── convex/ # Schema, queries, and mutations
│ ├── schema.ts # Table definitions and indexes
│ └── contentProjects.ts # Project-specific functions
├── inngest/ # Orchestration layer
│ ├── client.ts # Inngest client setup
│ ├── functions/ # Pipeline and publish functions
│ └── steps/ # Individual AI generation steps
│ └── ai-generation/
├── lib/ # Utilities and integrations
│ └── publish/ # Platform-specific publishing logic
└── public/ # Static assetsAdding a new AI step
- Create a file in
inngest/steps/ai-generation/<your-step>.ts. - Define the prompt and parsing logic.
- Wire it into
contentPipelineor create a new Inngest function. - Add a Convex mutation in
convex/contentProjects.tsto persist the output. - Update the schema if the new step adds fields to
contentProjects. - Add tests using
convex-test+vitest.
Adding a new publish platform
- Create a publisher in
lib/publish/<platform>.ts. - Implement the publish function that accepts project data and returns a status.
- Wire it into the
publishContentInngest function. - Add the platform's status field to the schema if needed.
Code conventions
- Convex mutations must derive user identity via
ctx.auth.getUserIdentity()— never accept userId from the client. - Use Convex indexes for all queries — avoid
filter(). - Keep prompts in
inngest/steps/ai-generation/and version them with comments when behavior changes. - Log token usage per AI step for cost monitoring.
Testing
- Convex functions: Use
convex-test+vitestfor unit tests on mutations and queries. - Inngest functions: Mock Convex responses or spin up a test Convex instance.
- Run tests with
npm test.
Observability
- Inngest step logs provide step-level visibility. Aggregate with a logging backend (Datadog, Logflare).
- Job-level errors are stored in
contentProjects.errorfor historical analysis. - The Inngest dashboard shows real-time execution status for all running workflows.