-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: draft readme for 1.0.0 release
- Loading branch information
Showing
1 changed file
with
59 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,93 @@ | ||
# 🚀 @xolvio/instant-mock | ||
|
||
Your ultimate GraphQL Federation-native mocking solution for accelerated development! 🎭✨ | ||
InstantMock is an **enterprise-ready Express.js server** and **React UI** for creating and distributing **GraphQL mock servers**—designed to simplify API mocking across development teams. | ||
|
||
## Quick Start | ||
With **first-class Apollo Federation integration**, you can instantly mock any **Supergraph, Subgraph, or Schema Proposal**. | ||
|
||
Clone the repo and run: | ||
> **Not using Apollo?** No worries! InstantMock supports any valid GraphQL schema. | ||
```bash | ||
npm start | ||
``` | ||
OR | ||
```bash | ||
docker compose up | ||
``` | ||
|
||
That's it! Head on over to `http://localhost:3033` to start mocking like a pro! 😎 | ||
|
||
🔮 **Coming Soon:** `npx @xolvio/instant-mock` | ||
|
||
## 🌟 Supercharge GraphQL Development | ||
|
||
Effortlessly spin up a fully-featured, schema-aware GraphQL mock server that: | ||
|
||
* Seamlessly integrates with Apollo Studio | ||
* Supports enterprise HTTP proxies | ||
* Provides flexible database options | ||
## ⏩ Quick Start | ||
|
||
With `instant-mock`, creating consistent, team-specific mock data for GraphQL APIs is easier than ever! 🎉 | ||
### Requirements | ||
|
||
## 🔥 Key Features | ||
- **Apollo Studio**: [Generate a `user:` API key here](https://studio.apollographql.com/user-settings/api-keys) if using Apollo Studio schemas. | ||
- **Local Files**: To use schema files, place `.graphql` files in `backend/src/graphql`. | ||
|
||
* **Apollo Studio Integration:** Directly syncs with Apollo Studio, including schema and variant management. | ||
* **Flexible Schema Management:** Import schemas from files or Apollo Studio for on-demand introspection. | ||
* **Enterprise HTTP Proxy Support:** Works seamlessly within enterprise network environments. | ||
* **Secure Data Management:** Leverages encryption keys for securely storing sensitive data. | ||
* **Database Agnostic:** Ships with SQLite by default, but also supports PostgreSQL and MySQL. | ||
* 🔮 **SSO Support Coming Soon** | ||
### Running Locally | ||
|
||
**Clone the repo** and run: | ||
|
||
## 🎭 How It Works | ||
|
||
### Main Interface | ||
|
||
The @xolvio/instant-mock experience is divided into three main tabs: | ||
|
||
1. **Query:** Select and explore schemas, inspect schema variants, and instantly mock responses. | ||
2. **Data:** Create and manage seed data, including Seed Groups for isolated team-specific mocks. | ||
3. **Collaborate:** Use Narrative's Annotator, enabling schema-to-UI annotations and collaborative mockup validation. | ||
```shell | ||
npm start | ||
``` | ||
|
||
### Feature Breakdown | ||
Using Docker Compose: | ||
|
||
#### Query Tab | ||
```shell | ||
docker compose up | ||
``` | ||
|
||
Instantly introspect and explore any graph from your schema. Choose a schema and variant, and let instant-mock provide you with auto-generated responses for every field using Faker.js, with sensible defaults. | ||
Or if you don't want to clone the repo, pull from Docker Hub: | ||
|
||
🔮 **Coming Soon:** Customize Faker.js configurations for more control over default mock data. | ||
```shell | ||
docker pull xolvio/instant-mock:1.0.0-beta.2 | ||
docker run -p 3033:3033 xolvio/instant-mock:1.0.0-beta.2 | ||
``` | ||
|
||
#### Data Tab | ||
InstantMock will be available on http://localhost:3033. | ||
|
||
Here's where @xolvio/instant-mock shines ✨. After executing an operation in the Query tab, you can create seed data by clicking "Create Seed From Response". This takes you to the Data tab, where you can modify and persist your responses. | ||
To connect with Apollo, go to the settings page and enter your key: http://localhost:3033/settings. | ||
|
||
* **Seed Manager:** Manage and modify seed data for consistent responses. | ||
* **Seed Groups:** Separate mock responses by group, allowing multiple teams to work with isolated, idempotent mock data for the same operations. | ||
> 🔮 Coming Soon: npx @xolvio/instant-mock for an even faster start. | ||
#### 🤝 Collaborate Tab | ||
## 💡 Why InstantMock? | ||
|
||
Enhance cross-functional collaboration with real data-backed annotations and schema management: | ||
### Problem | ||
GraphQL Federation teams often struggle with: | ||
- Managing complex supergraph schemas across teams | ||
- Maintaining consistent mock data | ||
- Time spent creating and updating mock servers | ||
- Integration testing with proposed schema changes | ||
|
||
* **Narrative Integration:** Sign up for Narrative to use the Annotator, powered by instant-mock, for UI mockup annotations directly from your schema. | ||
* **Schema Proposal Automation:** Detect mismatches between your mock operations and schema, and automatically generate a schema proposal for Apollo Studio—instantly backed by a mock server. | ||
### Solution | ||
InstantMock provides: | ||
- Centralized mock data management | ||
- Native Federation support (supergraphs/subgraphs) | ||
- GUI for creating and managing mocks | ||
- Instant deployment of mock responses | ||
|
||
## 🏆 Why `instant-mock`? | ||
### Enterprise Features | ||
- **Security**: Encryption key management, secure data storage | ||
- **Infrastructure**: HTTP proxy support, K8s-ready deployment | ||
- **Flexibility**: SQLite, PostgreSQL, or MySQL support | ||
- **Data Control**: Idempotent seed management with group organization | ||
|
||
Say goodbye to: | ||
### Key Benefits | ||
- **Faster Development**: Create and share mocks in minutes | ||
- **Better Testing**: Consistent mock data across teams | ||
- **Federation Ready**: Test schema changes before deployment | ||
- **No Setup**: Replace local mock servers and manual JSON files | ||
|
||
👋 Unreliable Postman collections | ||
👋 Ad-hoc mock servers | ||
👋 Mismatched schemas | ||
> 🔮 **Coming Soon**: SSO support, file uploads, and enhanced Helm charts with PostgreSQL | ||
By centralizing mock data with Apollo Federation awareness, @xolvio/instant-mock delivers consistent, reliable mock data that scales with your team's needs. Whether you're a frontend engineer, backend developer, or QA, instant-mock is designed to make your life easier and boost your productivity! 🚀💪 | ||
## 🚢 Deployment Options | ||
|
||
## 📚 Documentation | ||
### Docker | ||
|
||
For detailed documentation, check out our [Wiki](comingsoon). | ||
InstantMock is containerized for easy deployment in Docker-supported environments. | ||
|
||
## 🤝 Contributing | ||
```shell | ||
docker pull xolvio/instant-mock:<version> | ||
``` | ||
|
||
We welcome contributions! Please see our [Contributing Guide](comingsoon) for more details. | ||
### Kubernetes (K8s) | ||
|
||
## 📄 License | ||
A basic Helm chart is provided to deploy InstantMock with Kubernetes. Currently, it ships with SQLite and is limited to a single replica. | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](comingsoon) file for details. | ||
> 🔮 Coming Soon: Full Helm chart with scaling support and PostgreSQL. | ||
## 🙏 Acknowledgments | ||
|
||
* The amazing [gq-mock](https://github.com/wayfair-incubator/gqmock) team | ||
* Our fantastic community of users and contributors | ||
InstantMock builds on the work from gqmock, with many of the base MockServer utilities adapted and extended for seamless integration. | ||
|
||
Made with ❤️ by the @xolvio team | ||
> Made with ❤️ by the @xolvio team |