Mock Api

Ecosistema completo para organización y gestión de contenido con interfaces espaciales

@gograb-space/mock-api Documentation

Complete documentation for the mock-api library, optimized for AI code generators and developers.

📖 Documentation Structure

📋 README

Main documentation with quick start guide, core concepts, and basic usage patterns. Perfect for getting started and understanding the library fundamentals.

Key Sections:

🔍 API Reference

Comprehensive reference for all types, interfaces, services, and utilities in the library.

Contents:

🎯 Generation Patterns

Specific patterns and templates optimized for AI code generators creating mock APIs.

Templates:

🚀 Quick Navigation

For AI Code Generators

  1. Start with README - Quick Start
  2. Use Generation Patterns for templates
  3. Reference API Reference for types and interfaces

For Developers

  1. Begin with README for overview and setup
  2. Explore Advanced Features for complex scenarios
  3. Check API Reference for detailed documentation

For Integration

  1. Review Common Patterns
  2. Use Integration Examples
  3. Follow Code Generation Templates

📝 Key Features Summary

✅ Core Capabilities

✅ AI-Optimized Features

🎯 Common Use Cases

Development

// Quick mock setup for frontend development
const config = { enabled: true, fallbackToNetwork: false };
const mocks = { ...UsersMock, ...ProductsMock };
mockUtils.configureMockInterceptor(config, mocks);

Testing

// Minimal, predictable mocks for testing
const testMocks = {
  'GET /api/users/1': () => ({ status: 200, data: { id: 1, name: 'Test User' } })
};

Prototyping

// Rich data for demos and prototypes
const demoMocks = createCrudMocks('Product', '/api/products',
  () => generator.generateProduct(), initialProducts);

🔗 Related Libraries

This mock-api library integrates with other @gograb-space libraries:

🛠️ Development Commands

# Build the library
npx nx build mock-api

# Run tests
npx nx test mock-api

# Run lint
npx nx lint mock-api

# Serve example app
npx nx serve gograb-space

📄 License

Part of the GoGrab Space monorepo - see main repository for license information.

🤝 Contributing

This documentation is optimized for AI code generators. When contributing:

  1. Maintain template consistency in generation-patterns.md
  2. Keep API reference up-to-date with code changes
  3. Ensure examples are copy-paste ready
  4. Follow established naming conventions
  5. Include both TypeScript types and usage examples

📞 Support

For issues, questions, or contributions related to the mock-api library:

  1. Check existing documentation first
  2. Review the API reference for type definitions
  3. Look at generation patterns for common use cases
  4. Refer to the main GoGrab Space repository for general issues