Installation Guide¶
This guide will help you install and set up Mint on your local machine.
Prerequisites¶
Before you begin, ensure you have the following installed:
- Docker (v20.10 or higher) - Install Docker
- Docker Compose (v2.0 or higher) - Install Docker Compose
- Git - Install Git
Verify Installation
Check if Docker and Docker Compose are installed correctly:
Clone the Repository¶
- Clone the repository
Environment Configuration¶
Each service requires environment variables. Create .env.docker files for each service:
Quick Setup (Copy from Examples)¶
# Auth Service
cp auth/.env.docker.example auth/.env.docker
# Wallet Service
cp wallet/.env.docker.example wallet/.env.docker
# Transactions Service
cp transactions/.env.docker.example transactions/.env.docker
# Notifications Service
cp notifications/.env.docker.example notifications/.env.docker
Manual Configuration¶
If the example files don't exist, create .env.docker files manually:
Auth Service (auth/.env.docker)¶
NODE_ENV=production
PORT=4001
DATABASE_URL=mongodb://root:example@mongodb:27017/mint_auth?authSource=admin
JWT_ISS="auth-service"
JWT_AUD="wallet-service transaction-service notification-service"
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672
Wallet Service (wallet/.env.docker)¶
NODE_ENV=production
PORT=4003
DATABASE_URL=mongodb://root:example@mongodb:27017/mint_wallet?authSource=admin
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672
JWKS_ENDPOINT=http://auth:4001/.well-known/jwks.json
JWT_ISS="auth-service"
JWT_AUD="wallet-service"
Transactions Service (transactions/.env.docker)¶
NODE_ENV=production
PORT=4004
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672
DATABASE_URL=mongodb://root:example@mongodb:27017/mint_txns?authSource=admin
JWKS_ENDPOINT=http://auth:4001/.well-known/jwks.json
JWT_AUD=transaction-service
JWT_ISS=auth-service
Notifications Service (notifications/.env.docker)¶
NODE_ENV=production
PORT=4002
SMTP_HOST=sandbox.smtp.mailtrap.io
SMTP_PORT=2525
SMTP_USER=your-mailtrap-user
SMTP_PASS=your-mailtrap-password
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672
Email Configuration
For the notifications service to send emails, you need to configure SMTP settings. For testing, use Mailtrap or any SMTP service.
Generate RSA Keys for JWT¶
The auth service requires RSA keys for JWT signing:
cd auth
mkdir -p keys
cd keys
# Generate private key
openssl genrsa -out private_key.pem 2048
# Generate public key
openssl rsa -in private_key.pem -pubout -out public_key.pem
cd ../..
Key Location
The keys should be in auth/keys/ directory. The Dockerfile will copy them during build.
Build and Run¶
Production Mode¶
Run the application in production mode:
This will:
- Build all service images
- Start MongoDB and RabbitMQ
- Launch all microservices
- Start the NGINX gateway
Expected Output
You should see logs from all services indicating they've started successfully. Look for messages like:
Development Mode¶
For development with hot-reloading:
Development mode features:
- ✅ Volume mounts for source code
- ✅ Automatic restart on file changes
- ✅ Debug logging enabled
- ✅ Service stdout/stderr visible
Verify Installation¶
Once all services are running, verify they're healthy:
Check Gateway Health¶
Expected Response:
Check Auth Service¶
Check JWKS Endpoint¶
Check Docker Containers¶
All containers should show status as healthy or running.
Access Services¶
Once running, the services are available at:
| Service | URL | Credentials |
|---|---|---|
| API Gateway | http://localhost | - |
| Auth Service | http://localhost:4001 (internal) | - |
| Wallet Service | http://localhost:4003 (internal) | - |
| Transactions Service | http://localhost:4004 (internal) | - |
| Notifications Service | http://localhost:4002 (internal) | - |
| RabbitMQ Management | http://localhost:15672 | guest/guest |
| MongoDB | mongodb://localhost:27017 | root/example |
Gateway vs Direct Access
All client requests should go through the API Gateway at http://localhost. Direct service ports are for internal communication and debugging only.
Troubleshooting¶
Port Already in Use¶
Error: Error: bind: address already in use
Solution:
Services Won't Start¶
Error: Containers exit immediately
Solution:
# Check logs
docker compose logs <service-name>
# Rebuild containers
docker compose down -v
docker compose up --build
Database Connection Issues¶
Error: MongoServerError: Authentication failed
Solution:
- Verify
DATABASE_URLin.env.dockerfiles - Ensure MongoDB is healthy:
docker compose ps - Reset MongoDB:
docker compose down -v mongodb && docker compose up mongodb
For more troubleshooting tips, see the Troubleshooting Guide.
Next Steps¶
Now that Mint is installed:
- Quick Start Guide - Complete your first transaction flow
- Configuration Guide - Learn about advanced configuration options
- API Reference - Explore the API endpoints
Clean Up¶
To stop and remove all containers: