The Aether Web3 DApp offers a robust interface for Web3 transactions, secure data handling, and seamless database integration. This guide provides setup instructions, configuration tips, and security best practices.
Define essential environment variables to configure your DApp for development or production.
-
Server Port
Set the default server port:PORT=3000
Aether integrates Arcjet Shield for enhanced client-side security. Configure your Arcjet environment and key:
-
Arcjet Configuration
ARCJET_ENV=development ARCJET_KEY=ajkey_yourkey
Obtain your
ARCJET_KEY
from Arcjet.
-
MongoDB & Turso Database Connection
Configure the following for data storage and retrieval:
MONGODB_URI= TURSO_DATABASE_URL= TURSO_AUTH_TOKEN=
Select Db-Name / Open Db Overview / Edit Data Button / Open Drizzle Studio / SQL Runner / Paste Table Code 🎫 / Run :
CREATE TABLE productsTable (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
description TEXT,
price REAL NOT NULL,
stock INTEGER DEFAULT 0,
imageUrl TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Okay, now come back to the edit products button and you can edit the product information from Outerbase and the step is below; Select Db-Name / Open Db Overview / Edit Data Button / “./main” by default this folder will come under the table we have created by pressing the productsTable / Add Row button to enter the product information and save it by pressing Save and we can cancel it by pressing “Discard Changes”.
-
Cloudinary Integration
Configure Cloudinary to manage media files.
CLOUDINARY_URL= NEXT_PUBLIC_CLOUDINARY_URL=
Enable analytics for better insights during deployment.
ANALYZE=true yarn build
NODE_ENV=production
VITE_NODE_ENV=production
Define the main server load URL for remote indexing.
MAIN_SERVER_LOAD_REMOTE_INDEX_URL=http://localhost:3001/load-remote-index
Set up API keys for Alchemy and Infura to enable Web3 transactions.
ALCHEMY_API_KEY=
ALCHEMY_URL=
API_INFURA_URL=
Secure the app by setting a strong, unique secret key.
BETTER_AUTH_SECRET=
-
WebSocket Connection to SQLD Server
URL=ws://localhost:8080 JWT=Example_Token_JWT
Set up Clerk API keys as an alternative authentication method.
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=YOUR_PUBLISHABLE_KEY
CLERK_SECRET_KEY=YOUR_SECRET_KEY
Web3 operations can be accessed via /web3
and /web3-info
routes.
-
Create an Infura account and set your role as Founder/Administrator.
-
Generate an API key in My First Key.
-
Update the
server.ts
file at line 28 to sync with your Infura API key:const ethereumProviderUrl = process.env.API_INFURA_URL || 'https://mainnet.infura.io/v3/api';
Ensure API_INFURA_URL
is correctly set in .env
.
Get a free Alchemy API key, then configure .env
and server.ts
files with:
- MetaMask Secret Key
- Etherscan API Key
- MongoDB Connection String
Install dependencies using npm:
npm install