Development Setup
Set up your local development environment to contribute to Dits. This guide covers everything from cloning the repo to running tests.
Quick Setup
Most developers can be up and running in under 10 minutes.
Prerequisites
Required
- Node.js 18+ - JavaScript runtime
- npm 9+ - Package manager
- Git 2.30+ - Version control
Recommended
- VS Code - Editor with extensions
- Docker - For integration tests
- PostgreSQL - Local database
Initial Setup
1. Clone the Repository
# Clone your fork
git clone https://github.com/YOUR_USERNAME/dits.git
cd dits
# Add upstream remote
git remote add upstream https://github.com/byronwade/dits.git
# Fetch all branches
git fetch --all2. Install Dependencies
# Install all dependencies
npm install
# This will install dependencies for:
# - Root workspace
# - All packages/*
# - All apps/*3. Build the Project
# Build all packages
npm run build
# Or build specific package
npm run build -w @dits/core
npm run build -w @dits/cliProject Structure
dits/
├── apps/
│ ├── web/ # Documentation website (Next.js)
│ └── cli/ # Command-line interface
├── packages/
│ ├── core/ # Core library
│ ├── storage/ # Storage backends
│ ├── network/ # Network protocols
│ └── shared/ # Shared utilities
├── tests/
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ └── e2e/ # End-to-end tests
└── docs/ # Additional documentationDevelopment Commands
Common Commands
npm run devStart development modenpm run buildBuild all packagesnpm run lintRun lintingnpm run formatFormat codenpm run cleanClean build artifactsVS Code Setup
Recommended Extensions
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"prisma.prisma",
"ms-vscode.vscode-typescript-next"
]
}Workspace Settings
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}Debugging
VS Code Launch Configuration
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug CLI",
"program": "${workspaceFolder}/apps/cli/src/index.ts",
"args": ["status"],
"runtimeArgs": ["-r", "ts-node/register"],
"console": "integratedTerminal"
},
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run", "--reporter=verbose"],
"console": "integratedTerminal"
}
]
}Troubleshooting
Common Issues
Build fails with TypeScript errors
Try running npm run clean && npm run build to clear caches.
Dependencies not found
Run npm install from the root directory to install all workspace dependencies.
Tests timing out
Some integration tests require Docker. Ensure Docker is running.
Need Help?
If you encounter issues, check our troubleshooting guide or ask in GitHub Discussions.