The frontend component of Agora is a Next.js web application that provides the user interface for the Agora platform. It enables users to interact with the decentralized governance system through a modern, responsive web interface.
Copy the local.example file to .env.local and update the values with your own credentials:
cplocal.example.env.local
Edit .env.local and fill in the required values. It is mandatory to edit the Infura and Pinata credentials; the other values can be used as provided in the example. Please refer to the documentation of Pinata and Infura to create your own credentials.
MongoDB Setup (Required for Space Metadata):
The application requires MongoDB for storing space descriptions and logos. You have two options:
Option A: MongoDB Atlas (Recommended for Production)
Create a free account at https://mongodb.com/atlas
Create a new cluster
Get the connection string from "Connect" → "Connect your application"
Data Storage: MongoDB for off-chain metadata (space descriptions and logos). See Metadata Storage Architecture for details.
Deployment: Hardhat development environment
Encryption: Zama FHE (@zama-fhe/relayer-sdk)
Wallet: RainbowKit, Wagmi
Automation: Chainlink
UI Components: Radix UI, Framer Motion animations
Project Structure
Subgraphs
The platform uses The Graph protocol for efficient on-chain data indexing:
agora_subgraph/: Subgraph for Agora-related events
For local development, you can run your own subgraph node instead of using the hosted service. Refer to The Graph documentation for setup instructions.
Agora Subgraph Commands
To work with the Agora subgraph locally:
Navigate to the subgraph directory:
Install dependencies:
Generate types from the ABI:
Build the subgraph:
Deploy locally (requires local Graph Node):
Deploy to hosted service (replace with your Graph Studio details):
Ensure you have the Graph CLI installed globally: npm install -g @graphprotocol/graph-cli.
Development
Available Scripts
npm run dev - Start development server with Turbopack