Prerequisites
Before you begin, ensure you have the following installed on your system:Node.js
Version 18 or higher required
npm
Comes with Node.js installation
PostgreSQL
Required for local database
Git
For version control
Verify Prerequisites
Run these commands to verify your installations:Initial Project Setup
Install dependencies
Install all required npm packages:This will install all dependencies listed in
package.json, including:- Next.js 14.2.35 - React framework
- Prisma 5.22.0 - Database ORM
- TypeScript 5.4.5 - Type safety
- Tailwind CSS 3.3.2 - Styling
- ethers.js 6.16.0 - Ethereum library
- wagmi 2.13.0 - React hooks for Ethereum
Set up environment variables
Create a See the Configuration Guide for detailed environment variable documentation.
.env.local file in the project root. Contact your team on Discord to get the complete environment configuration.Never commit
.env.local or .env files to version control. These files contain sensitive credentials.Database Setup with Prisma
Configure database connection
Set your database URL in
.env.local:Agora uses a dual-database architecture:
- READ_WRITE_WEB2_DATABASE_URL - User-generated content (profiles, settings)
- READ_ONLY_WEB3_DATABASE_URL - Blockchain indexed data (proposals, votes, delegates)
Pull the latest schema
The database schema is managed in a separate repository. Pull the latest schema:This command introspects your database and updates the Prisma schema file at
prisma/schema.prisma.Generate Prisma Client
Generate the TypeScript Prisma Client:This creates type-safe database access methods based on your schema.
Verify database access
You can explore your database using a SQL client:The database has the following schemas:
TablePlus
Recommended by the team
pgAdmin
Free PostgreSQL tool
- center - Admin-only access
- config - Shared configuration data
- agora - Shared data (customer info, aggregations)
- [dao namespace] - DAO-specific schemas (optimism, ens, uniswap, etc.)
Development Environment Setup
Generate TypeChain contracts
Generate TypeScript typings for smart contracts:This creates type-safe contract interfaces in
src/lib/contracts/generated/.Start the development server
Development Tools
Code Quality Commands
Before committing code, always run:Additional Utilities
Database Management
Keeping Schema Updated
The database schema is managed externally. To sync your local schema:Learn more in the Database Manual
Troubleshooting
Database connection fails
Database connection fails
Verify your database is running and credentials are correct:Check that your
DATABASE_URL in .env.local matches your database configuration.Prisma generate fails
Prisma generate fails
This usually means the database schema is out of sync:
Missing environment variables
Missing environment variables
Ensure you have all required variables in
.env.local:NEXT_PUBLIC_AGORA_INSTANCE_NAMENEXT_PUBLIC_AGORA_INSTANCE_TOKENNEXT_PUBLIC_AGORA_ENVNEXT_PUBLIC_ALCHEMY_IDNEXT_PUBLIC_WALLETCONNECT_PROJECT_ID
Port 3000 already in use
Port 3000 already in use
Either stop the other process or use a different port:
Next Steps
Configuration
Learn about environment variables and configuration options
Deployment
Deploy your Agora instance to production
Customization
Customize themes, branding, and features
Architecture
Understand the application structure