- Node.js (version 22.x)
- PNPM
- Docker
- 
Clone the repository: git clone https://github.com/hicommonwealth/commonwealth.git 
- 
Navigate to the project directory: cd commonwealth
- 
Install dependencies: pnpm install 
- 
Set up environment variables: cp .env.example .env 
- 
Run external services (postgresql, redis, rabbitmq): docker-compose up -d 
- 
Run the database migrations: pnpm migrate-db 
- 
Start the server: pnpm run start 
The API server runs on http://localhost:3000/ and you can test it by making a request to http://localhost:3000/api/health. It should respond with
{
  "status": "ok"
}The client is served from http://localhost:8080/.
Some features of the application require additional API keys. While the app will still function without them, certain functionalities may be limited.
Required for openAI image generation:
- OPENAI_ORGANIZATION
- OPENAI_API_KEY
Required for chain features on EVM chains (groups, stake, contests):
- ETH_ALCHEMY_API_KEY
Ensure these keys are set up in your environment variables to fully utilize all features of the application.
- pnpm start-all- Starts ALL the microservices in different processes. Requires a RabbitMQ instance/connection to function properly.
 
- pnpm start-apps- Starts just the web-servers from all the microservices (currently just Commonwealth and Chain-Events)
- This should be enough for most local front-end development
 
- pnpm start-rmq- Starts a local RabbitMQ instance using Docker.
- Run this in a separate terminal and pair it with the pnpm start-allcommand to get a fully functional app.
 
- pnpm start-redis- make sure to have REDIS_URL=redis://localhost:6379in your .env file
- Starts a local redis instance using Docker, it will start redis on its default port 6379
 
- make sure to have 
- pnpm load-db [optional-dump-name]- Loads the default latest.dumpor theoptional-dump-nameinto the database
- Only available in the commonwealthandchain-eventspackages
 
- Loads the default