Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Update to Akeru.ai Project Documentation and Standards #90

Merged
merged 1 commit into from
Apr 23, 2024
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
135 changes: 135 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@

# Akeru.ai Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the [Akeru.ai](https://www.akeru.ai) community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at [email protected].

**All complaints will be reviewed and investigated promptly and fairly.**

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ].

Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
77 changes: 77 additions & 0 deletions CODING_CONVENTIONS.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Akeru.ai Coding Conventions

## Introduction

This document outlines the coding standards and best practices for the Akeru.ai project. Adhering to these conventions is essential to maintain code quality, facilitate collaboration, and ensure the project is scalable and maintainable.

## Table of Contents

- [General Principles](#general-principles)
- [Language-Specific Standards](#language-specific-standards)
- [Formatting and Style](#formatting-and-style)
- [Commenting and Documentation](#commenting-and-documentation)
- [Error Handling](#error-handling)
- [Security Practices](#security-practices)
- [Performance Optimization](#performance-optimization)
- [Version Control Practices](#version-control-practices)
- [Testing Standards](#testing-standards)
- [Build and Deployment](#build-and-deployment)

## General Principles

- **Readability and Clarity**: Code should be written as if the next person to read it is a serial killer who knows where you live. Prioritize clarity.
- **Maintainability**: Write code that is easy to maintain and extend. Any developer should be able to understand your code and make changes when necessary.
- **DRY Principle**: Don't Repeat Yourself. Ensure that you don't have duplicate code scattered throughout the codebase.

## Language-Specific Standards

### JavaScript/TypeScript

- Use [ESLint with a configuration based on Next.js](https://nextjs.org/docs/pages/building-your-application/configuring/eslint) standards.
- Follow [TypeScript strict typing](https://www.typescriptlang.org/tsconfig#strict) as much as possible for type safety.

### Python (if applicable)

- Follow [PEP 8 standards](https://peps.python.org/pep-0008/) for Python code.
- Use type hints for better maintainability.

## Formatting and Style

- **Indentation**: Use spaces (not tabs) and set the width to 2 or 4 spaces per indent level, depending on the language.
- **Braces**: Use the "1TBS (One True Brace Style)" where braces open on the same line as the statement but close on a new line.
- **Variable Naming**: Use `camelCase` for identifiers in JavaScript and `snake_case` for Python variables.

## Commenting and Documentation

- **Code Comments**: Write comments that explain "why" something is done, not "what" is done. The code itself should explain "what."
- **Documentation**: Use [JSDoc](https://jsdoc.app/) for JavaScript and [Docstrings](https://peps.python.org/pep-0257/) for Python. Document all public APIs and critical internal mechanisms.

## Error Handling

- **Consistency**: Use a consistent method across the entire codebase to handle errors. In Node.js, use asynchronous error handling with promises and async/await.
- **Logging**: Implement comprehensive logging for errors. Use a library that supports different log levels (e.g., debug, info, error).

## Security Practices

- **Input Validation**: Always validate external inputs to avoid [SQL injections](https://www.simplilearn.com/tutorials/cyber-security-tutorial/what-is-sql-injection) and other malicious attacks.
- **Dependency Management**: Regularly update dependencies to mitigate vulnerabilities, using tools like [Dependabot](https://docs.github.com/en/code-security/getting-started/dependabot-quickstart-guide).

## Performance Optimization

- **Best Practices**: Follow language-specific performance optimization techniques, such as optimizing loops and asynchronous programming in JavaScript.
- **Profiling**: Regularly profile the application and optimize bottlenecks.

## Version Control Practices

- **Branching**: Follow a branching model like [Git Flow](https://github.com/nvie/gitflow) to manage features, fixes, and releases.
- **Commit Messages**: Write clear, concise commit messages that explain the why and what of the changes.

## Testing Standards

- **Coverage**: Aim for a high test coverage percentage. Use tools like [Istanbul](https://istanbul.js.org/) for JavaScript to check coverage.
- **Frameworks**: Use [Jest](https://jestjs.io/) for JavaScript testing. Ensure tests are thorough and cover expected and unexpected use cases.

## Build and Deployment

- **Automated Builds**: Use CI/CD pipelines to automate builds and deployments. Tools like [Jenkins](https://www.jenkins.io/) or [GitHub Actions](https://docs.github.com/en/actions) can be integrated to manage these processes.
- **Environment Specifics**: Ensure configurations such as API keys and endpoints are environment-specific and secured.
93 changes: 93 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Contributing to Akeru.ai

Welcome to the Akeru.ai community! We are thrilled to have you onboard. This document is designed to ensure that your contributions to our open-source AI platform are as smooth and effective as possible.

## Table of Contents

1. [Legal and Licensing](#legal-and-licensing)
2. [Project Overview and Code of Conduct](#project-overview-and-code-of-conduct)
3. [Getting Started](#getting-started)
4. [Contribution Process](#contribution-process)
5. [Coding Conventions](#coding-conventions)
6. [Building and Testing](#building-and-testing)
7. [Documentation Standards](#documentation-standards)
8. [Handling Issues and Pull Requests](#handling-issues-and-pull-requests)
9. [Community and Communication](#community-and-communication)
10. [Recognition and Rewards](#recognition-and-rewards)
11. [Accessibility Guidelines](#accessibility-guidelines)
12. [Internationalization](#internationalization)
13. [Security Practices](#security-practices)

### Legal and Licensing

[Akeru.ai](https://www.akeru.ai) is released under the MIT License. It is important to understand how this affects your contributions. Read the full license [here](https://opensource.org/licenses/MIT).

### Project Overview and Code of Conduct

[Akeru.ai](https://www.akeru.ai) leverages the power of the Akeru AI edge network running on a Bittensor Subnet to offer transparent, safe, and highly available AI capabilities. We strive to maintain a welcoming and inclusive community.

Our [Code of Conduct](/CODE_OF_CONDUCT.md) outlines expected behavior and practices to ensure a collaborative and respectful environment.

### Getting Started

Setting up your development environment is the first step in contributing:

- **Subnet Setup Guide**: For working with the subnet, follow the instructions [here](https://github.com/GuiBibeau/akeru/blob/main/subnet/validator/README.md).

- **Platform Setup Guide**: Additional setup instructions for the platform will be provided soon.

### Contribution Process

To contribute to [Akeru.ai](https://www.akeru.ai):

1. **Fork the repository** on GitHub.
2. **Clone your fork** to your local machine (`git clone url`).
3. **Create a branch** for your changes (`git checkout -b feature-branch-name`).
4. **Make your changes** and commit them (`git commit -am 'Add some feature'`).
5. **Push your branch** to your fork (`git push origin feature-branch-name`).
6. **Create a pull request** against our main branch.

### Coding Conventions

[Akeru.ai](https://www.akeru.ai) follows Next.js linting standards in the Next app and plans to setup ESLint for the API and service mesh parts. For coding styles, we use Prettier. Our Prettier config will serve as the source of truth. View the full coding convention [here](/CODING_CONVENTIONS.MD).

### Building and Testing

- **Website**: Automated by Vercel.
- **API**: Currently under development for automated processes.
- **Subnet**: Managed externally; details to be provided later.

### Documentation Standards

All contributions should include relevant documentation updates:

- **Formatting Guidelines**: Follow our documentation style guide [here](/DOCUMENTATION_STYLE_GUIDE.MD).
- **Where to Add Documentation**: Add to `/docs` or inline as appropriate.

### Handling Issues and Pull Requests

- **Reporting Issues**: Use our template [here](/ISSUES_TEMPLATE.md). Ensure to include the detailed steps to reproduce the issue.
- **Pull Requests**: Use our PR template, link related issues, and provide a detailed description of your changes. Check that out [here](/PULL_REQUEST_DOC_TEMPLATE.md)

### Community and Communication

Join the conversation on [Discord] and stay updated:

- **Main Channels**: [Links to communication platforms]
- **Communication Norms**: Engage respectfully and frequently to collaborate effectively.

### Recognition and Rewards

Details on contributor recognition and rewards are currently being developed.

### Accessibility Guidelines

We are committed to making our project accessible and plan to enhance this by adding specific linting rules. Current Next.js accessibility rules are a good baseline.

### Internationalization

Plans are in development and will be documented accordingly.

### Security Practices

Detailed security protocols, especially for the subnet, are currently under development and will be added upon completion.
68 changes: 68 additions & 0 deletions DOCUMENTATION_STYLE_GUIDE.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Akeru.ai Documentation Style Guide

## Introduction

This guide establishes standards for creating clear, accessible, and effective documentation for the Akeru.ai project. It ensures consistency and quality across all documentation to aid both contributors and end-users.

## Table of Contents

1. [Purpose and Audience](#purpose-and-audience)
2. [Tone and Style](#tone-and-style)
3. [Document Structure](#document-structure)
4. [Writing Guidelines](#writing-guidelines)
5. [Formatting](#formatting)
6. [Language and Grammar](#language-and-grammar)
7. [Technical Content](#technical-content)
8. [Visual Content](#visual-content)
9. [Review Process](#review-process)
10. [Feedback and Updates](#feedback-and-updates)

### Purpose and Audience

- **Purpose**: Define the purpose of each document type, whether for API usage, setup instructions, or end-user operations.
- **Audience**: Identify the primary and secondary audiences, and tailor content to their technical level and needs.

### Tone and Style

- **Tone**: Use a professional, engaging tone. Opt for the active voice and present tense to keep the documentation lively and readable.
- **Inclusivity**: Ensure language is inclusive and accessible, avoiding jargon and providing explanations for technical terms.

### Document Structure

- **Headers**: Use headers to logically organize information. Begin with an introduction, follow with detailed content, and conclude with a summary or call to action.
- **Navigation**: Include a clickable table of contents in longer documents for easy navigation.

### Writing Guidelines

- **Clarity and Brevity**: Aim for concise explanations. Avoid redundant words and focus on clear, direct communication.
- **Consistency**: Use consistent terminology throughout your documentation to avoid confusion.

### Formatting

- **Highlighting Techniques**: Utilize **bold** for key terms, *italics* for emphasis, and `code` for inline code references.
- **Lists and Bullet Points**: Use bullet points for unordered lists and numbered lists for sequences or instructions.

### Language and Grammar

- **Grammar and Spelling**: Utilize tools like [Grammarly](https://www.grammarly.com/) and [Hemingway Editor](http://www.hemingwayapp.com/) to ensure correctness. Adhere to American English spelling conventions.
- **Examples and Tutorials**: Provide clear examples and detailed tutorials. Use [link to a style guide](#) for complex topics.

### Technical Content

- **Code Examples**: Include fully tested code examples to illustrate technical explanations. Ensure they adhere to the project's coding conventions.
- **API Documentation**: Clearly detail parameters, methods, and example requests and responses for API calls.

### Visual Content

- **Screenshots and Diagrams**: Ensure screenshots are current and clearly annotated. Use diagrams to explain complex processes; tools like [Lucidchart](https://www.lucidchart.com/) or [Draw.io](https://draw.io/) can be helpful.

### Review Process

- **Peer Review**: Documentation should undergo peer review to catch errors and ensure it meets quality standards.
- **Iterative Reviews**: Regularly scheduled reviews of documentation to update and refine content.

### Feedback and Updates

- **Feedback Mechanism**: Implement a system for collecting feedback on documentation, such as a feedback form linked at the end of each document.
- **Regular Updates**: Establish a routine for regularly updating documents to reflect changes in the software and feedback from users.

Loading
Loading