Skip to content

Latest commit

 

History

History
138 lines (93 loc) · 3.48 KB

File metadata and controls

138 lines (93 loc) · 3.48 KB

Contributing to Craft

Thank you for your interest in contributing to Craft! We welcome contributions from the community and are grateful for any help you can provide.

Getting Started

Prerequisites

  • Node.js >= 20.19.0
  • pnpm (package manager)
  • PostgreSQL database (we recommend Neon for development)

Development Setup

  1. Fork the repository and clone your fork:

    git clone https://github.com/<your-username>/craft.git
    cd craft
  2. Install dependencies:

    pnpm install
  3. Set up environment variables:

    cp apps/app/.env.example apps/app/.env

    Edit apps/app/.env and fill in the required values. At minimum, you need:

    • DATABASE_URL — PostgreSQL connection string
    • BETTER_AUTH_SECRET — A random 32+ character secret
    • At least one AI provider API key (e.g., ANTHROPIC_API_KEY)
  4. Run database migrations:

    pnpm db:migrate
  5. Start the development server:

    pnpm dev

    This starts the main app at http://localhost:3000.

Other Development Servers

pnpm dev:www     # Marketing website (localhost:3001)
pnpm dev:docs    # Documentation site (localhost:3002)
pnpm dev:blog    # Blog (localhost:3003)
pnpm dev:admin   # Admin panel
pnpm dev:all     # All services in parallel

Making Changes

Branch Naming

Create a feature branch from main:

git checkout -b feat/your-feature-name

Code Style

  • TypeScript is required for all source files
  • ESLint — Run pnpm lint to check for issues
  • Tailwind CSS v4 — Follow the design system in docs/design-system.md
  • Use only neutral colors (neutral-*, stone-*, gray-*) — no semantic colors
  • All interactive elements must use rounded corners
  • All components must support dark mode via dark: variants

Commit Messages

We use Conventional Commits. All commit messages are validated by commitlint.

type(scope): subject

Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore

Scopes: ai, api, ui, db, auth, billing, sandbox, etc.

Examples:

feat(ai): add support for new model provider
fix(api): handle empty response in chat endpoint
docs: update self-hosting guide

Testing

Run the test suite before submitting:

pnpm lint
pnpm type-check

Submitting a Pull Request

  1. Ensure your code follows the style guidelines above
  2. Update documentation if you're changing user-facing behavior
  3. Make sure all checks pass
  4. Push your branch and open a Pull Request against main
  5. Fill out the PR template with a clear description of your changes

PR Guidelines

  • Keep PRs focused — one feature or fix per PR
  • Include screenshots for UI changes
  • Reference related issues (e.g., Closes #123)
  • Be responsive to review feedback

Reporting Issues

  • Use GitHub Issues to report bugs
  • Include steps to reproduce, expected behavior, and actual behavior
  • Include your environment details (OS, Node version, browser)

Security

If you discover a security vulnerability, please do not open a public issue. Instead, see our Security Policy for responsible disclosure instructions.

License

By contributing to Craft, you agree that your contributions will be licensed under the Apache License 2.0.