| name | development-environment |
| description | IDE setup, dev containers, and local development tools |
| domain | tools-integrations |
| version | 1.0.0 |
| tags | ["vscode","devcontainers","docker","dotfiles","terminal"] |
| triggers | {"keywords":{"primary":["vscode","ide","devcontainer","docker","dotfiles","terminal","setup"],"secondary":["extension","config","workspace","neovim","vim","tmux","zsh"]},"context_boost":["development","local","environment","tooling"],"context_penalty":["production","deploy","cloud"],"priority":"medium"} |
Development Environment
Overview
Setting up efficient development environments with modern tools, containers, and automation.
VS Code Setup
Settings
{
"editor.fontSize": 14,
"editor.fontFamily": "'JetBrains Mono', 'Fira Code', monospace",
"editor.fontLigatures": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "explicit"
},
"editor.rulers": [80, 120],
"editor.minimap.enabled": false,
"editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"editor.inlineSuggest.enabled": true,
"files.autoSave": "onFocusChange",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.exclude": {
"**/.git": true,
"**/node_modules": true,
"**/.DS_Store": true,
"**/coverage": true,
"**/dist": true
},
"terminal.integrated.fontSize": 13,
"terminal.integrated.fontFamily": "'JetBrains Mono', monospace",
"terminal.integrated.defaultProfile.osx": "zsh",
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.suggest.autoImports": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"git.autofetch": true,
"git.confirmSync": false,
"git.enableSmartCommit": true
}
Extensions
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"ms-vscode.vscode-typescript-next",
"eamodio.gitlens",
"mhutchie.git-graph",
"ms-vscode-remote.remote-containers",
"ms-vscode.live-server",
"bradlc.vscode-tailwindcss",
"vitest.explorer",
"ms-playwright.playwright",
"usernamehw.errorlens",
"streetsidesoftware.code-spell-checker",
"christian-kohler.path-intellisense",
"formulahendry.auto-rename-tag",
"GitHub.github-vscode-theme",
"PKief.material-icon-theme"
]
}
Tasks & Launch
{
"version": "2.0.0",
"tasks": [
{
"label": "dev",
"type": "npm",
"script": "dev",
"problemMatcher": [],
"isBackground": true,
"presentation": {
"reveal": "always",
"panel": "new"
}
},
{
"label": "build",
"type": "npm",
"script": "build",
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Current File",
"type": "node",
"request": "launch",
"program": "${file}",
"runtimeArgs": ["--loader", "tsx"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeExecutable"
Dev Containers
Basic Configuration
{
"name": "Node.js Development",
"image": "mcr.microsoft.com/devcontainers/typescript-node:20",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/aws-cli:1": {}
},
"forwardPorts": [3000, 5432, 6379],
"postCreateCommand": "npm install",
"customizations": {
"vscode": {
"settings"
Docker Compose Dev Container
{
"name": "Full Stack Development",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"forwardPorts": [3000, 5432, 6379],
"postCreateCommand": "npm install",
"customizations": {
"vscode": {
"extensions": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"prisma.prisma"
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspace:cached
- node_modules:/workspace/node_modules
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/dev
- REDIS_URL=redis://cache:6379
depends_on:
- db
- cache
db:
image: postgres:15-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=dev
cache:
image: redis:7-alpine
volumes:
- redis_data:/data
volumes:
node_modules:
postgres_data:
redis_data:
# .devcontainer/Dockerfile
FROM mcr.microsoft.com/devcontainers/typescript-node:20
# Install additional tools
RUN apt-get update && apt-get install -y \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Install global npm packages
RUN npm install -g prisma tsx
# Set up zsh
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
USER node
Terminal Setup
Zsh Configuration
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
plugins=(
git
docker
docker-compose
npm
node
z
zsh-autosuggestions
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
alias ll='ls -la'
alias g='git'
alias gst='git status'
alias gco='git checkout'
alias gp='git push'
alias gl='git pull'
alias gc='git commit'
alias gd='git diff'
alias glog='git log --oneline --graph --all'
alias d='docker'
alias dc='docker-compose'
alias dps='docker ps'
alias dcu='docker-compose up -d'
alias dcd='docker-compose down'
alias nr='npm run'
alias nrd='npm run dev'
alias nrb='npm run build'
alias nrt='npm run test'
mkcd() { mkdir -p "$1" && cd ; }
NVM_DIR=
[ -s ] && \.
-U add-zsh-hook
load-() {
nvmrc_path=
[ -n ];
nvmrc_node_version=$(nvm version )
[ = ];
nvm install
[ != ];
nvm use
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
Starship Prompt
format = """
$directory\
$git_branch\
$git_status\
$nodejs\
$python\
$rust\
$docker_context\
$line_break\
$character"""
[directory]
truncation_length = 3
truncate_to_repo = true
[git_branch]
symbol = "🌱 "
format = "[$symbol$branch]($style) "
[git_status]
format = '([$all_status$ahead_behind]($style) )'
conflicted = "⚔️"
ahead = "⬆️${count}"
behind = "⬇️${count}"
diverged = "⬆️${ahead_count}⬇️${behind_count}"
untracked = "📁"
stashed = "📦"
modified = "📝"
staged = "✅"
deleted = "🗑️"
[nodejs]
format = "[$symbol($version )]($style)"
symbol = "⬢ "
[python]
format = "[$symbol($version )]($style)"
symbol = "🐍 "
[rust]
format = "[$symbol($version )]($style)"
symbol = "🦀 "
[docker_context]
format = "[$symbol$context]($style) "
=
=
=
Dotfiles Management
mkdir ~/.dotfiles
cd ~/.dotfiles
git init
~/.dotfiles/
├── .gitconfig
├── .zshrc
├── .vimrc
├── install.sh
├── macos/
│ └── defaults.sh
├── vscode/
│ ├── settings.json
│ └── keybindings.json
└── config/
└── starship.toml
#!/bin/bash
ln -sf ~/.dotfiles/.zshrc ~/.zshrc
ln -sf ~/.dotfiles/.gitconfig ~/.gitconfig
ln -sf ~/.dotfiles/config/starship.toml ~/.config/starship.toml
ln -sf ~/.dotfiles/vscode/settings.json \
~/Library/Application\ Support/Code/User/settings.json
if [[ "$OSTYPE" == "darwin"* ]]; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew bundle --file=~/.dotfiles/Brewfile
fi
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
curl -sS https://starship.rs/install.sh | sh
echo "Dotfiles installed!"
brew "git"
brew "gh"
brew "node"
brew "python"
brew "rust"
brew "go"
brew "jq"
brew "ripgrep"
brew "fd"
brew "bat"
brew "exa"
brew "fzf"
brew "starship"
brew "zoxide"
brew "docker"
brew "docker-compose"
brew "postgresql@15"
brew "redis"
cask "visual-studio-code"
cask "iterm2"
cask "docker"
cask "postman"
cask "figma"
cask "slack"
cask "notion"
Local Development
Environment Variables
DATABASE_URL=postgresql://user:pass@localhost:5432/myapp
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-secret-key
SESSION_SECRET=another-secret
STRIPE_SECRET_KEY=sk_test_...
SENDGRID_API_KEY=SG....
ENABLE_NEW_CHECKOUT=false
import { z } from 'zod';
const envSchema = z.object({
DATABASE_URL: z.string().url(),
REDIS_URL: z.string().url(),
JWT_SECRET: z.string().min(32),
NODE_ENV: z.enum(['development', 'test', 'production']).default('development'),
PORT: z.coerce.number().default(3000),
});
export const env = envSchema.parse(process.env);
Related Skills
- [[devops-cicd]] - CI/CD integration
- [[docker]] - Containerization
- [[git-workflows]] - Version control