Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .env.dev.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Local dev environment — copy to .env and adjust as needed
# docker compose -f docker-compose.dev.yml up

# Server
PORT=3000
NODE_ENV=development
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173

# Auth
API_KEYS=dev-api-key
JWT_SECRET=dev-secret-change-in-production

# Database (matches docker-compose.dev.yml postgres service)
DATABASE_URL=postgresql://paystream:paystream_dev@postgres:5432/paystream
TESTNET_DATABASE_URL=postgresql://paystream:paystream_dev@postgres:5432/paystream
MAINNET_DATABASE_URL=postgresql://paystream:paystream_dev@postgres:5432/paystream

# Redis (matches docker-compose.dev.yml redis service)
REDIS_URL=redis://redis:6379

# Stellar
STELLAR_NETWORK=testnet
TESTNET_RPC_URL=https://soroban-testnet.stellar.org
TESTNET_STREAM_CONTRACT_ID=
TESTNET_TOKEN_CONTRACT_ID=
MAINNET_RPC_URL=https://mainnet.stellar.validationcloud.io/v1/soroban/rpc
MAINNET_STREAM_CONTRACT_ID=
MAINNET_TOKEN_CONTRACT_ID=

# AWS Secrets Manager (disabled locally)
USE_AWS_SECRETS_MANAGER=false
AWS_SECRETS_MANAGER_SECRET_NAME=paystream/secrets
AWS_REGION=us-east-1

# Rate limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100

# Logging
LOG_LEVEL=info

# Frontend
VITE_API_URL=http://localhost:3000
7 changes: 7 additions & 0 deletions api/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
7 changes: 7 additions & 0 deletions demo/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5173
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
105 changes: 105 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: paystream
POSTGRES_USER: paystream
POSTGRES_PASSWORD: paystream_dev
ports: ['5432:5432']
volumes: [postgres_data:/var/lib/postgresql/data]
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U paystream']
interval: 10s
timeout: 5s
retries: 5

redis:
image: redis:7-alpine
ports: ['6379:6379']
volumes: [redis_data:/data]
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5

api:
build:
context: ./api
dockerfile: Dockerfile.dev
ports: ['3000:3000']
environment:
NODE_ENV: development
PORT: 3000
DATABASE_URL: postgresql://paystream:paystream_dev@postgres:5432/paystream
REDIS_URL: redis://redis:6379
CORS_ALLOWED_ORIGINS: http://localhost:3000,http://localhost:5173
JWT_SECRET: ${JWT_SECRET:-dev-secret-change-in-production}
API_KEYS: ${API_KEYS:-dev-api-key}
STELLAR_NETWORK: ${STELLAR_NETWORK:-testnet}
TESTNET_RPC_URL: ${TESTNET_RPC_URL:-https://soroban-testnet.stellar.org}
TESTNET_STREAM_CONTRACT_ID: ${TESTNET_STREAM_CONTRACT_ID:-}
TESTNET_TOKEN_CONTRACT_ID: ${TESTNET_TOKEN_CONTRACT_ID:-}
LOG_LEVEL: ${LOG_LEVEL:-info}
RATE_LIMIT_WINDOW_MS: ${RATE_LIMIT_WINDOW_MS:-900000}
RATE_LIMIT_MAX_REQUESTS: ${RATE_LIMIT_MAX_REQUESTS:-100}
USE_AWS_SECRETS_MANAGER: 'false'
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes: ['./api:/app', '/app/node_modules']
healthcheck:
test: ['CMD-SHELL', 'curl -f http://localhost:3000/health || exit 1']
interval: 30s
timeout: 10s
retries: 3

frontend:
build:
context: ./demo
dockerfile: Dockerfile.dev
ports: ['5173:5173']
environment:
VITE_API_URL: http://localhost:3000
depends_on: [api]
volumes: ['./demo:/app', '/app/node_modules']

indexer:
build:
context: ./services/indexer
dockerfile: Dockerfile.dev
environment:
NODE_ENV: development
DATABASE_URL: postgresql://paystream:paystream_dev@postgres:5432/paystream
REDIS_URL: redis://redis:6379
STELLAR_NETWORK: ${STELLAR_NETWORK:-testnet}
TESTNET_RPC_URL: ${TESTNET_RPC_URL:-https://soroban-testnet.stellar.org}
TESTNET_STREAM_CONTRACT_ID: ${TESTNET_STREAM_CONTRACT_ID:-}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes: ['./services/indexer:/app', '/app/node_modules']

notification:
build:
context: ./services/notification
dockerfile: Dockerfile.dev
environment:
NODE_ENV: development
REDIS_URL: redis://redis:6379
depends_on:
redis:
condition: service_healthy
volumes: ['./services/notification:/app', '/app/node_modules']

volumes:
postgres_data:
redis_data:

networks:
default:
name: paystream_dev
6 changes: 6 additions & 0 deletions services/indexer/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["node", "src/index.js"]
6 changes: 6 additions & 0 deletions services/notification/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
CMD ["node", "src/index.js"]
Loading