Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Backend CI

on:
push:
paths:
- 'backend/**'
- '.github/workflows/backend-ci.yml'
pull_request:
paths:
- 'backend/**'
- '.github/workflows/backend-ci.yml'

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov black isort
pip install -r requirements.txt

- name: Format with black
run: black .

- name: Check imports with isort
run: isort --check-only .

- name: Lint with flake8
run: flake8 . --count --max-complexity=10 --max-line-length=120 --statistics

- name: Run tests with pytest
run: pytest --cov=app --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./backend/coverage.xml
flags: backend
fail_ci_if_error: false
53 changes: 53 additions & 0 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Frontend CI

on:
push:
paths:
- 'frontend/**'
- '.github/workflows/frontend-ci.yml'
pull_request:
paths:
- 'frontend/**'
- '.github/workflows/frontend-ci.yml'

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend

steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install dependencies
run: npm install

- name: Check formatting
run: npm run format:check || npm run format -- --check

- name: Lint
run: npm run lint

- name: Type check
run: npm run typecheck || npm run check:types || npm run tsc

- name: Build
run: npm run build

- name: Test
run: npm test -- --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./frontend/coverage/coverage-final.json
flags: frontend
fail_ci_if_error: false
102 changes: 102 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Contributing to Toban Contribution Viewer

Thank you for your interest in contributing to Toban Contribution Viewer! This document provides guidelines and instructions for contributing to the project.

## Code of Conduct

By participating in this project, you agree to uphold our Code of Conduct, which requires treating all individuals with respect and creating a positive environment for everyone.

## Getting Started

1. **Fork the repository** on GitHub
2. **Clone your fork** locally
3. **Set up the development environment** following the instructions in the README.md
4. **Create a feature branch** from the main branch for your changes

## Development Process

### Before You Start

1. Check the project's GitHub issues for related work
2. If you're planning a significant change, open an issue to discuss it first
3. Ensure your planned changes align with the project's goals and architecture

### Development Workflow

1. Keep your changes focused and related to a single issue or feature
2. Write clean, well-documented code
3. Include tests for new features or bug fixes
4. Follow the project's coding standards and patterns
5. Keep commits logically organized and with clear messages

### Pull Request Process

1. Update your fork with the latest changes from the main repository
2. Push your changes to your fork
3. Submit a pull request to the main repository
4. Include a clear title and description of your changes
5. Reference any related issues using GitHub's issue linking (e.g., "Fixes #123")
6. Be responsive to feedback and questions during the review process

## Coding Standards

### General Guidelines

- Follow the established patterns in the codebase
- Write self-documenting code with clear variable and function names
- Include comments for complex logic
- Ensure your code is well-tested

### Backend (Python)

- Follow PEP 8 style guidelines
- Use type hints
- Document functions and classes with docstrings
- Organize imports according to PEP 8 (standard library, third-party, local)

### Frontend (TypeScript/React)

- Follow ESLint and Prettier configurations
- Use TypeScript types/interfaces
- Follow React best practices (hooks, functional components, etc.)
- Keep components focused and maintainable
- CSS/styling should be consistent with the project's approach

## Testing

- Ensure all tests pass before submitting a pull request
- Add tests for new features
- Update tests for modified features
- Aim for high test coverage, especially for critical functionality

## Documentation

- Update documentation for any user-facing changes
- Document new features, configuration options, and APIs
- Keep code documentation up-to-date with implementation

## Commit Messages

Follow these guidelines for commit messages:

- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests after the first line

Example:
```
Add Slack message analysis feature

- Implement message fetching from Slack API
- Add sentiment analysis for messages
- Create database schema for storing results

Fixes #123
```

## Questions?

If you have questions about contributing, please open an issue or reach out to the project maintainers.

Thank you for contributing to Toban Contribution Viewer!
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Hackdays

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading