This is an official starter Turborepo.
Run the following command:
npx create-turbo@latest
This Turborepo includes the following packages/apps:
@repo/eslint-config
:eslint
configurations (includeseslint-config-next
andeslint-config-prettier
)@repo/typescript-config
:tsconfig.json
s used throughout the monorepo@repo/suciphus-suapp
: the main appsuciphus-mainframe
: a frontend application served athttp://localhost:3001
admin
: an admin dashboard served athttp://localhost:3000
Each package/app is 100% TypeScript.
This Turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- ESLint for code linting
- Prettier for code formatting
Build
8000 div>To build all apps and packages, run the following command:
pnpm build
Using installed suave-geth
suave-geth --suave-dev
Local suave-geth build
./build/bin/geth \
--dev \
--dev.gaslimit 5000000000 \
--http \
--http.addr "0.0.0.0" \
--http.port 8545 \
--http.api "eth,web3,net,clique,debug" \
--http.corsdomain "*" \
--allow-insecure-unlock \
--keystore "$HOME/.suave-dev/keystore" \
--unlock "0xB5fEAfbDD752ad52Afb7e1bD2E40432A485bBB7F" \
--password "$HOME/.suave-dev/password.txt" \
--ws \
--suave.eth.remote_endpoint "http://localhost:8548" \
--miner.gasprice 0 \
--rpc.gascap 10000000000 \
--networkid 16813125 \
--suave.eth.external-whitelist "*" \
--verbosity 3
To get supabase running locally, follow their self-hosting guide.
Make note of these variables from your supabase deployment's environment (or .env file):
POSTGRES_PASSWORD
POSTGRES_HOST
POSTGRES_DB
POSTGRES_PORT
SERVICE_ROLE_KEY
Build contracts & generate typescript bindings:
cd ./packages/suciphus-suapp
pnpm i
pnpm contracts:build
pnpm contracts:deploy
pnpm build
cd -
Populate environment files:
-
In the admin app's .env file, the
SUPABASE_URL
variable should point to the supabase postgres DB; it's composed of the postgres-related variables we noted earlier:SUPABASE_URL=postgres://postgres:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
This example assumes you're using the default user
postgres
; you may need to change this if not self-hosting supabase.SUPABASE_SERVICE_KEY
should be populated withSERVICE_ROLE_KEY
from earlier.cd apps/admin && cp .env.example .env vim .env cd -
-
The user-facing app can use default values:
cd apps/suciphus-mainframe && cp .env.example .env && cd -
Install dependencies:
pnpm i
To develop all apps and packages, run the following command:
pnpm dev
This will start both suciphus-mainframe
and admin
apps:
suciphus-mainframe
is accessible athttp://localhost:3001/player
for testing prompts.admin
can be accessed athttp://localhost:3000/admin/
to view the admin dashboard.
Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:
cd my-turborepo
npx turbo login
This will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
npx turbo link
Learn more about the power of Turborepo: