Minimal
SQLite, one table, no Docker. Boots in 10 seconds.
git clone https://github.com/fraiseql/fraiseql-starter-minimalcd fraiseql-starter-minimal && fraiseql runLearn FraiseQL by exploring complete, production-ready example applications.
Before running any example:
curl -fsSL https://fraiseql.dev/install.sh | sh# or: brew install fraiseql / cargo install fraiseqldocker run -p 5432:5432 postgres:16)When the development server starts successfully you will see:
$ fraiseql runINFO FraiseQL 2.x starting…INFO Schema compiled — 12 types, 8 queries, 4 mutationsINFO Connected to PostgreSQL at localhost:5432/mydbINFO GraphQL endpoint: http://localhost:8000/graphqlINFO GraphiQL playground: http://localhost:8000/graphiqlNot sure where to begin? Clone a working starter and extend it:
Minimal
SQLite, one table, no Docker. Boots in 10 seconds.
git clone https://github.com/fraiseql/fraiseql-starter-minimalcd fraiseql-starter-minimal && fraiseql runBlog API
PostgreSQL — users, posts, comments, tags, mutations. The schema used throughout the docs.
git clone https://github.com/fraiseql/fraiseql-starter-blogcd fraiseql-starter-blog && docker compose upSaaS Multi-Tenant
PostgreSQL + RLS + JWT. Two isolated tenants out of the box.
git clone https://github.com/fraiseql/fraiseql-starter-saascd fraiseql-starter-saas && docker compose up| Example | Description | Database | Complexity | Tags |
|---|---|---|---|---|
| SaaS Blog | Multi-tenant blog with posts, comments, and role-based access. Requires PostgreSQL (uses Row-Level Security) | PostgreSQL | Intermediate | auth, RLS, CQRS |
| Federation E-Commerce | Product catalog, orders, and inventory across federated databases | PostgreSQL (federated) | Intermediate | federation, saga |
| Real-Time Collaboration | Collaborative document editing with live cursors and conflict resolution | PostgreSQL | Advanced | WebSocket, CRDT |
| Real-Time Analytics | Event ingestion, metrics, and live dashboards | PostgreSQL + TimescaleDB | Intermediate | time-series, streaming |
| Mobile Analytics Backend | Push notifications, offline sync, and background jobs. Requires PostgreSQL (uses materialized views) | PostgreSQL | Intermediate | mobile, jobs |
| SaaS Federation + NATS | Multi-tenant SaaS with cross-service federation over NATS | PostgreSQL + NATS | Advanced | federation, NATS |
| NATS Event Pipeline | Event-driven pipeline with NATS subjects and durable consumers | PostgreSQL + NATS | Advanced | events, NATS |
| Microservices Choreography | Service-to-service choreography with saga and compensating transactions | PostgreSQL | Advanced | microservices, saga |
What you’ll learn:
Features:
Technology Stack:
Repository: github.com/fraiseql/examples/saas-blog-platform
Duration: 45 minutes to understand, 2-3 hours to deploy
What you’ll learn:
Features:
Technology Stack:
Repository: github.com/fraiseql/examples/federation-ecommerce
Duration: 1 hour to understand, 4-5 hours to deploy
What you’ll learn:
Features:
Technology Stack:
Repository: github.com/fraiseql/examples/realtime-collaboration
Duration: 1.5 hours to understand, 6+ hours to deploy
What you’ll learn:
Features:
Technology Stack:
Repository: github.com/fraiseql/examples/realtime-analytics
Duration: 1 hour to understand, 4 hours to deploy
What you’ll learn:
Features:
Technology Stack:
Repository: github.com/fraiseql/examples/mobile-analytics-backend
Duration: 45 minutes to understand, 3-4 hours to deploy
What you’ll learn:
Features:
Technology Stack:
Repository: github.com/fraiseql/examples/saas-federation-nats
Duration: 1 hour to understand, 4 hours to deploy
What you’ll learn:
Features:
Technology Stack:
Repository: github.com/fraiseql/examples/nats-event-pipeline
Duration: 45 minutes to understand, 2-3 hours to deploy
What you’ll learn:
Features:
Technology Stack:
Repository: github.com/fraiseql/examples/microservices-choreography
Duration: 1 hour to understand, 4-5 hours to deploy
Clone the example
git clone https://github.com/fraiseql/examples.gitcd examples/saas-blog-platformInstall dependencies
uv syncnpm installSet up environment
cp .env.example .env# Edit .env with your credentialsStart database
docker-compose up -d postgresRun migrations
confiture migrateStart development server
fraiseql runVerify the API is healthy
curl http://localhost:8080/healthExpected response:
{"status": "healthy", "database": "connected", "version": "0.9.0"}In another terminal, start frontend
cd frontend && npm run dev# Open http://localhost:3000# Build imagedocker build -t fraiseql-example .
# Run with Docker Composedocker-compose up
# Open http://localhost:3000Each example includes deployment instructions:
See each example’s README.md for specific instructions.
Intermediate (Start here):
Advanced: 5. NATS Event Pipeline (event-driven, durable consumers) 6. SaaS Federation + NATS (cross-service federation) 7. Real-Time Collaboration (WebSocket, CRDT, OT) 8. Microservices Choreography (saga, compensation, distributed transactions)
All examples use JWT with role-based access control:
@fraiseql.query(requires_scope="read:posts")def get_posts(user_id: ID) -> list[Post]: """Get posts visible to user.""" passExamples show how to implement soft deletes:
@fraiseql.typeclass Post: id: ID title: str deleted_at: datetime | None # NULL = not deleted
@fraiseql.query(sql_source="v_post")def get_posts() -> list[Post]: """Get non-deleted posts.""" passStandard cursor-based pagination:
@fraiseql.query(sql_source="v_post")def get_posts( first: int = 10, after: str | None = None) -> Connection[Post]: """Paginate through posts.""" passConsistent error handling across all examples:
@fraiseql.mutationdef create_post(title: str) -> Post: """Create post with validation.""" if not title: raise ValueError("Title is required") # ...All examples include test suites:
pytest tests/# ornpm testHave a great FraiseQL example?
README.md with:
your-example/├── README.md # Description, setup, deployment├── .env.example # Example environment file├── pyproject.toml # Python dependencies (uv)├── package.json # Node dependencies├── tests/ # Test suite├── app/ # FraiseQL backend│ ├── main.py # Entry point│ ├── schema.py # FraiseQL schema│ ├── database/ # Database setup│ └── ...├── frontend/ # Frontend application│ ├── pages/│ ├── components/│ └── ...└── docker-compose.yml # Local developmentQ: Can I use these as production templates?
A: Yes! Examples are designed to be production-ready. They include:
Q: Do I need to understand all examples?
A: No. Pick the one closest to your use case and dig deep. Other patterns are similar and you’ll pick them up quickly.
Q: Can I combine patterns from multiple examples?
A: Absolutely! That’s the learning goal. Understand individual patterns, then combine them for your app.
Q: Are examples updated with new FraiseQL versions?
A: Yes. We maintain all examples with the latest FraiseQL release.
Q: Where do I ask questions about an example?
A:
SaaS Blog Platform
Start with multi-tenancy and RLS — the most common SaaS pattern.
E-Commerce API
Learn federation and saga patterns for distributed transactions.
Real-Time Collaboration
Explore WebSocket subscriptions and conflict resolution with OT.
Analytics Platform
Build time-series pipelines and live dashboards with NATS.