Installation
Installation
Section titled “Installation”This guide will help you set up the Cosella development environment on your machine.
Prerequisites
Section titled “Prerequisites”- Node.js: v22.0.0 or higher (recommended: v22.x LTS)
- pnpm: v9.0.0 or higher
- Git: v2.30.0 or higher
Quick Setup
Section titled “Quick Setup”1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/cosella/cosella.gitcd cosella2. Install Dependencies
Section titled “2. Install Dependencies”pnpm install3. Verify Installation
Section titled “3. Verify Installation”pnpm typecheckpnpm lintpnpm testDevelopment Workflow
Section titled “Development Workflow”Start All Apps
Section titled “Start All Apps”pnpm devStart Specific Apps
Section titled “Start Specific Apps”# Dashboard (sales rep UI) — port 5173pnpm --filter @cosella/dashboard dev
# Admin panel — port 5174pnpm --filter @cosella/admin dev
# Documentation site — port 4322pnpm --filter @cosella/docs dev
# Marketing site — port 4321pnpm --filter @cosella/marketing dev
# Storybook (component library) — port 6006pnpm --filter @cosella/storybook dev# Build all packages and appspnpm build
# Build a specific apppnpm --filter @cosella/dashboard build# Run all testspnpm test
# Run tests for a specific packagepnpm --filter @cosella/ui test
# Run tests with coveragepnpm test -- --coverageCode Generation
Section titled “Code Generation”Generate a New UI Component
Section titled “Generate a New UI Component”pnpm gen componentThis creates:
packages/ui/src/<kebab-name>/<Name>.tsxpackages/ui/src/<kebab-name>/<Name>.test.tsx- Export added to
packages/ui/src/index.ts
Generate a New Package
Section titled “Generate a New Package”pnpm gen packageThis creates:
packages/<name>/package.jsonpackages/<name>/tsconfig.jsonpackages/<name>/src/index.ts
Regenerate API Client
Section titled “Regenerate API Client”pnpm gen:apiRegenerates packages/api-client/src/api.gen.ts from the OpenAPI spec.
IDE Setup
Section titled “IDE Setup”VS Code
Section titled “VS Code”Install the following extensions:
- ESLint (
dbaeumer.vscode-eslint) - Prettier (
esbenp.prettier-vscode) - Tailwind CSS IntelliSense (
bradlc.vscode-tailwindcss) - TypeScript Importer (
ms-vscode.vscode-typescript-next)
Recommended Settings
Section titled “Recommended Settings”{ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" }, "typescript.tsdk": "node_modules/typescript/lib"}Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Port Already in Use
Section titled “Port Already in Use”If you see EADDRINUSE errors, stop any running dev servers:
# Find and kill processes on the portlsof -ti:5173 | xargs kill -9Type Errors
Section titled “Type Errors”Run typecheck to identify issues:
pnpm typecheckLint Errors
Section titled “Lint Errors”Run the linter to fix formatting:
pnpm lint --fixBuild Failures
Section titled “Build Failures”Clean and rebuild:
rm -rf node_modules/.cacherm -rf apps/*/distpnpm buildNext Steps
Section titled “Next Steps”- Project Structure - Understand the codebase
- Development Guide - Contribution guidelines
- Vibecoder UI Guide - Safe UI-only contributions
- AI Agent Guide - Rules for AI coding agents