Installation Guide
This guide covers multiple installation methods for CryptoPulse, from local development to production-ready multi-instance deployments.Prerequisites
Required Software
Node.js
Version 22 or higher required
pnpm
Package manager for local development
PostgreSQL
Version 16+ recommended
Redis
Version 7+ for coordination and throttling
Optional Software
- Docker & Docker Compose: For containerized deployments
- nginx: For load balancing multiple instances
External Services
Installation Methods
- Local Development
- Docker Single Instance
- Docker Multi-Instance
Local Development Setup
Perfect for development and testing without containers.Set Up Local Services
You need PostgreSQL and Redis running locally. Using Docker:Or install them natively:
Run Development Server
- API: http://localhost:3000
- Swagger: http://localhost:3000/docs
Development Commands
Environment Variables Reference
Authentication
| Variable | Required | Default | Description |
|---|---|---|---|
ADMIN_USER | Yes | - | Username for /auth/login |
ADMIN_PASS | Yes | - | Password for /auth/login |
JWT_SECRET | Yes | - | Secret for signing JWT tokens |
JWT_EXPIRES_IN | No | 1h | Token expiration (e.g., 1h, 30m, 7d) |
Database & Cache
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | - | PostgreSQL connection string |
REDIS_URL | Yes | - | Redis connection string |
Rate Limiting
| Variable | Required | Default | Description |
|---|---|---|---|
THROTTLE_TTL_MS | No | 60000 | Throttle window duration in milliseconds |
THROTTLE_GLOBAL_LIMIT | No | 20 | Max requests per window (all endpoints) |
THROTTLE_LOGIN_LIMIT | No | 5 | Max login attempts per window |
CoinGecko Integration
| Variable | Required | Default | Description |
|---|---|---|---|
COINGECKO_API_KEY | Yes | - | Your CoinGecko API key |
COINGECKO_BASE_URL | No | https://api.coingecko.com | CoinGecko API base URL |
COINGECKO_TIMEOUT_MS | No | 3000 | Upstream request timeout |
Batching Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
BATCH_WINDOW_MS | No | 5000 | Max time to wait before flushing batch |
BATCH_THRESHOLD | No | 3 | Number of requests to trigger early flush |
REQUEST_TIMEOUT_MS | No | 8000 | Max wait time per client request |
Application
| Variable | Required | Default | Description |
|---|---|---|---|
PORT | No | 3000 | HTTP server port |
LOG_LEVEL | No | info | Winston log level (error, warn, info, debug) |
Database Setup
Automatic Migration
TypeORM automatically creates tables on first startup. No manual migration needed.Manual Database Access
Verification
After installation, verify everything works:Troubleshooting
Port 3000 already in use
Port 3000 already in use
Change the
PORT in .env to something else like 3001, then restart.Cannot connect to PostgreSQL
Cannot connect to PostgreSQL
Verify PostgreSQL is running:Check the
DATABASE_URL format and credentials.Cannot connect to Redis
Cannot connect to Redis
Verify Redis is running:
TypeORM synchronization errors
TypeORM synchronization errors
If tables don’t auto-create, check database permissions:
CoinGecko API errors
CoinGecko API errors
Verify your API key is valid and has not exceeded rate limits. Check CoinGecko API status.
Next Steps
Quickstart
Follow the quickstart guide to make your first API calls
Configuration
Learn how to customize batching, throttling, and more
API Reference
Explore all available endpoints and parameters
Deployment
Production deployment best practices and scaling