Skip to main content

Development Environment Setup

This guide will help you set up your development environment for Pixentech projects.

Required Tools

Node.js and Package Manager

# Install Node.js (v18 or higher)
# Download from: https://nodejs.org/

# Verify installation
node --version
npm --version

# Recommended: Install Bun for faster package management
curl -fsSL https://bun.sh/install | bash

Code Editor

We recommend Visual Studio Code with the following extensions:

  • TypeScript and JavaScript Language Features
  • Prettier - Code formatter
  • ESLint
  • GitLens
  • Docker

Database

# PostgreSQL (recommended)
# macOS
brew install postgresql

# Ubuntu/Debian
sudo apt-get install postgresql postgresql-contrib

# Windows
# Download from: https://www.postgresql.org/download/windows/

Version Control

# Git
# macOS
brew install git

# Ubuntu/Debian
sudo apt-get install git

# Configure Git
git config --global user.name "Your Name"
git config --global user.email "your.email@pixentech.com"

Environment Configuration

SSH Keys for GitHub

# Generate SSH key
ssh-keygen -t ed25519 -C "your.email@pixentech.com"

# Start ssh-agent
eval "$(ssh-agent -s)"

# Add SSH key
ssh-add ~/.ssh/id_ed25519

# Copy public key and add to GitHub
cat ~/.ssh/id_ed25519.pub

Environment Variables

Create a .env file in your project root:

# Database
DATABASE_URL=postgresql://username:password@localhost:5432/database_name

# API Keys
API_KEY=your_api_key_here

# Environment
NODE_ENV=development
PORT=3000

Project Setup Workflow

1. Clone Repository

git clone git@github.com:pixentech/project-name.git
cd project-name

2. Install Dependencies

# Using npm
npm install

# Using bun (recommended)
bun install

3. Database Setup

# Run migrations
npm run migrate

# Seed data (if available)
npm run seed

4. Start Development Server

npm run dev
# or
bun dev

Code Quality Tools

Prettier Configuration

Create .prettierrc:

{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"tabWidth": 2
}

ESLint Configuration

Most projects include ESLint configuration. Run:

npm run lint

Pre-commit Hooks

# Install husky for pre-commit hooks
npm install --save-dev husky

# Setup pre-commit hook
npx husky add .husky/pre-commit "npm run lint && npm run test"

Troubleshooting

Common Issues

Port already in use:

# Kill process on port 3000
lsof -ti:3000 | xargs kill -9

# Or use a different port
PORT=3001 npm run dev

Permission denied (SSH):

# Check SSH key is added to ssh-agent
ssh-add -l

# Test SSH connection to GitHub
ssh -T git@github.com

Database connection failed:

# Check PostgreSQL is running
brew services start postgresql

# Check connection
psql -d database_name -U username

Getting Help

  • Technical Issues: Create an issue in the project repository
  • General Questions: Reach out on Slack #dev-help
  • Urgent Issues: Contact DevOps team

Next Steps

After setting up your environment:

  1. Review the project's README.md
  2. Check out the API documentation
  3. Run the test suite to ensure everything works
  4. Start with a small feature or bug fix