Skip to content

Latest commit

 

History

History
142 lines (105 loc) · 3.11 KB

File metadata and controls

142 lines (105 loc) · 3.11 KB

Contributing to OTRUST

First off, thank you for considering contributing to OTRUST! 🎉

Code of Conduct

This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please be respectful and constructive in all interactions.

How Can I Contribute?

Reporting Bugs

Before creating bug reports, please check existing issues as you might find that you don't need to create one.

When creating a bug report, please include:

  • Clear title describing the issue
  • Steps to reproduce the behavior
  • Expected behavior vs actual behavior
  • Environment details (Node version, OS, browser)
  • Screenshots if applicable

Suggesting Features

Feature requests are welcome! Please:

  • Check if it's already suggested in issues
  • Describe the problem it solves
  • Explain how you'd like it to work
  • Consider if it fits the project scope

Pull Requests

  1. Fork the repository
  2. Clone your fork locally
  3. Create a branch for your changes:
    git checkout -b feature/amazing-feature
  4. Make your changes following the style guide below
  5. Run tests to ensure nothing breaks:
    npm test
    npm run test:e2e
  6. Commit with a clear message:
    git commit -m 'Add amazing feature'
  7. Push to your fork:
    git push origin feature/amazing-feature
  8. Open a Pull Request with a clear description

Development Setup

# Clone the repo
git clone https://github.com/otrust-eu/core.git
cd core

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Start development server
npm run dev

# Run tests
npm test

Style Guide

JavaScript

  • Use ES Modules (import/export)
  • 2-space indentation
  • Single quotes for strings
  • Semicolons required
  • Descriptive variable names

Commits

Follow Conventional Commits:

  • feat: - New feature
  • fix: - Bug fix
  • docs: - Documentation only
  • style: - Formatting, no code change
  • refactor: - Code change, no feature/fix
  • test: - Adding tests
  • chore: - Maintenance tasks

Examples:

feat: add webhook notifications for claims
fix: handle empty hash in /claim endpoint
docs: update API examples in README
test: add E2E tests for verify page

File Organization

src/           # Core application code
test/          # Test files (*.test.js)
test/e2e/      # End-to-end tests
web/           # Static frontend files
addons/        # Optional integrations
scripts/       # Build and maintenance scripts

Testing

  • Unit tests: Test individual functions
  • Integration tests: Test API endpoints
  • E2E tests: Test user flows in browser
# Run all tests
npm run test:all

# Run with coverage
npm run test:coverage

# Run specific test file
npm test -- test/crypto.test.js

# Run E2E tests with UI
npm run test:e2e:ui

Questions?

Thank you for contributing! 🙏