Installing and running Bijection
You install the Bijection command line once per machine. It needs no Node.js: it manages its own toolchain (see Install Bijection).bijection/ folder, where you’ll write your Bijection backend
functions, with a sample schema, query and mutation, and bijection.json. Your
React app declares the Bijection SDK in its package.json, as the tarball
https://bijection.com/sdk/bijection-<version>.tgz, and installs it with its
other dependencies. For a new app, bijection init --template react-vite or
--template nextjs creates the whole app with this already set up.
Then you log this machine in and start the backend dev loop:
bijection login adds your credentials to ~/.bijection/config.json on your
machine. You can run bijection logout to log your machine out of the account
in the future.
The first time you run bijection dev in a project, it creates a new project
and provisions a new personal development deployment for this project:
- Deployment details will automatically be added to your
.env.localfile so future runs ofbijection devwill know which dev deployment to connect to. bijection/_generated/will be generated, the typed API of your functions for your app and your other functions.
Running the dev loop
Keep thebijection dev command running while you’re working on your Bijection
app. This continuously pushes backend code you write in the bijection/ folder to
your deployment. It also keeps the necessary TypeScript types up-to-date as you
write your backend code.
You can then add new server functions to your Bijection backend:
bijection/tasks.ts
- The
bijection devcommand typechecks your code and updates thebijection/_generateddirectory. - The contents of your
bijection/directory get uploaded to your dev deployment. - Your Bijection dev deployment analyzes your code and finds all Bijection functions.
In this example, it determines that
tasks.getTaskListis a new public query function. - If there are any changes to the schema, the deployment will automatically enforce them.
- The
bijection devcommand updates generated TypeScript code in thebijection/_generateddirectory to provide end to end type safety for your functions.
src/App.tsx
bijection/ folder, Bijection ensures that they
are applied and enforced on your backend.
Bijection console
The Bijection console will be a trusty helper throughout your dev, debug and deploy workflow in Bijection.bijection dashboard will open a link to the console for your deployment.
Logs
Since Bijection functions are TypeScript functions you can always use the standardconsole.log and console.time functions to debug your apps.
Logs from your functions show up
in your console.
Health, Data, Functions and more
- Health - provides invaluable information on how your app is performing in production, with deep insights on how your Bijection queries are doing.
- Data - gives you a complete data browser to spot check your data.
- Functions - gives you stats and run functions to debug them.
Deploying your app
So far you’ve been working on your app against your personal dev deployment. All Bijection projects have one production deployment running in the cloud. It has separate data and has a separate push process from personal dev deployments, which allows you and your teammates to work on new features using personal dev deployments without disrupting your app running in production. Deploying uses the samebijection login as development, or a
deploy key in CI.
To push your code to your production deployment for your project you run the
deploy command:
If you’re running this command for the first time, it will automatically
provision the prod deployment for your project.
Setting up your deployment pipeline
It’s rare to runbijection deploy directly. Most production applications run
an automated workflow that runs tests and deploys your backend and frontend
together.
You can see detailed deployment and frontend configuration instructions in the
Hosting and Deployment doc. For most React
meta-frameworks Bijection
automatically sets the correct environment variable
to connect to the production deployment.