All required configuration is via environment variables. See RUNTIME_ASSUMPTIONS.md for the full reference.
Required for production:
NODE_ENV=production
PORT=3000
STELLAR_NETWORK=mainnet
HORIZON_URL=https://horizon.stellar.org
ENCRYPTION_KEY=<32-byte hex string>
API_KEYS=<comma-separated keys, or use database-backed keys>Optional:
MOCK_STELLAR=false
DEBUG_MODE=false
LOG_VERBOSE=falseGenerate a secure ENCRYPTION_KEY:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"# 1. Install Node.js 18+
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# 2. Clone and install
git clone https://github.com/Manuel1234477/Stellar-Micro-Donation-API.git
cd Stellar-Micro-Donation-API
npm ci --omit=dev
# 3. Configure
cp .env.example .env
# Edit .env with production values
# 4. Initialize database
npm run init-db
# 5. Run with PM2 (process manager)
npm install -g pm2
pm2 start src/routes/app.js --name stellar-api
pm2 save
pm2 startupThe SQLite database is stored at data/stellar_donations.db. Back this up regularly.
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
RUN npm run init-db
EXPOSE 3000
CMD ["node", "src/routes/app.js"]docker build -t stellar-api .
docker run -d \
-p 3000:3000 \
-v $(pwd)/data:/app/data \
--env-file .env \
--name stellar-api \
stellar-apiMount /app/data as a volume to persist the SQLite database across container restarts.
- Install the EB CLI:
pip install awsebcli eb init— select Node.js platform- Add environment variables via the EB console or
eb setenv KEY=VALUE eb create stellar-api-prod
Mount an EFS volume at /app/data for persistent SQLite storage, or migrate to RDS PostgreSQL for production scale.
Use the Dockerfile above. Pass environment variables via the platform's secrets/env management. Mount persistent storage for /app/data.
-
NODE_ENV=production -
MOCK_STELLAR=false -
STELLAR_NETWORK=mainnet -
ENCRYPTION_KEYset to a secure random value - API keys created via
npm run keys:create - Database file backed up (or on persistent volume)
- HTTPS termination at load balancer / reverse proxy
- Health check configured:
GET /health - Log aggregation set up
- Rate limiting reviewed for expected traffic
See Pre-Deployment Checklist for the full verification list.
curl https://your-domain.com/health
# → { "status": "ok" }Use this endpoint for load balancer health checks and uptime monitoring.
The server handles SIGTERM and SIGINT by:
- Stopping the recurring donation scheduler
- Waiting for in-flight requests to complete
- Closing the database connection
Kubernetes/ECS will send SIGTERM before killing the container — the default 30-second grace period is sufficient.