Grepedia
PY

Pyric

A local-first Firebase development framework that provides sandboxed services, modular security rules, and rich debug data for agents and developers.

Score1
About

Pyric is a local-first Firebase development framework designed to provide an efficient and isolated development environment for coding agents and developers. It allows users to build and test Firebase applications entirely on their local machine, eliminating the risks and complexities of developing directly against production cloud projects. By leveraging the browser as a sandbox, Pyric provides a mirror of Firebase's behavior, including Authentication, Cloud Firestore, Realtime Database, Cloud Storage, Cloud Messaging, and AI Logic services. The framework was created by David East, leveraging his 12 years of experience with Firebase to address common pain points such as difficult debugging, complex index generation, and opaque security rules. Pyric works by resolving standard 'firebase/*' imports to a local sandbox during development, while allowing them to resolve to the standard Firebase SDK during production, ensuring no code changes are required for deployment. This resolution layer makes it possible for coding agents to seed data, run queries, and inspect Security Rules verdicts locally, providing rich debug information that is otherwise inaccessible when working with cloud-only services.

Some of the key features are:

  • Local Sandbox Environment: Replicates Firebase service APIs within the browser using a SharedWorker and IndexedDB, ensuring state is shared across tabs and persists during reloads.
  • Security Rules Module System: Adds a modern module system to Firebase Security Rules, enabling code reuse through imports and structured organization.
  • Standard Library for Rules: Includes pre-verified modules for common and complex security scenarios like rate limiting, document validation, and game logic.
  • Automated Index Generation: Analyzes application code to automatically generate the necessary Firestore composite indexes before they are needed.
  • Agent Compatibility: Provides an MCP server and bridge for coding agents to inspect the local backend, run queries, and receive rich debug data for denied operations.
  • Deterministic AI Logic: Offers a local proxy for Firebase AI Logic, enabling the use of local models like Ollama for development.
  • Production-Ready Artifacts: Generates standard production files (e.g., rules, indexes) from modular TypeScript or Rules code, ensuring consistency with the Firebase engine.
  • Comprehensive Traffic Visibility: Features Pyric Studio to visualize all requests, Security Rules verdicts, and backend state changes in real-time.

Operationally, Pyric integrates into existing projects via Vite or Next.js plugins, managing the resolution of Firebase imports automatically. When running in a development mode, it initializes a local backend mirror. The developer can then utilize CLI tools to generate indexes, lint security rules, or inspect the sandbox state. For server-side logic, Pyric supports running Cloud Functions locally by connecting them to the browser sandbox via a WebSocket bridge, allowing the Admin SDK to operate against local data. The development loop remains unchanged, with Pyric handling the complex mapping and verification under the hood. When ready to ship, the developer simply builds the project using standard production settings, and the application connects to the real Firebase cloud infrastructure without modification.

Some common use cases include:

  • Developing Firebase Apps Without Cloud Risk: Building and iterating on features locally without incurring billing costs or risking accidental writes to live production databases.
  • Debugging Complex Security Rules: Using Pyric's simulation and linting tools to understand exactly why a security rule denies a request, instead of receiving generic permission errors.
  • Agent-Assisted Development: Allowing AI coding agents to fully understand and interact with the Firebase backend state, rules, and data structures locally.
  • Team Development and Onboarding: Providing an isolated, local backend for team members or automated testing suites that require consistent, resetable data states.
  • Advanced Rules Prototyping: Implementing complex logic, such as game geometry for chess or time-based rate limiting, using the tested Pyric Standard Library.