Skip to content

Environment Setup

Complete environment setup guide for RecordPlatform from scratch.

Prerequisites

Host Requirements

ResourceMinimumRecommended
CPU4 cores8 cores
Memory8 GB16 GB
Disk40 GB100 GB SSD
OSUbuntu 20.04+ / CentOS 8+ / macOS 12+Ubuntu 22.04 LTS

Software Requirements

SoftwareVersionPurpose
Docker20.10+Infrastructure containerization
Docker Compose2.0+Container orchestration
Java21 (LTS)Backend services
Maven3.8+Java build
Node.js20+Frontend build
pnpm10+Frontend package manager
Git2.30+Version control

Step 1: Configure Environment Variables

bash
# Clone the repository
git clone https://github.com/SoarCollab/RecordPlatform.git
cd RecordPlatform

# Copy the environment template
cp .env.example .env

Edit .env and update key settings:

bash
# Must change
JWT_KEY=<random-string-at-least-32-chars>
DB_PASSWORD=<database-password>
REDIS_PASSWORD=<redis-password>
S3_ACCESS_KEY=<minio-access-key>
S3_SECRET_KEY=<minio-secret-key>

# Optional: adjust for your environment
SPRING_PROFILES_ACTIVE=local   # local / dev / prod

TIP

For development, the default values in .env.example work out of the box.

Step 2: Start Infrastructure

Use docker-compose.infra.yml to start all containerizable infrastructure:

bash
# Start all infrastructure services
docker compose -f docker-compose.infra.yml up -d

# Wait until all services are healthy
docker compose -f docker-compose.infra.yml up -d --wait

Included services:

ServicePortManagement UI
Nacos8848http://localhost:8848/nacos
MySQL3306
Redis6379
RabbitMQ5672http://localhost:15672
MinIO-A9000http://localhost:9001
MinIO-B9010http://localhost:9011
OTel Collector4317/4318/8889
Jaeger16686http://localhost:16686

Verify status:

bash
docker compose -f docker-compose.infra.yml ps

Step 3: Configure Nacos

Nacos serves as the configuration center. Application configs must be imported.

  1. Open Nacos console: http://localhost:8848/nacos (default: nacos/nacos)
  2. Create configurations:
Data IDGroupDescription
backend-web.yamlDEFAULT_GROUPBackend main config (DB, Redis, RabbitMQ connections)
platform-storage.yamlDEFAULT_GROUPStorage service config (S3 node list, encryption params)

Important

Sensitive credentials (DB password, Redis password, etc.) are stored in Nacos configurations, not in .env. The infrastructure credentials in .env are only used by docker-compose. platform-fisco reads blockchain node and contract settings from .env (FISCO_*), not from a Nacos Data ID.

Step 4: FISCO BCOS Node

The FISCO BCOS blockchain node cannot be started via docker-compose and requires manual deployment on the server.

Quick Setup (Single Group, 4 Nodes)

bash
# Download build_chain script
curl -#LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v3.8.0/build_chain.sh
chmod +x build_chain.sh

# Generate 4-node chain (Air version)
bash build_chain.sh -l 127.0.0.1:4 -p 30300,20200

# Start all nodes
bash nodes/127.0.0.1/start_all.sh

Copy SDK Certificates

bash
# Copy certificates to the FISCO service resource directory
cp nodes/127.0.0.1/sdk/* platform-fisco/src/main/resources/conf/

Deploy Smart Contracts

Deploy Storage.sol and Sharing.sol using the FISCO BCOS console:

bash
# Download and start the console
# See: https://fisco-bcos-doc.readthedocs.io/zh-cn/latest/docs/quick_start/air_installation.html

# After deployment, update contract addresses in .env
FISCO_STORAGE_CONTRACT=0x<deployed-address>
FISCO_SHARING_CONTRACT=0x<deployed-address>

INFO

For detailed node setup and contract deployment, see the FISCO BCOS Documentation.

Step 5: Verify Environment

Run the environment pre-check script to validate all infrastructure at once:

bash
./scripts/env-check.sh

The script checks 8 items:

#CheckValidates
1NacosConnectivity + config existence
2MySQLConnection + database existence
3RedisAuthentication + PING
4RabbitMQAMQP port + management API
5FISCO BCOSNode port connectivity
6S3/MinIOHealth check + bucket existence
7TLS CertificatesFile existence + expiry
8Contract AddressesFormat validation

Auto-fix mode (creates database, buckets, etc.):

bash
./scripts/env-check.sh --fix

Check a single service:

bash
./scripts/env-check.sh --service mysql

Step 6: Build and Start

Build

bash
# 1. Install shared interfaces (first time or when dependencies change)
mvn -f platform-api/pom.xml clean install

# 2. Build backend
mvn -f platform-backend/pom.xml clean package -DskipTests

# 3. Build FISCO service
mvn -f platform-fisco/pom.xml clean package -DskipTests

# 4. Build storage service
mvn -f platform-storage/pom.xml clean package -DskipTests

# 5. Frontend
cd platform-frontend && pnpm install && pnpm build

Start

bash
# Start all services with the management script
./scripts/start.sh start all

# Check service status
./scripts/start.sh status

Startup order: platform-storageplatform-fiscoplatform-backend → frontend

Verify

bash
# Backend health check
curl http://localhost:8000/record-platform/actuator/health

# Frontend dev server
cd platform-frontend && pnpm dev

Troubleshooting

IssueCauseSolution
Nacos fails to startInsufficient memoryEnsure Docker has ≥ 4GB memory allocated
MySQL connection refusedContainer not readydocker compose -f docker-compose.infra.yml up -d --wait
Redis AUTH failedPassword mismatchCheck REDIS_PASSWORD in .env matches Nacos config
FISCO service hangs on startupNode unreachableSdkBeanConfig connects on init — ensure node is running
MinIO inaccessiblePort conflictCheck if ports 9000/9001 are already in use
Dubbo service discovery failsWrong DUBBO_HOSTSet DUBBO_HOST to host IP in Docker environments
env-check.sh deep checks skippedCLI tools missingInstall mysql-client, redis-cli, aws, etc.

Released under the Apache 2.0 License.