algolia-local-dev-loop

Featured

Configure Algolia local development with separate dev index, mocking, and testing. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Algolia. Trigger: "algolia dev setup", "algolia local development", "algolia dev environment", "test algolia locally".

AI & Automation 2,944 stars 440 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Algolia Local Dev Loop ## Overview Set up a fast, reproducible local development workflow for Algolia. Use separate dev indices, mock the client in tests, and iterate without touching production data. ## Prerequisites - Completed `algolia-install-auth` setup - Node.js 18+ with npm/pnpm - Vitest or Jest for testing ## Instructions ### Step 1: Environment-Based Index Names ```typescript // src/algolia/config.ts import { algoliasearch } from 'algoliasearch'; const ENV = process.env.NODE_ENV || 'development'; // Each environment gets its own index prefix export function indexName(base: string): string { if (ENV === 'production') return base; return `${ENV}_${base}`; // e.g., "development_products" } export const client = algoliasearch( process.env.ALGOLIA_APP_ID!, process.env.ALGOLIA_ADMIN_KEY! ); ``` ### Step 2: Seed Script for Dev Data ```typescript // scripts/seed-algolia.ts import { client, indexName } from '../src/algolia/config'; const SEED_DATA = [ { objectID: 'prod-1', name: 'Widget A', category: 'tools', price: 29.99 }, { objectID: 'prod-2', name: 'Widget B', category: 'tools', price: 49.99 }, { objectID: 'prod-3', name: 'Gadget C', category: 'electronics', price: 199.99 }, ]; async function seed() { const idx = indexName('products'); // replaceAllObjects atomically swaps index content const { taskID } = await client.replaceAllObjects({ indexName: idx, objects: SEED_DATA, }); await client.waitForTask({ indexName: idx, task...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category