Skip to main content

Development Environment Setup

Set up your local development environment for optimal QuikDB Nodes development experience.

Prerequisites

Required Tools

Ensure you have these tools installed before proceeding:

  • Docker (v24.0 or higher) - Container runtime
  • Node.js (v18.0 or higher) - JavaScript runtime
  • Git (v2.30 or higher) - Version control
  • Terminal/Shell - Command line access

These tools will enhance your development experience:

  • 🎯 VS Code with Docker extension
  • 🔧 Docker Compose (v2.0 or higher)
  • 🌐 curl or httpie for API testing
  • 📝 jq for JSON processing
  • 🔍 Docker Desktop (for GUI management)

System Validation

Check if your system meets the requirements:

# Validate system resources and requirements
quikdb-nodes validate

# Check specific provider type requirements
quikdb-nodes validate --type compute --tier standard

# Detailed validation report
quikdb-nodes validate --detailed

Docker Setup

Docker Installation

macOS

# Using Homebrew
brew install --cask docker

# Or download Docker Desktop from docker.com

Ubuntu/Debian

# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

# Add user to docker group
sudo usermod -aG docker $USER
newgrp docker

Windows

Download Docker Desktop from docker.com

Docker Configuration

Optimize Docker for QuikDB development:

# Check Docker version
docker --version
docker-compose --version

# Test Docker installation
docker run hello-world

# Check available resources
docker system info

In Docker Desktop settings:

  • Memory: At least 4GB (8GB recommended)
  • CPU: At least 2 cores (4+ recommended)
  • Disk: At least 50GB available
  • Enable experimental features for advanced functionality

Node.js Setup

Installation

# Using Node Version Manager (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 18
nvm use 18

# Or using Homebrew (macOS)
brew install node@18

# Verify installation
node --version
npm --version

Global Dependencies

Install commonly used global packages:

# Essential tools
npm install -g quikdb-nodes
npm install -g pm2 # Process manager
npm install -g nodemon # Development auto-reload

# Optional but helpful
npm install -g http-server # Simple HTTP server
npm install -g json-server # Mock API server

Development Workspace

Project Structure

Create a dedicated workspace for QuikDB projects:

# Create workspace directory
mkdir ~/quikdb-workspace
cd ~/quikdb-workspace

# Initialize git (if not already done)
git init

# Create common directories
mkdir projects
mkdir templates
mkdir scripts

Environment Configuration

Set up your shell environment:

# Add to ~/.bashrc, ~/.zshrc, or equivalent
export QUIKDB_WORKSPACE="$HOME/quikdb-workspace"
export PATH="$PATH:$QUIKDB_WORKSPACE/scripts"

# QuikDB environment variables
export QUIKDB_TOKEN="your_development_token"
export QUIKDB_ENDPOINT="https://api.quikdb.com"

# Docker environment
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1

Installation

Download VS Code from code.visualstudio.com

Essential Extensions

Install these extensions for optimal QuikDB development:

# Install via command line
code --install-extension ms-vscode-remote.remote-containers
code --install-extension ms-azuretools.vscode-docker
code --install-extension bradlc.vscode-tailwindcss
code --install-extension esbenp.prettier-vscode
code --install-extension ms-vscode.vscode-json

Workspace Configuration

Create a VS Code workspace configuration:

// .vscode/settings.json
{
"docker.showStartPage": false,
"docker.defaultRegistryPath": "quikdb",
"files.associations": {
"Dockerfile*": "dockerfile",
"docker-compose*.yml": "dockercompose"
},
"terminal.integrated.defaultProfile.osx": "zsh",
"terminal.integrated.cwd": "${workspaceFolder}",
"prettier.configPath": "./.prettierrc"
}

Useful Snippets

Create custom snippets for common QuikDB patterns:

// .vscode/quikdb.code-snippets
{
"QuikDB Deploy": {
"prefix": "qdb-deploy",
"body": [
"# Deploy to QuikDB",
"quikdb-nodes deploy \\",
" --name ${1:app-name} \\",
" --tier ${2:standard} \\",
" --location ${3:us-east}"
],
"description": "Basic QuikDB deployment command"
}
}

Development Workflow

Project Initialization

For new projects:

# Navigate to workspace
cd ~/quikdb-workspace/projects

# Create new project
mkdir my-new-app
cd my-new-app

# Initialize with QuikDB
quikdb-nodes init

# Initialize git
git init
git add .
git commit -m "Initial commit"

Development Scripts

Create helpful development scripts:

# ~/quikdb-workspace/scripts/dev-setup.sh
#!/bin/bash
echo "🚀 Setting up QuikDB development environment..."

# Check prerequisites
quikdb-nodes validate --detailed

# Start development services
docker-compose -f docker-compose.dev.yml up -d

# Show status
quikdb-nodes status

echo "✅ Development environment ready!"

Make it executable:

chmod +x ~/quikdb-workspace/scripts/dev-setup.sh

Testing Your Setup

Verification Checklist

Run through this checklist to verify your setup:

# 1. Check CLI installation
quikdb-nodes --version

# 2. Verify authentication
quikdb-nodes auth status

# 3. Test Docker
docker run --rm hello-world

# 4. Validate system
quikdb-nodes validate

# 5. Check VS Code extensions
code --list-extensions | grep -E "(docker|remote)"

Sample Project

Test with a simple project:

# Create test project
mkdir test-quikdb-setup
cd test-quikdb-setup

# Create simple Dockerfile
cat > Dockerfile << EOF
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
EOF

# Create package.json
cat > package.json << EOF
{
"name": "test-app",
"version": "1.0.0",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"express": "^4.18.0"
}
}
EOF

# Create simple server
cat > server.js << EOF
const express = require('express');
const app = express();

app.get('/', (req, res) => {
res.json({ message: 'Hello from QuikDB!' });
});

app.listen(3000, () => {
console.log('Server running on port 3000');
});
EOF

# Test local build
docker build -t test-app .
docker run -p 3000:3000 test-app

Troubleshooting

Common Issues

Docker permission denied (Linux):

sudo usermod -aG docker $USER
newgrp docker

Node.js version conflicts:

# Use nvm to manage versions
nvm install 18
nvm use 18
nvm alias default 18

VS Code extensions not working:

# Reload VS Code window
# Or reinstall extensions
code --uninstall-extension ms-azuretools.vscode-docker
code --install-extension ms-azuretools.vscode-docker

Getting Help

If you encounter issues:

  1. Check the Troubleshooting Guide
  2. Join our Community Discord
  3. Review system requirements

Next Steps

With your development environment ready:

  1. Deploy your first application
  2. Explore advanced configuration
  3. Learn about monitoring

Need help? Check our Support Guide or join our Community.