backend

Contributing to Template

Thank you for considering contributing to this project! We appreciate your help in improving and expanding the project.

To ensure a smooth contribution process, please read the following guidelines before contributing.


Table of Contents

How to Contribute

Reporting Bugs or Requesting Features

If you find a bug or want to request a feature, feel free to open an issue on GitHub. Before creating a new issue, please check to ensure it hasn’t been reported already.

  1. Navigate to the Issues section of the repository.
  2. Click New Issue.
  3. Provide as much detail as possible, including steps to reproduce (for bugs) or a clear description of the feature you want (for feature requests).

Submitting Code Changes

If you are looking to contribute code, please follow these steps:

  1. Fork the repository: Click the “Fork” button at the top-right of the repository page.
  2. Create a new branch:
    git checkout -b your-branch-name
    
  3. Make your changes: Add features or fix bugs.
  4. Test your changes: Ensure that all tests pass before submitting a pull request.
  5. Submit a pull request: Push your changes to your fork and open a pull request to the main branch of this repository.

Code of Conduct

We are committed to fostering a welcoming, respectful, and collaborative environment for everyone. Please follow our Code of Conduct.


Types of Contributions

Bug Fixes

If you notice a bug or issue with the project, feel free to submit a bug report or even fix the bug yourself. Always check the open issues to see if someone else is already working on it.

New Features

We’re always open to new ideas! If you have a feature in mind, please open an issue to discuss it before creating a pull request. This ensures that your effort aligns with the project’s direction and isn’t duplicated.

Documentation

Contributions to documentation are highly valued. Whether it’s improving existing documentation, adding missing pieces, or creating new tutorials, your contributions will help others understand and use the project better.


Here’s the updated section for your CONTRIBUTING.md file, reflecting the technologies used in your project:


Getting Started

Prerequisites

Ensure you have the following installed before starting:

Setting Up the Project Locally

  1. Clone the repository:
    git clone https://github.com/issamshadid/backend.git
    cd backend
    
  2. Install dependencies: Restore the necessary .NET and Entity Framework dependencies:
    dotnet restore
    
  3. Set up the database: Ensure that your connection string in the appsettings.json file points to your SQL Server instance. Run migrations to set up the database schema:
    dotnet ef database update
    
  4. Run the project: Start the application:
    dotnet run
    

This will guide your contributors through the necessary setup steps, including ensuring they have the correct versions of .NET, Entity Framework, and SQL Server. Let me know if you need further adjustments!


How to Submit Changes

Commit Message Guidelines

Please write meaningful commit messages that describe the reason for the change. Use the following format for your commits:

Example:

feat(auth): add login functionality with OAuth support

To maintain high code quality and ensure that contributions to your .NET project align with the project’s goals, it’s important to have clear Pull Request (PR) Guidelines. Here’s a customized Pull Request Guidelines section for your .NET Core 8 project using Entity Framework and SQL Server:


Pull Request Guidelines

When submitting a pull request to the project, please follow these guidelines to ensure a smooth review and integration process.

1. Create a Separate Branch

Ensure that your work is done in a separate branch. This keeps the main or master branch clean and makes it easier to review changes.

2. Check for Code Style Consistency

Follow the code style and conventions used in the project. Here are some common guidelines:

3. Run Static Code Analysis (Optional)

If your project uses static code analysis tools like StyleCop, Roslyn Analyzers, or SonarQube, make sure to run the analysis before submitting the PR to ensure that there are no style violations or critical issues.

Example:

dotnet build

4. Database Changes (Migrations)

If your changes include database modifications (via Entity Framework Migrations):

5. Commit Message Format

Ensure that your commit messages are clear and descriptive. Use the following format for your commit messages:

Example:

feat(api): add user authentication with JWT
fix(db): resolve issue with foreign key constraints in User table

6. Resolve Merge Conflicts

If there are any merge conflicts with the main or master branch, resolve them locally before submitting the pull request.

  1. Pull the latest changes from main:
    git checkout main
    git pull origin main
    
  2. Switch back to your branch and rebase:
    git checkout your-branch-name
    git rebase main
    

7. Pull Request Description

In the pull request description, make sure to include:

8. Limit the Scope of the PR

Each pull request should focus on a single issue or feature. Avoid submitting “mega-PRs” with multiple unrelated changes, as these are difficult to review.

9. Code Review Process

After submitting the PR:

10. Follow-Up on the Review

If requested, update your pull request based on feedback and push changes toyour branch. You can update your pull request by simply pushing new commits to the same branch.

  1. Make the requested changes on your local branch.
  2. Push the updates to your remote branch:
    git push origin your-branch-name
    
  3. Once all feedback has been addressed and the changes are approved, the PR will be merged into the main branch.

By following these Pull Request Guidelines, you help ensure that the project maintains high-quality code and that contributions are easy to review and integrate. Thank you for your contribution!


Here’s a detailed Style Guidelines section for your .NET Core project, including Code Style conventions. These guidelines will help contributors maintain consistent code formatting and structure throughout the project.


Style Guidelines

Code Style

To ensure a clean and readable codebase, please follow the code style guidelines below when contributing to the project.

1. Indentation

2. Brace Style

3. Variable Naming

4. Method and Function Naming

5. Class and Interface Naming

6. Comments

7. Spacing and Readability

8. Line Length

9. Constants

10. LINQ Queries

11. Dependency Injection

12. Async/Await Best Practices

13. Properties

14. Null Checking


Automated Code Style Checks

If applicable, run automated style checks before submitting your pull request:


By adhering to these style guidelines, we can maintain a consistent and clean codebase, making it easier for everyone to contribute, read, and maintain the code.


Code Reviews

All pull requests will be reviewed by a project maintainer before merging. Be prepared to make adjustments based on feedback, and try to respond to review comments in a timely manner.


Reporting Issues

When submitting an issue, please include as much detail as possible:

Security Vulnerabilities

If you discover a security vulnerability, please do not open a public issue. Instead, report it privately by contacting the project maintainers at [shadeed.1990@gmail.com].