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

CommandDescription
./alef.sh upStart all services with local Hardhat blockchain
./alef.sh up --amoyStart with Polygon Amoy testnet (requires DEPLOYER_PRIVATE_KEY)
./alef.sh downStop all running services
./alef.sh restart [svc]Restart a specific service or all
./alef.sh statusShow running services and ports
./alef.sh logs [svc]Tail logs for a service
./alef.sh buildBuild all services
./alef.sh deployStart Hardhat node + deploy contracts

Test Accounts

RoleEmailPasswordPreset
Adminadmin@alef.marketsAdmin@123super_admin
Issuerissuer@alef.marketsIssuer@123
Investortest@alef.marketsInvestor@123
Staff (KYC)kyc@alef.marketsKYC@123456operations
Staff (Compliance)compliance@alef.marketsCompliance@123compliance_officer

Port Map

ServicePortURL
Web (Frontend)3000http://localhost:3000
Trading Server8080http://localhost:8080
Platform API8081http://localhost:8081
Blockchain Service8082http://localhost:8082
PostgreSQL5432
Hardhat (Blockchain)8545http://localhost:8545
Docs Portal3001http://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