Complete guide for deploying AFRAMP to various platforms.
# Clone repository
git clone https://github.com/your-org/Aframp.git
cd Aframp
# Setup environment
cp .env.example .env.local
# Option 1: Docker (Recommended)
docker-compose -f docker-compose.dev.yml up
# Option 2: Node.js
npm install && npm run devAccess at http://localhost:3000 ✅
Create .env.local with these variables:
# Demo Mode (false in production)
NEXT_PUBLIC_DEMO_MODE=false
# Stellar Configuration
NEXT_PUBLIC_CNGN_ISSUER=GXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# Paystack (for card payments)
NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY=pk_test_xxxxxxxxxxxxx
PAYSTACK_SECRET_KEY=sk_test_xxxxxxxxxxxxx
# Flutterwave (for mobile money)
NEXT_PUBLIC_FLUTTERWAVE_PUBLIC_KEY=FLWPUBK_TEST-xxxxxxxxxxxxx
FLUTTERWAVE_SECRET_KEY=FLWSECK_TEST-xxxxxxxxxxxxx
FLUTTERWAVE_ENCRYPTION_KEY=FLWSECK_TESTxxxxxxxxxxxxx
# Optional: WebSocket for real-time updates
NEXT_PUBLIC_BILLS_WS_URL=wss://your-websocket-url.com-
Paystack
- Sign up at paystack.com
- Navigate to Settings → API Keys & Webhooks
- Copy Test keys for development, Live keys for production
-
Flutterwave
- Sign up at flutterwave.com
- Go to Settings → API
- Copy Test keys for development, Live keys for production
-
Stellar Issuer
- Development: Use testnet issuer
- Production: Contact AFRAMP team or deploy your own issuer
Hot-reload enabled for rapid development:
# Start development environment
docker-compose -f docker-compose.dev.yml up
# Rebuild after package.json changes
docker-compose -f docker-compose.dev.yml up --build
# Run in background
docker-compose -f docker-compose.dev.yml up -d
# View logs
docker-compose -f docker-compose.dev.yml logs -f
# Stop
docker-compose -f docker-compose.dev.yml downOptimized build with multi-stage Dockerfile:
# Build and start
docker-compose -f docker-compose.prod.yml up -d
# View logs
docker-compose -f docker-compose.prod.yml logs -f
# Stop
docker-compose -f docker-compose.prod.yml down# Build production image
docker build -t aframp:latest .
# Run with custom port
docker run -p 8080:3000 --env-file .env.local aframp:latest
# Run with environment variables
docker run -p 3000:3000 \
-e NEXT_PUBLIC_DEMO_MODE=false \
-e NEXT_PUBLIC_CNGN_ISSUER=GXXX... \
aframp:latestPros: Zero-config, automatic deployments, edge network, preview deployments
-
Setup
# Install Vercel CLI (optional) npm i -g vercel -
Deploy via Dashboard
- Go to vercel.com
- Click "New Project"
- Import your GitHub repository
- Configure:
- Framework Preset: Next.js
- Root Directory:
./ - Build Command:
npm run build - Output Directory:
.next
-
Environment Variables
- In Vercel Dashboard → Settings → Environment Variables
- Add all variables from
.env.example - Set different values for Production/Preview/Development
-
Deploy
# Via CLI vercel --prod # Or push to main branch (auto-deploys) git push origin main
Pros: Simple deployment, built-in databases, affordable pricing
-
Setup
# Install Railway CLI npm i -g @railway/cli # Login railway login
-
Deploy
# Initialize project railway init # Add environment variables railway variables set NEXT_PUBLIC_DEMO_MODE=false railway variables set NEXT_PUBLIC_CNGN_ISSUER=GXXX... # Deploy railway up
-
Configure
- Railway auto-detects Next.js
- Custom domain: Settings → Domains
- Environment variables: Variables tab
Pros: Free tier available, simple setup, automatic SSL
-
Setup
- Go to render.com
- Click "New +" → "Web Service"
- Connect GitHub repository
-
Configure
- Name:
aframp - Environment:
DockerorNode - Build Command:
npm run build - Start Command:
npm start - Instance Type: Free or Starter
- Name:
-
Environment Variables
- Add all variables from
.env.example - Click "Add Environment Variable" for each
- Add all variables from
-
Deploy
- Click "Create Web Service"
- Render auto-deploys on push to main
Pros: Enterprise-grade, scalable, full control
-
Build and Push Image
# Login to ECR aws ecr get-login-password --region us-east-1 | \ docker login --username AWS --password-stdin <account-id>.dkr.ecr.us-east-1.amazonaws.com # Build image docker build -t aframp:latest . # Tag image docker tag aframp:latest <account-id>.dkr.ecr.us-east-1.amazonaws.com/aframp:latest # Push image docker push <account-id>.dkr.ecr.us-east-1.amazonaws.com/aframp:latest
-
Create ECS Service
- Create ECS Cluster
- Create Task Definition (use pushed image)
- Create Service with Load Balancer
- Configure environment variables in Task Definition
-
Environment Variables
- Use AWS Systems Manager Parameter Store or Secrets Manager
- Reference in Task Definition
Pros: Serverless, auto-scaling, pay-per-use
# Build and deploy
gcloud builds submit --tag gcr.io/PROJECT_ID/aframp
gcloud run deploy aframp \
--image gcr.io/PROJECT_ID/aframp \
--platform managed \
--region us-central1 \
--allow-unauthenticated \
--set-env-vars NEXT_PUBLIC_DEMO_MODE=false,NEXT_PUBLIC_CNGN_ISSUER=GXXX...Pros: Integrated with Azure ecosystem, Kubernetes-based
# Create resource group
az group create --name aframp-rg --location eastus
# Create container app
az containerapp create \
--name aframp \
--resource-group aframp-rg \
--image <your-registry>/aframp:latest \
--target-port 3000 \
--ingress external \
--env-vars NEXT_PUBLIC_DEMO_MODE=false NEXT_PUBLIC_CNGN_ISSUER=GXXX...Pros: Simple, affordable, managed infrastructure
-
Setup
- Go to digitalocean.com
- Click "Create" → "Apps"
- Connect GitHub repository
-
Configure
- Detected as: Node.js/Next.js
- Build Command:
npm run build - Run Command:
npm start
-
Environment Variables
- Add in App Settings → Environment Variables
Issue: Module not found errors
# Clear cache and reinstall
rm -rf node_modules .next
npm install
npm run buildIssue: TypeScript errors
# Run type check
npm run type-check
# Fix or temporarily ignore in next.config.mjs
typescript: { ignoreBuildErrors: true }Issue: Container exits immediately
# Check logs
docker-compose logs aframp-app
# Verify environment variables
docker-compose configIssue: Port already in use
# Change port in docker-compose.yml
ports:
- "3001:3000" # Use 3001 insteadIssue: Hot-reload not working in dev mode
# Add to docker-compose.dev.yml
environment:
- WATCHPACK_POLLING=trueIssue: API keys not working
- Verify keys are correct (test vs live)
- Check environment variable names (must start with
NEXT_PUBLIC_for client-side) - Restart server after changing
.env.local
Issue: Stellar transactions failing
- Verify
NEXT_PUBLIC_CNGN_ISSUERis correct - Check network (testnet vs mainnet)
- Ensure wallet has sufficient XLM for fees
Issue: Slow page loads
# Enable production optimizations
NODE_ENV=production npm run build
npm start
# Or use Docker production build
docker-compose -f docker-compose.prod.yml upIssue: High memory usage
- Increase Docker memory limit
- Optimize images and assets
- Enable Next.js image optimization
Built into Dockerfile:
HEALTHCHECK --interval=30s --timeout=3s \
CMD node -e "require('http').get('http://localhost:3000', ...)"# Check if app is running
curl http://localhost:3000
# Check with timeout
curl --max-time 5 http://localhost:3000- Never commit
.env.local- Use.env.exampleas template - Use secrets management - AWS Secrets Manager, Azure Key Vault, etc.
- Set
NEXT_PUBLIC_DEMO_MODE=falsein production - Use HTTPS - All platforms provide free SSL
- Rotate API keys regularly
- Monitor logs for suspicious activity
- Documentation: README.md
- Issues: GitHub Issues
- Community: [Discord/Slack link]
Built for Africa, Deployed Everywhere 🌍🚀