Skip to content

Latest commit

 

History

History
169 lines (116 loc) · 3.15 KB

File metadata and controls

169 lines (116 loc) · 3.15 KB

Contributing to OpsKnight

Thank you for your interest in contributing to OpsKnight! This document provides guidelines and information for contributors.

📋 Table of Contents

Code of Conduct

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code.

Security Policy

Please review our Security Policy for instructions on how to report vulnerabilities.

Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL 14+
  • Git

Fork and Clone

  1. Fork the repository on GitHub
  2. Clone your fork:
    git clone https://github.com/YOUR_USERNAME/opsknight.git
    cd opsknight
  3. Add upstream remote:
    git remote add upstream https://github.com/dushyant-rahangdale/opsknight.git

Development Setup

# Install dependencies
npm install

# Copy environment file
cp env.example .env

# Start PostgreSQL (Docker)
docker compose up -d postgres

# Run database migrations
npx prisma migrate deploy
npx prisma generate

# Start development server
npm run dev

Making Changes

Branch Naming

  • feature/ - New features
  • fix/ - Bug fixes
  • docs/ - Documentation changes
  • refactor/ - Code refactoring

Example: feature/slack-thread-replies

Commit Messages

Follow Conventional Commits:

type(scope): description

feat(slack): add thread reply support
fix(auth): resolve SSO redirect loop
docs(api): update events endpoint examples

Testing

# Run all tests
npm test

# Run specific test file
npm test path/to/test.ts

# Run with coverage
npm run test:coverage

Pull Request Process

  1. Update from upstream

    git fetch upstream
    git rebase upstream/main
  2. Create a branch

    git checkout -b feature/your-feature
  3. Make changes and test

    npm test
    npm run lint
  4. Push and create PR

    git push origin feature/your-feature
  5. PR Requirements

    • Clear description of changes
    • Tests for new functionality
    • Documentation updates if needed
    • All CI checks passing

Style Guidelines

TypeScript

  • Use TypeScript for all new code
  • Enable strict mode
  • Prefer interfaces over types for objects
  • Use meaningful variable names

React

  • Use functional components
  • Follow React hooks rules
  • Keep components focused and small
  • Use proper prop typing

CSS

  • Use CSS variables for theming
  • Follow BEM naming when applicable
  • Mobile-first responsive design

Code Quality

  • ESLint and Prettier are enforced
  • Run npm run lint before committing
  • Husky pre-commit hooks are enabled

Questions?


Thank you for contributing! 🎉