Quick Start
Get the entire Alef Markets platform running locally
Prerequisites
Go 1.24+
go version
Node.js 18+
node --version
PostgreSQL 16
psql --version
Python 3.9+ (seeding)
python3 --version
Setup Steps
1
Create Database
createdb alef_demo # Or via psql: psql -U postgres -c "CREATE DATABASE alef_demo;"
2
Run Migrations
# From project root — all 12 migration files for f in migrations/*.sql; do psql -U postgres -d alef_demo -f "$f" done
3
Seed Test Data
cd scripts/seed pip install -r requirements.txt python3 seed.py
4
Start All Services
# The unified launcher — starts everything ./alef.sh up
5
Deploy Smart Contracts (optional)
# Start Hardhat node + deploy ERC-3643 contracts ./alef.sh deploy # Or manually: ./start-blockchain-local.sh
6
Open the Platform
open http://localhost:3000 # Login with admin@alef.markets / Admin@123
alef.sh Commands
| Command | Description |
|---|---|
| ./alef.sh up | Start all services with local Hardhat blockchain |
| ./alef.sh up --amoy | Start with Polygon Amoy testnet (requires DEPLOYER_PRIVATE_KEY) |
| ./alef.sh down | Stop all running services |
| ./alef.sh restart [svc] | Restart a specific service or all |
| ./alef.sh status | Show running services and ports |
| ./alef.sh logs [svc] | Tail logs for a service |
| ./alef.sh build | Build all services |
| ./alef.sh deploy | Start Hardhat node + deploy contracts |
Test Accounts
| Role | Password | Preset | |
|---|---|---|---|
| Admin | admin@alef.markets | Admin@123 | super_admin |
| Issuer | issuer@alef.markets | Issuer@123 | — |
| Investor | test@alef.markets | Investor@123 | — |
| Staff (KYC) | kyc@alef.markets | KYC@123456 | operations |
| Staff (Compliance) | compliance@alef.markets | Compliance@123 | compliance_officer |
Port Map
| Service | Port | URL |
|---|---|---|
| Web (Frontend) | 3000 | http://localhost:3000 |
| Trading Server | 8080 | http://localhost:8080 |
| Platform API | 8081 | http://localhost:8081 |
| Blockchain Service | 8082 | http://localhost:8082 |
| PostgreSQL | 5432 | — |
| Hardhat (Blockchain) | 8545 | http://localhost:8545 |
| Docs Portal | 3001 | http://localhost:3001 |
Polygon Amoy Testnet (Optional)
Instead of the local Hardhat node, you can deploy to Polygon Amoy testnet for a more realistic environment. Contracts persist across restarts (unlike Hardhat which is ephemeral).
1. Get testnet MATIC
Visit https://faucet.polygon.technology and request MATIC for the Amoy testnet.
2. Export your deployer key
export DEPLOYER_PRIVATE_KEY=your_private_key_here
3. Start with --amoy flag
./alef.sh up --amoy
This skips Hardhat startup, uses Polygon Amoy RPC (chain 80002), and preserves contract addresses on shutdown.
Database Connection
Host: 127.0.0.1:5432 Database: alef_demo User: postgres Password: Hello@123