-
Infrastructure
- Postgres (third-party or self-hosted)
- Temporal (cloud or self-hosted)
- Minio (or other S3-compatible storage provider)
- PowerSync (cloud or self-hosted)
- logto (cloud or self-hosted)
- axiom (optional)
-
Backend services
- @1space/backend (on your own server)
- @1space/backend-worker (on your own server)
- @1space/backend-cf (on cloudflare-workers)
-
Frontend service
- @1space/web (simple SPA, can be hosted on any static file server)
Preparation
Postgres
You need to have a Postgres database running. The postgres database will be used by@1space/backend, @1space/backend-worker and PowerSync.
After setup, prepare a connection string (DATABASE_URL) for the Postgres database. You will need it later.
Temporal
You need to have a Temporal cluster running. The Temporal cluster will be used by@1space/backend and @1space/backend-worker.
After setup, prepare the TEMPORAL_ADDRESS and TEMPORAL_NAMESPACE for the Temporal cluster. You will need it later.
Minio (or other S3-compatible storage provider)
You need to have a S3-compatible storage provider. You can use some cloud storage providers like AWS S3, or self-hosted storage providers like Minio. Prepare theS3_ENDPOINT, S3_ACCESS_KEY and S3_SECRET_KEY for the S3-compatible storage provider. You will need it later.
PowerSync
You need to have a PowerSync instance running. You can either use the cloud version of the PowerSync, or self-host your own PowerSync instance. If you are using the cloud version of the PowerSync, make sure your Postgres database is accessible from the internet, and should be setup with TLS to be accepted by the PowerSync. After setup, prepare thePOWERSYNC_ENDPOINT for the PowerSync. You will need it later.
logto
You need to have a logto instance running. You can either use the cloud version of the logto, or self-host your own logto instance. After setup, prepare theLOGTO_ENDPOINT for the logto. You will need it later.
LOGTO_APP_ID.
(TODO: Add more details about how to setup logto)
axiom (optional)
If you want to use the axiom for the data analysis, you need to have an axiom account. Prepare theAXIOM_TOKEN and AXIOM_DATASET variables for the axiom. You will need it later.
Cloudflare account
Some of our backend logic is running on Cloudflare Workers. Though we have a plan to support self-hosting without Cloudflare Workers, currently you need to have a Cloudflare account first. And you may need to on Workers Paid plan.Deployment
@1space/backend and @1space/backend-worker
@1space/backend and @1space/backend-worker are the main backend services of 1Space. @1space/backend provide the API for the frontend service and the @1space/backend-worker provide the background job processing.
Both of these services can be deployed multiple instances for high availability. But I believe you only need one instance for the beginning.
These service need the following environment variables:
REQUESTER_ENDPOINT is the endpoint of the @1space/backend-cf service, which will be deployed in the next step.)
Run the following command to start the @1space/backend and @1space/backend-worker:
@1space/backend-requester
@1space/backend-requester is a required service for @1space/backend.
Deploy it in the nearly same way as @1space/backend (TODO: more docs)
@1space/web
@1space/web is the frontend service of 1Space. It is a simple SPA, and can be hosted on any static file server.
Run pnpm build:web to build the frontend service, and then host the ./apps/web/dist directory on your static file server.
@1space/magic-static
@1space/magic-static is an additional frontend service of 1Space. It can be deployed in your normal infrastructure, or using Cloudflare Workers.
(TODO: more docs)