Minimal
PostgreSQL, one table, no Docker. The fastest way to see FraiseQL running — clone fraiseql-starter-minimal and run fraiseql run.
Learn 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 v2.1 starting…INFO Schema compiled — 12 types, 8 queries, 4 mutationsINFO Connected to PostgreSQL at localhost:5432/mydbINFO GraphQL endpoint: http://localhost:8080/graphqlINFO GraphiQL playground: http://localhost:8080/graphiqlNot sure where to begin? Clone a working starter and extend it:
Minimal
PostgreSQL, one table, no Docker. The fastest way to see FraiseQL running — clone fraiseql-starter-minimal and run fraiseql run.
Blog API
PostgreSQL — users, posts, comments, tags, mutations. The schema used throughout the docs. Clone fraiseql-starter-blog and run docker compose up.
SaaS Multi-Tenant
PostgreSQL + RLS + JWT. Two isolated tenants out of the box. Clone fraiseql-starter-saas and run docker compose up.
| Example | Description | Database | Complexity | Tags |
|---|---|---|---|---|
| Multi-Tenant SaaS | Organizations, projects, RLS, observers, REST + GraphQL. The reference example for production patterns | PostgreSQL + NATS | Intermediate | auth, RLS, observers, REST |
| 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
fraiseql migrateStart development server
fraiseql runVerify the API is healthy
curl http://localhost:8080/healthExpected response:
{"status": "healthy", "database": "connected", "version": "2.1.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 FraiseQL starters and examples serve REST and gRPC alongside GraphQL on port 8080 — no extra configuration is needed. Each example’s README.md notes which transport the example exercises. To test REST or gRPC endpoints in any example:
# REST — same resource names as GraphQL queries (default path: /rest/v1; configure via [rest] path)curl http://localhost:8080/rest/v1/users
# gRPC — separate port (default 50052), requires grpcurlgrpcurl -plaintext localhost:50052 listgrpcurl -plaintext -d '{"limit": 10}' localhost:50052 fraiseql.BlogService/ListPostsSchema annotations like @fraiseql.query (with fraiseql.config(sql_source="v_post") in the function body) automatically generate both the GraphQL resolver and the REST/gRPC endpoints. No separate REST or gRPC schema definition is needed.
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.querydef get_posts() -> list[Post]: """Get non-deleted posts.""" return fraiseql.config(sql_source="v_post")Standard cursor-based pagination using relay:
@fraiseql.querydef get_posts( first: int = 10, after: str | None = None) -> list[Post]: """Paginate through posts (relay connection returned automatically).""" return fraiseql.config(sql_source="v_post", relay=True)Validation and error handling live in the SQL function, not in the Python decorator body. The Python layer is compile-time only:
@fraiseql.mutation(sql_source="fn_create_post", operation="CREATE")def create_post(title: str) -> Post: """Create post. fn_create_post validates title and returns an error status on failure.""" passAll 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.