SafeTrust is a decentralized P2P escrow platform for rental transactions. Funds are held in tamper-proof smart contracts on the Stellar network via the TrustlessWork API — no intermediaries, full on-chain transparency.
🧩 This repo runs standalone. You do not need to clone or run
backend-SafeTrustlocally. The frontend connects directly to a remote Hasura GraphQL endpoint and Firebase over the network.
| Tool | Version |
|---|---|
| Node.js | ≥ 18 |
| A Stellar wallet | Freighter recommended |
git clone https://github.com/<your_user>/frontend-SafeTrust
cd frontend-SafeTrust
git remote add upstream https://github.com/safetrustcr/frontend-SafeTrust
npm installcp .env.example .env.localFill in .env.local following the sections below. Never commit this file.
npm run devRuns on port 3000 by default. Use npm run dev -- --port 3001 only if landing-SafeTrust is already running on 3000.
From Firebase Console → Project Settings → Your apps → Web app → Config:
NEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=Enable Email/Password under Authentication → Sign-in method.
These are public, browser-safe values. The
NEXT_PUBLIC_prefix is what makes Next.js expose them to the bundle. Never putHASURA_ADMIN_SECREThere — the frontend authenticates via Firebase JWT, not the admin secret.
Setup: console.firebase.google.com
NEXT_PUBLIC_HASURA_GRAPHQL_URL=https://your-hasura-instance.example.com/v1/graphqlPoint this at the shared SafeTrust Hasura instance — or http://localhost:8080/v1/graphql if you are running backend-SafeTrust locally. No admin secret goes here, ever.
Required for escrow deploy, fund, and release flows.
NEXT_PUBLIC_API_URL=https://api.trustlesswork.com
NEXT_PUBLIC_API_KEY=
NEXT_PUBLIC_TRUSTLESS_API_URL=https://api.trustlesswork.com
NEXT_PUBLIC_TRUSTLESS_API_URL_DEV=https://dev.api.trustlesswork.com
NEXT_PUBLIC_TRUSTLESS_NETWORK=testnetGet your API key:
- Go to dapp.trustlesswork.com → connect Freighter.
- Settings → Profile → fill in use-case field (required).
- Settings → API Keys → Request API Key → select Testnet.
- Copy immediately — shown only once.
Always use testnet for local development. Full guide: docs.trustlesswork.com → Request API Key
| Setup | When to use |
|---|---|
This repo standalone — npm run dev, remote Hasura + Firebase |
UI work, components, dashboard features — most contributor tasks |
dApp-SafeTrust monorepo — frontend + backend together |
Full-stack work touching schema, mutations, or webhook behavior |
backend-SafeTrust standalone — Hasura + Postgres + webhook via Docker |
Backend-only contributors who don't need the UI |
- Frontend: TypeScript, Next.js 15, Tailwind CSS
- Auth: Firebase Authentication
- GraphQL: Apollo Client 4, Hasura GraphQL Engine
- Blockchain: Stellar, TrustlessWork API
- Wallets: Freighter, Albedo, LOBSTR
npm test # unit and integration tests
npm run test:e2e # E2E tests (Cypress)
npm run test:coverage # coverage reportTests live in __tests__/ or as .test.ts(x) files. E2E tests in cypress/e2e/. API requests mocked via MSW (mocks/handlers.ts).
npm run dev— must start without errors.- No
console.login production paths, no unexplainedanyor@ts-ignore. - Link the issue your PR closes.
Branch naming: feat/<issue-number>-short-description · fix/<issue-number>-short-description
© 2026 SafeTrust. Released under the MIT License.
