From fa0c87738df2446fe45bc7af63783079a3657904 Mon Sep 17 00:00:00 2001 From: Daniel Jancar Date: Sat, 20 Jul 2024 13:47:59 +0200 Subject: [PATCH] chore: add contribution docs and move api endpoints into subfolder --- .github/CODE_OF_CONDUCT.md | 39 +++++++++ .github/CONTRIBUTING.md | 81 +++++++++++++++++++ .github/DCO.md | 36 +++++++++ .github/ISSUE_TEMPLATE.md | 37 +++++++++ .github/PULL_REQUEST_TEMPLATE.md | 22 +++++ .github/SECURITY.md | 19 +++++ .../app/{ => api}/casts/cast.controller.ts | 0 .../src/app/{ => api}/casts/cast.module.ts | 0 .../src/app/{ => api}/casts/cast.service.ts | 0 .../{ => api}/casts/dto/create-cast.dto.ts | 0 .../{ => api}/casts/schemas/casts.schema.ts | 0 .../{ => api}/votes/dto/create-vote.dto.ts | 0 .../{ => api}/votes/schemas/vote.schema.ts | 0 .../app/{ => api}/votes/votes.controller.ts | 0 .../src/app/{ => api}/votes/votes.module.ts | 0 .../src/app/{ => api}/votes/votes.service.ts | 0 apps/backend/src/app/app.module.ts | 4 +- 17 files changed, 236 insertions(+), 2 deletions(-) create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/DCO.md create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/SECURITY.md rename apps/backend/src/app/{ => api}/casts/cast.controller.ts (100%) rename apps/backend/src/app/{ => api}/casts/cast.module.ts (100%) rename apps/backend/src/app/{ => api}/casts/cast.service.ts (100%) rename apps/backend/src/app/{ => api}/casts/dto/create-cast.dto.ts (100%) rename apps/backend/src/app/{ => api}/casts/schemas/casts.schema.ts (100%) rename apps/backend/src/app/{ => api}/votes/dto/create-vote.dto.ts (100%) rename apps/backend/src/app/{ => api}/votes/schemas/vote.schema.ts (100%) rename apps/backend/src/app/{ => api}/votes/votes.controller.ts (100%) rename apps/backend/src/app/{ => api}/votes/votes.module.ts (100%) rename apps/backend/src/app/{ => api}/votes/votes.service.ts (100%) diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..941297a --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,39 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail 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 by contacting the project team at [your email]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4. diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..9c84a6e --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,81 @@ +# Contributing to VoteVault + +Thank you for your interest in contributing to VoteVault. To ensure a smooth contribution process and maintain the quality +of our codebase, we have set specific guidelines, especially for commit messages and versioning. + +## Semantic Release and Commit Message Guidelines + +We use semantic release for automated version management and changelog generation. This requires commit messages to +adhere to a specific format, enabling the automatic determination of version numbers and the generation of meaningful +changelogs. + +### Commit Message Format + +Every commit message should be structured as follows: + +1. **Type**: This describes the nature of the change. Common types include: + + - `feat` (new feature) + - `fix` (bug fix) + - `docs` (changes in documentation) + - `style` (formatting, missing semi colons, etc; no code change) + - `refactor` (refactoring production code) + - `test` (adding tests, refactoring tests; no production code change) + - `chore` (updating build tasks, package manager configs, etc; no production code change) + +2. **Scope** (optional): This refers to the part of the codebase affected by the change: + + - `frontend` + - `backend` + - `architecture` + - `documentation` + - `Other` + +3. **Subject**: A brief description of the change, in the imperative mood. + +4. **Body** (optional): A more detailed explanation of the changes. This is where you should explain the reasoning + behind the changes if necessary. + +5. **Footer** (optional): This should contain any information about Breaking Changes and is also the place to reference + GitHub issues that this commit closes. + +Example: + +``` +feat: add new login page + +This commit adds a new login page to the application, allowing users to log in to their accounts. + +BREAKING CHANGE: Users can no longer log in using their email address. Instead, they have to use their username. +``` + +### Commit Message Conventions + +- 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 liberally after the first line + +## Pull Requests + +1. **Squashing Commits**: Before submitting a PR, squash your commits into a single commit with a meaningful commit + message as per the above guidelines. + +2. **Pull Request Description**: Provide a clear description in your PR. Link the PR to any relevant issues. + +3. **Review and Merge**: Once a PR is submitted, the maintainers will review it. If all criteria are met, it will be + merged into the main codebase. + +## Reporting Issues + +- **Check for Existing Issues**: Before creating a new issue, make sure it hasn't been reported already. +- **Use Descriptive Titles**: Issue titles should be concise yet descriptive. +- **Detail in Comments**: Include details about the issue, steps to reproduce, expected behavior, screenshots, etc. + +## Labels in Issues + +- **Categorize with Labels**: Use appropriate labels like `bug`, `feature`, `documentation`, `help wanted` to help + categorize and prioritize the issue. + +Your contributions are vital to keeping VoteVault robust and reliable. By following these guidelines, we can ensure a +smooth and efficient development process. Thank you for your contributions! diff --git a/.github/DCO.md b/.github/DCO.md new file mode 100644 index 0000000..7f32c07 --- /dev/null +++ b/.github/DCO.md @@ -0,0 +1,36 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I +have the right to submit it under the open source license +indicated in the file; or + +(b) The contribution is based upon previous work that, to the best +of my knowledge, is covered under an appropriate open source +license and I have the right under that license to submit that +work with modifications, whether created in whole or in part +by me, under the same open source license (unless I am +permitted to submit under a different license), as indicated +in the file; or + +(c) The contribution was provided directly to me by some other +person who certified (a), (b) or (c) and I have not modified +it. + +(d) I understand and agree that this project and the contribution +are public and that a record of the contribution (including all +personal information I submit with it, including my sign-off) is +maintained indefinitely and may be redistributed consistent with +this project or the open source license(s) involved. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..33c84b9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,37 @@ +## Description + +### Package + +- [ ] `frontend` +- [ ] `backend` +- [ ] `architecture` +- [ ] `documentation` +- [ ] `Other` + + + +## Expected Behavior + + + +## Actual Behavior + + + +## Possible Fix + + + +## Steps to Reproduce + + + + +1. +2. +3. +4. + +# Additional Information + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ab73c9e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,22 @@ +## Types of changes + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) + +## Checklist: + +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. +- [ ] I have read the **CONTRIBUTING** and other relevant documents. + +## Description + + + +## Screenshots (if appropriate): + +## Additional context: + + diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..0ef2ffc --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,19 @@ +# Security Policy + +## Reporting a Vulnerability + +Your contributions to the security of VoteVault are greatly appreciated. If you've discovered a security vulnerability within the project, please follow these steps: + +1. **Do Not Publicly Disclose**: Please do not disclose the vulnerability publicly until it has been handled properly. +2. **Contact Us**: Send a detailed report to [dan_jan1@icloud.com](mailto:dan_jan1@icloud.com). Include the steps to reproduce the vulnerability and any other relevant information. +3. **Wait for Response**: We'll review your report and contact you for further discussion. Please allow a reasonable amount of time for us to respond. + +## Handling Security Reports + +Once a report is received: + +1. We will confirm receipt and start investigating the issue. +2. A fix will be developed and tested. We may reach out to you for further information or clarification. +3. Once the fix is confirmed, it will be released, and users will be advised to update their installations. + +We appreciate your efforts to responsibly disclose your findings and will make every effort to acknowledge your contributions. diff --git a/apps/backend/src/app/casts/cast.controller.ts b/apps/backend/src/app/api/casts/cast.controller.ts similarity index 100% rename from apps/backend/src/app/casts/cast.controller.ts rename to apps/backend/src/app/api/casts/cast.controller.ts diff --git a/apps/backend/src/app/casts/cast.module.ts b/apps/backend/src/app/api/casts/cast.module.ts similarity index 100% rename from apps/backend/src/app/casts/cast.module.ts rename to apps/backend/src/app/api/casts/cast.module.ts diff --git a/apps/backend/src/app/casts/cast.service.ts b/apps/backend/src/app/api/casts/cast.service.ts similarity index 100% rename from apps/backend/src/app/casts/cast.service.ts rename to apps/backend/src/app/api/casts/cast.service.ts diff --git a/apps/backend/src/app/casts/dto/create-cast.dto.ts b/apps/backend/src/app/api/casts/dto/create-cast.dto.ts similarity index 100% rename from apps/backend/src/app/casts/dto/create-cast.dto.ts rename to apps/backend/src/app/api/casts/dto/create-cast.dto.ts diff --git a/apps/backend/src/app/casts/schemas/casts.schema.ts b/apps/backend/src/app/api/casts/schemas/casts.schema.ts similarity index 100% rename from apps/backend/src/app/casts/schemas/casts.schema.ts rename to apps/backend/src/app/api/casts/schemas/casts.schema.ts diff --git a/apps/backend/src/app/votes/dto/create-vote.dto.ts b/apps/backend/src/app/api/votes/dto/create-vote.dto.ts similarity index 100% rename from apps/backend/src/app/votes/dto/create-vote.dto.ts rename to apps/backend/src/app/api/votes/dto/create-vote.dto.ts diff --git a/apps/backend/src/app/votes/schemas/vote.schema.ts b/apps/backend/src/app/api/votes/schemas/vote.schema.ts similarity index 100% rename from apps/backend/src/app/votes/schemas/vote.schema.ts rename to apps/backend/src/app/api/votes/schemas/vote.schema.ts diff --git a/apps/backend/src/app/votes/votes.controller.ts b/apps/backend/src/app/api/votes/votes.controller.ts similarity index 100% rename from apps/backend/src/app/votes/votes.controller.ts rename to apps/backend/src/app/api/votes/votes.controller.ts diff --git a/apps/backend/src/app/votes/votes.module.ts b/apps/backend/src/app/api/votes/votes.module.ts similarity index 100% rename from apps/backend/src/app/votes/votes.module.ts rename to apps/backend/src/app/api/votes/votes.module.ts diff --git a/apps/backend/src/app/votes/votes.service.ts b/apps/backend/src/app/api/votes/votes.service.ts similarity index 100% rename from apps/backend/src/app/votes/votes.service.ts rename to apps/backend/src/app/api/votes/votes.service.ts diff --git a/apps/backend/src/app/app.module.ts b/apps/backend/src/app/app.module.ts index 9037510..381d1e7 100644 --- a/apps/backend/src/app/app.module.ts +++ b/apps/backend/src/app/app.module.ts @@ -4,8 +4,8 @@ import {AppController} from './app.controller'; import {AppService} from './app.service'; import {ConfigModule, ConfigService} from "@nestjs/config"; import {MongooseModule} from "@nestjs/mongoose"; -import {VotesModule} from "./votes/votes.module"; -import {CastModule} from "./casts/cast.module"; +import {VotesModule} from "./api/votes/votes.module"; +import {CastModule} from "./api/casts/cast.module"; @Module({ imports: [