Skip to main content

Development Setup

Complete guide to setting up your development environment.

Prerequisites

  • Node.js: v18.0 or higher
  • pnpm: v8.0 or higher
  • Git: Latest version

Installation

1. Clone the Repository

git clone https://github.com/your-org/serverless-monolith.git
cd serverless-monolith

2. Install Dependencies

pnpm install

3. Build All Packages

pnpm build

Project Structure

serverless-monolith/
├── packages/
│ ├── core/ # Core framework
│ ├── proxy/ # Proxy server
│ ├── lighthouse/ # Terminal UI
│ └── docs/ # Documentation
├── .changeset/ # Changesets
├── turbo.json # Turborepo config
├── pnpm-workspace.yaml # Workspace config
└── package.json # Root scripts

Development Scripts

Building

# Build all packages
pnpm build

# Build specific package
pnpm build:core
pnpm build:proxy
pnpm build:lighthouse

Testing

# Run all tests
pnpm test

# Run tests for specific package
pnpm test:core

# Run tests in watch mode
pnpm test:watch

# Run tests with coverage
pnpm test:coverage

Linting

# Check lint
pnpm lint

# Fix lint issues
pnpm lint:fix

Type Checking

pnpm type-check

Documentation

# Start docs dev server
pnpm docs

# Build docs
pnpm docs:build

# Serve built docs
pnpm docs:serve

Working on Packages

Core Package

cd packages/core

# Build
pnpm build

# Test
pnpm test

# Watch mode
pnpm build --watch

Proxy Package

cd packages/proxy

# Build
pnpm build

# Test
pnpm test

Lighthouse Package

cd packages/lighthouse

# Build
pnpm build

# Start dev mode
pnpm dev

Documentation

cd packages/docs

# Start dev server
pnpm start

# Build
pnpm build

IDE Setup

VS Code

Recommended extensions:

  • ESLint
  • Prettier
  • TypeScript

Settings:

{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}

Cursor

The project includes .cursorrules for AI assistance.

Debugging

Core Package

Use VS Code debugger with this config:

{
"type": "node",
"request": "launch",
"name": "Debug Core",
"program": "${workspaceFolder}/packages/core/examples/basic-usage.ts",
"runtimeArgs": ["-r", "tsx/cjs"],
"console": "integratedTerminal"
}

Tests

Debug tests with:

{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand", "--testPathPattern=${fileBasename}"],
"console": "integratedTerminal"
}

Troubleshooting

Build Issues

# Clean and rebuild
pnpm clean
pnpm install
pnpm build

Cache Issues

# Clear Turborepo cache
rm -rf .turbo
pnpm build

Dependency Issues

# Reinstall dependencies
rm -rf node_modules
rm -rf packages/*/node_modules
pnpm install

Next Steps