Point0by 1gr14
  • Меню
    • GitHub
    • Блог
  • Introduction
    • Overview
    • Getting Started
    • Full Overview
    • Benchmarks
    • Points
  • Points
    • Page
    • Layout
    • Component
    • Provider
    • Mountable
    • Query
    • Infinite Query
    • Mutation
    • Action
    • Root
    • Base
    • Plugin
  • Methods
    • Validation
    • Loader
    • Context
    • Middleware
    • Loading & error
    • .with
    • Mapper
    • Transformer
    • Stage Methods
  • Core
    • Navigation
    • SSR
    • RSC
    • Request
    • Response
    • Error handling
    • Env
    • Head
    • MDX
    • Assets
    • File upload
    • OpenAPI
    • Query client
    • Events
    • Infer
  • Engine
    • Engine Config
    • Engine Runtime
    • CLI
    • Dev
    • Build
    • Compiler
    • Generator
    • Project MCP
    • Docs MCP
    • Importer
    • Public dir
    • Testing
    • Deploy
    • Bun or Vite
  • Extra
    • SsrStore
    • CookieStore
    • Basic Auth
    • CORS
    • Cache-Control
    • Compress
  • Examples
    • Basic
    • Vite
    • Better Auth
    • Capacitor
    • Expo
  • 1gr14
    • Главная
    • Start0
    • Поддержать
    • Обучение
    • Группа
    • Блог
    • Автор
  • Сообщество
    • Discord
    • Telegram
  • Опенсорс
    • Point0
    • Route0
    • Error0
    • Flat
  • Аккаунт
    • Войти
    • Регистрация
Point0by 1gr14
Создаю опенсорс во славу Господа Иисуса Христа ☦️
С любовью ко всем разработчикам на свете ❤️
Условия использованияПолитика конфиденциальностиСергей Дмитриев 2026 😎

Expo Example

  • Раздел: Examples

On this page

  1. Running it
  2. For a real app
GitHub DevGitHub Source

Experimental. This example is a work in progress. It shows how a React Native client uses Point0's queries, mutations, and components, but it isn't a polished path. For a real app, start from Start0.

examples/expo is a React Native client built with Expo that talks to a Point0 server. It is the opposite trade from capacitor: capacitor keeps the Point0 client (Point0 builds the web bundle the shell wraps), while expo drops it. Point0 keeps only the parts that don't touch the DOM — the root, queries, mutations, and components — and Expo Router owns routing while Metro bundles the client. The buttons above and below open the full source.

The distinctive shape: the data hooks are the same ones you'd call in any Point0 app, but they live inside a plain Expo screen and route through Expo Router, not a Point0 page:

// examples/expo/src/app/index.tsx
import { useRouter } from 'expo-router'
import { ideasQuery, createIdeaMutation } from '../ideas'

export default function IdeasScreen() {
  const router = useRouter()
  const { data, refetch } = ideasQuery.useQuery() // a Point0 query
  const mutation = createIdeaMutation.useMutation() // a Point0 mutation
  // <FlatList ... onPress={() => router.push(`/${item.id}`)} />  ← routing is Expo Router
}

Two things make the client-less setup work. The engine config is server only (no client block), and server.importer.mock rewrites client-only imports (react-native, expo-router) to an empty proxy at compile time so the same point files load on the server too. On the client side there is no Point0 build at all — a single Babel plugin runs the compiler with side: 'client', stripping the server-only method bodies (loader, input, ctx, …) before Metro bundles:

// examples/expo/babel.config.js
plugins: [['@point0/compiler/plugin/babel', { side: 'client', scope: 'root' }]]

The scope here must match the rest of the app: the server is scope: 'root' (src/engine.ts) and the root point is declared with Point0.lets('root', 'root') (src/lib/root.tsx). A client compiled under a different scope would resolve env.scope.* checks against the wrong scope name.

The root carries serverUrl (the client has no co-located server), @point0/cors middleware (it's cross-origin), and a transformer, and its .loading / .error render React Native components. One more quirk: expo commits its points.server.ts and has no generate script — Metro and Babel have no point0 generate integration, so a committed registry gives the server a stable source to load. See compiler, importer, and root.

Running it

Two processes, in two terminals: bun run dev:server (the Point0 server, point0 dev --hot) and bun run dev (the Expo client, expo start; or bun run ios / android / web). Set up SQLite with bun run prisma:generate and bun run prisma:push. The server boots through the usual Point0 wiring. See getting-started and engine-runtime.

For a real app

This example shows Point0 as a React Native data layer in isolation. For a real app, start from Start0 — the SaaS boilerplate with the pieces already wired (bun create start0@latest my-app).

GitHub DevGitHub Source
НазадCapacitor Example

Enjoying Point0?

Give it a star on GitHub, ask questions, and follow what's new

Star Point0

A star on GitHub helps more developers find Point0
Star on GitHub

Start0

Point0 integrated into the Start0 SaaS boilerplate — the best way to use it
Explore Start0

YouTube

Tutorials, walkthroughs, and updates
YouTube

Discord

Questions and chat in English
Join Discord

Telegram

News channel and chat in Russian
ChannelChat

Twitter

Posts and updates
Twitter