pnpm installStart the postgres database in docker locally:
pnpm run docker:dbMigrate the local database:
pnpm run prisma:migrate:devCopy the .env.example file to .env.local and fill in the environment variables.
The authentication is done with Auth.js. The following environment variables are required to let users sign in with their Google, Discord, and email accounts.
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="random-secret-for-dev"
AUTH_GOOGLE_CLIENT_ID=""
AUTH_GOOGLE_CLIENT_SECRET=""
AUTH_GMAIL_USER=""
AUTH_GMAIL_PASS=""
AUTH_DISCORD_CLIENT_ID=""
AUTH_DISCORD_CLIENT_SECRET=""You can refer to the Auth.js documentation for more information. For example, the Google Provider.
The database is managed with Prisma. The following environment variables are required to connect to the database.
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_DB=openagent
DB_HOST=localhost
DB_PORT=5432
DB_SCHEMA=publicThese environment variables are used in the prisma/schema.prisma file to connect to the database. It's set by default in .env.example, update the values according to your environment.
The backend API is used to fetch data from server. The following environment variables are required to connect to the backend API.
BACKEND_URL="https://YOUR_BACKEND_URL"
API_EXECUTOR_URL="https://YOUR_API_EXECUTOR_URL"The wallet is used to sign transactions and interact with the blockchain. The following environment variables are required to connect to the wallet.
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
NEXT_PUBLIC_CHAIN_ID=Note: For NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID, every dApp that relies on WalletConnect now needs to obtain a projectId from WalletConnect Cloud. This is absolutely free and only takes a few minutes.
For NEXT_PUBLIC_CHAIN_ID, you can refer to the Chainlist for the chain ID of the blockchain you want to connect to. For example, in production, it should be 1 for mainnet; and in development, it could be 11155111 for Sepolia testnet.
Run the development server:
pnpm run devThe frontend is running at http://localhost:3000.
The framework used is Next.js. You can refer to the documentation for more information.
You can deploy the frontend to Vercel, Netlify, or any other platforms that support Next.js. a Dockerfile is also provided for your reference.
Before deploying, you may want to complete the environment variables in the .env.production file and set up the deployment configuration.