Installation & Setup
2. Installation & Setup
2.1. Prerequisites
System Requirements
Before installing DaaS Boilerplate, ensure your system meets the following requirements:
- Operating System
- Unix-based system (Linux or macOS) recommended
- Windows with WSL2 supported
- Required Software
- Docker Engine (20.10.x or higher)
- Docker Compose (2.x or higher)
- Node.js (18.x or higher)
- Yarn (1.22.x or higher)
- OpenSSL (for SSL certificate generation)
[!NOTE] ๐ธ Screenshot Needed: System requirements verification commands and expected output
Environment Files
The system uses several environment files for configuration:
-
Root Directory
.env
: Main environment configuration.env.example
: Template for main configuration
-
Frontend Directory
frontend/.env
: Frontend-specific configurationfrontend/.env.example
: Template for frontend configuration
-
Backend Directory
backend/.env
: Backend-specific configurationbackend/.env.example
: Template for backend configuration
[!NOTE] ๐ธ Screenshot Needed: Directory structure showing environment files
2.2. Installation Process
Repository Setup
-
Clone the Repository
git clone https://github.com/your-repo/daas-boilerplate.git cd daas-boilerplate
-
Run Setup Script
chmod +x setup.sh ./setup.sh
The setup script performs the following actions:
- Copies environment file templates
- Installs dependencies
- Generates SSL certificates
- Initializes Docker volumes
[!NOTE] ๐ธ Screenshot Needed: Setup script execution and successful completion
Deployment Options
Docker Deployment (Recommended)
-
Production Mode
docker-compose up -d
-
Development Mode
docker-compose -f docker-compose.local.yml up -d
Direct Node.js Execution
-
Frontend Development
cd frontend yarn install yarn dev
-
Backend Development
cd backend yarn install yarn develop
[!NOTE] ๐ธ Screenshot Needed: Both Docker and Node.js deployment methods in action
2.3. Environment Configuration
Traefik Proxy Setup
-
Domain Configuration
- Edit
docker/traefik/traefik.yml
- Configure your domain in
.env
DOMAIN=your-domain.com
- Edit
-
SSL Certificates
- Automatic Let's Encrypt configuration
- Manual certificate placement in
docker/traefik/certs/
[!NOTE] ๐ Diagram Needed: Traefik proxy routing flow
Environment Variables
Key environment variables to configure:
-
General Configuration
NODE_ENV=production PORT=3000 DATABASE_URL=postgresql://user:password@localhost:5432/dbname
-
Security Settings
JWT_SECRET=your-secure-jwt-secret ADMIN_JWT_SECRET=your-secure-admin-jwt-secret API_TOKEN_SALT=your-api-token-salt
-
External Services
STRIPE_SECRET_KEY=sk_test_... STRIPE_WEBHOOK_SECRET=whsec_...
[!NOTE] ๐ธ Screenshot Needed: Environment configuration interface or example
Post-Installation Verification
-
Health Checks
curl http://localhost/health curl http://localhost/api/health
-
Service Status
docker-compose ps
-
Logs Verification
docker-compose logs -f
[!NOTE] ๐ธ Screenshot Needed: Successful health check and service status output