This is a Next.js project bootstrapped with create-next-app
.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
- Create an account on web3.storage
- Create a space
- Install the w3 cli
- login with the cli and call
w3 space use <did_of_space>
- Follow https://docs.storacha.network/how-to/http-bridge/#generating-auth-headers-with-w3cli
- Save your project did, auth header, and secret to .env.local:
W3_DELEGATED_DID=
W3_STORAGE_AUTH_HEADER=
W3_STORAGE_AUTH_SECRET=
- Create an OpenAI Key
- You need to have a validated organisation to use gpt-image-1
- Save your API key to .env
OPENAI_API_KEY=
- Create a postgres database (use Neon or Supabase)
DATABASE_URL=
- Install the Flow CLI
- Generate a private key for: emulator-account - keys/emulator-account.pkey
- For testnet Generate a private key for admin-testnet
- Start the emulator
flow emulator start
- Set these environment variables for emulator (or for testnet use those)
NEXT_PUBLIC_FLOW_ENDPOINT_URL='http://localhost:8888'
NEXT_PUBLIC_FLOW_NETWORK='emulator'
FLOW_CONTRACT_ADDRESS=
NEXT_PUBLIC_FLOW_ADMIN_ADDRESS=
NEXT_PUBLIC_FLOW_ENDPOINT_URL=
FLOW_ADMIN_HASH_ALGORITHM=
FLOW_ADMIN_SIGN_ALGORITHM=
NEXT_PUBLIC_FLOW_NETWORK=
NEXT_PUBLIC_FLOW_ADMIN_ADDRESS=
- Start the dev wallet
flow dev-wallet
- Deploy the contracts
pnpm flow:deploy:emulator
- Seed the background image
- If you want to replace the background image, you may want to run the transaction directly. Look at package.json to get the command
pnpm flow:seed:background:emulator
- Seed the database
- This is important otherwise the cron job will index the entire blockchain. It sets the starting blocks
pnpm db:seed