The goal of this code is to provide information, a framework, and ultimately a full-stack solution to users and organizations seeking to conduct governance or voting on the Cardano blockchain.
Key features that have informed design decisions of this platform include:
- Public Auditability: All pertinent information concerning a vote should be fully transparent and publicly auditable.
- Vote Security: Proof of voter participation intent using on-chain assets.
- Ease of Use: As easy as possible to maximize voter participation.
Creative Commons Attribution 4.0 International License. See LICENSE for details.
- Docker & Docker Compose
- Make
make init# Start services
make up
# Install dependencies
docker exec chainvote-app bash -c "cd /var/www/html && composer install --ignore-platform-reqs --no-interaction"
# Generate keys
docker exec chainvote-app bash -c "cd /var/www/html && php artisan key:generate --force"
docker exec chainvote-app bash -c "cd /var/www/html && php artisan ciphersweet:generate-key --force"
# Run migrations
docker exec chainvote-app bash -c "cd /var/www/html && php artisan migrate --force"
# Seed database
docker exec chainvote-app bash -c "cd /var/www/html && php artisan db:seed --class=RoleSeeder --force"
docker exec chainvote-app bash -c "cd /var/www/html && php artisan db:seed --class=AdminUserSeeder --force"
# Build frontend
docker exec chainvote-app bash -c "cd /var/www/html && yarn install && yarn build"| Service | Container Name | URL | Description |
|---|---|---|---|
| App | chainvote-app | http://localhost:8080 | Main Laravel application |
| Worker | chainvote-worker | - | Laravel Horizon queue worker |
| Lucid | chainvote-lucid | http://localhost:3000 | Cardano Lucid API (NestJS) |
| Serverless | chainvote-serverless | http://localhost:3000 | Serverless Lucid functions |
| Database | chainvote-db | localhost:5432 | PostgreSQL 17 |
| Redis | onchain-voting-redis-1 | localhost:6379 | Redis cache |
| MinIO | onchain-voting-minio-1 | localhost:9000/9001 | S3-compatible storage |
- Username:
chainvote - Password:
ouroboros
The setup wizard prompts for:
- Cardano Network - Preview / Preprod / Mainnet
- Blockfrost Project ID - Based on selected network
- App URL - Default: http://localhost:8080
Key variables in application/.env:
BLOCKFROST_PROJECT_ID- Blockfrost API keyCARDANO_NETWORK- 0=preview, 1=preprod, 2=mainnetDB_HOST- Database host (e.g.,chainvote.db)REDIS_HOST- Redis host (e.g.,redis)CARDANO_LUCID_ENDPOINT- Lucid API endpoint (e.g.,http://lucid:3000)AWS_ENDPOINT- MinIO endpoint (e.g.,http://minio:9000)MINIO_ENDPOINT- MinIO endpoint (e.g.,http://minio:9000)
| Command | Description |
|---|---|
make init |
Run interactive setup wizard |
make up |
Start all services |
make down |
Stop all services |
make restart |
Restart all services |
make logs |
View app logs |
make logs-worker |
View worker logs |
make logs-lucid |
View lucid logs |
make migrate |
Run migrations |
make seed |
Seed database |
make build |
Build frontend |
make wasm |
Copy WASM modules |
make clean |
Remove all containers and volumes |
- PHP 8.5
- Laravel 11.x
- Laravel Horizon
- Laravel Sanctum
- PostgreSQL 17
- Vue.js 3
- Vite
- Tailwind CSS
- Inertia.js
- Lucid Cardano (backend API via NestJS)
- Blockfrost API
- Docker
- Node.js 18+
- NestJS
- MinIO (S3 storage)
- Redis
# Check container status
docker compose ps
# View logs
make logs
# Restart a specific service
docker compose restart worker
# Access container shell
make sh
# Run artisan commands
make artisan migrate
make artisan db:seed
# Reset everything
make clean
make initWorker not starting:
- Ensure
SUPERVISOR_PHP_USER=sailis set in docker-compose.yml
Redis connection errors:
- Ensure
REDIS_HOST=redisin.env(notchainvote.redis)
Lucid API not accessible:
- Ensure
CARDANO_LUCID_ENDPOINT=http://lucid:3000in.env
MinIO/S3 errors:
- Ensure
MINIO_ENDPOINT=http://minio:9000in.env
Frontend build warnings about browserslist:
- Run
docker exec chainvote-app bash -c "cd /var/www/html && yarn dedupe"