Repository: gothinkster/node-express-prisma-v1-official-app Branch: main Commit: 6ac99ea5aead Files: 52 Total size: 108.0 KB Directory structure: gitextract_bhrnvjgz/ ├── .eslintrc.json ├── .github/ │ ├── dependabot.yml │ └── workflows/ │ └── ci.yaml ├── .gitignore ├── .husky/ │ ├── .gitignore │ └── pre-commit ├── .prettierignore ├── .prettierrc.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Procfile ├── README.md ├── app.json ├── docs/ │ └── swagger.json ├── jest.config.js ├── package.json ├── prisma/ │ ├── migrations/ │ │ ├── 20210924222830_initial/ │ │ │ └── migration.sql │ │ ├── 20211001195651_implicit_articles/ │ │ │ └── migration.sql │ │ ├── 20211105082430_api_url/ │ │ │ └── migration.sql │ │ └── migration_lock.toml │ ├── prisma-client.ts │ └── schema.prisma ├── src/ │ ├── controllers/ │ │ ├── article.controller.ts │ │ ├── auth.controller.ts │ │ ├── profile.controller.ts │ │ └── tag.controller.ts │ ├── index.ts │ ├── models/ │ │ ├── article.model.ts │ │ ├── comment.model.ts │ │ ├── http-exception.model.ts │ │ ├── profile.model.ts │ │ ├── register-input.model.ts │ │ ├── registered-user.model.ts │ │ ├── tag.model.ts │ │ └── user.model.ts │ ├── routes/ │ │ └── routes.ts │ ├── services/ │ │ ├── article.service.ts │ │ ├── auth.service.ts │ │ ├── profile.service.ts │ │ └── tag.service.ts │ └── utils/ │ ├── auth.ts │ ├── profile.utils.ts │ ├── token.utils.ts │ └── user-request.d.ts ├── tests/ │ ├── prisma-mock.ts │ ├── services/ │ │ ├── article.service.test.ts │ │ ├── auth.service.test.ts │ │ ├── profile.service.test.ts │ │ └── tag.service.test.ts │ └── utils/ │ └── profile.utils.test.ts └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .eslintrc.json ================================================ { "env": { "browser": true, "es2021": true, "jest": true }, "extends": ["airbnb-base", "prettier"], "globals": { "NodeJS": true }, "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 12, "sourceType": "module" }, "plugins": ["@typescript-eslint"], "rules": { "import/extensions": [ "error", "ignorePackages", { "ts": "never" } ], "no-underscore-dangle": ["error", { "allow": ["_count"] }], "no-console": ["error", { "allow": ["info"] }], "import/no-extraneous-dependencies": ["error", { "devDependencies": ["tests/prisma-mock.ts"] }] }, "settings": { "import/resolver": { "node": { "paths": ["src"], "extensions": [".js", ".ts", ".d.ts", ".tsx"] } } }, "ignorePatterns": ["*.d.ts"] } ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: github-actions directory: '/' schedule: interval: weekly open-pull-requests-limit: 10 - package-ecosystem: npm directory: '/' schedule: interval: weekly open-pull-requests-limit: 10 ================================================ FILE: .github/workflows/ci.yaml ================================================ name: CI on: push: branches: [main] pull_request: branches: - '**' jobs: run_tests: runs-on: ubuntu-latest strategy: matrix: node-version: [12.x] steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: '12' - name: Cache node modules uses: actions/cache@v2 env: cache-name: cache-node-modules with: path: ~/.npm key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - name: Install dependencies run: npm ci --no-audit --prefer-offline --progress=false - name: Check prettier run: npm run prettier:check - name: Check ESLinter run: npm run lint:check - name: Check unit tests run: npm run test --ci --lastCommit --maxWorkers=50% env: CI: true ================================================ FILE: .gitignore ================================================ /node_modules /dist # Keep environment variables out of version control .env # IDEs and editors /.idea .project .classpath .c9/ *.launch .settings/ *.sublime-workspace # IDE - VSCode .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json .history/* ================================================ FILE: .husky/.gitignore ================================================ _ ================================================ FILE: .husky/pre-commit ================================================ #!/bin/sh . "$(dirname "$0")/_/husky.sh" npx lint-staged ================================================ FILE: .prettierignore ================================================ /dist ================================================ FILE: .prettierrc.json ================================================ { "printWidth": 100, "singleQuote": true, "trailingComma": "all", "bracketSpacing": true, "arrowParens": "avoid" } ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant 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, 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 community in public spaces. Examples of representing our community include using an official 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 to the community leaders responsible for enforcement at hello@thinkster.io. 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.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing to RealWorld We would love for you to contribute to RealWorld and help make it even better than it is today! As a contributor, here are the guidelines we would like you to follow: - [Code of Conduct](#coc) - [Question or Problem?](#question) - [Issues and Bugs](#issue) - [Feature Requests](#feature) - [Submission Guidelines](#submit) - [Coding Rules](#rules) - [Commit Message Guidelines](#commit) ## Code of Conduct Help us keep RealWorld open and inclusive. Please read and follow our [Code of Conduct][coc]. ## Got a Question or Problem? Do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. For open discussions, we encourage you to use the [Github Discussions][github-discussions] channels of the RealWorld repository. ## Found a Bug? If you find a bug in the project, you can help us by [submitting an issue][github-issue] to our [GitHub Repository][github]. Even better, you can [submit a Pull Request](#submit-pr) with a fix. ## Missing a Feature? This repository follows the RealWorld [specs][github-spec]. Please open feature requests on the RealWorld [repository][github-feature]. ## Submission Guidelines ### Submitting an Issue Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of workarounds readily available. You can file new issues by selecting from our [new issue templates][github-choose] and filling out the issue template. ### Submitting a Pull Request (PR) Before you submit your Pull Request (PR) consider the following guidelines: 1. Search [GitHub](https://github.com/gothinkster/node-express-prisma-v1-official-app/pulls) for an open or closed PR that relates to your submission. You don't want to duplicate effort. 1. Be sure that an issue describes the problem you're fixing, or documents the design for the feature you'd like to add. Discussing the design up front helps to ensure that we're ready to accept your work. 1. Fork the gothinkster/realworld repo. 1. Make your changes in a new git branch: ```bash git checkout -b my-fix-branch main ``` 1. Create your patch. 1. Commit your changes using a descriptive commit message that follows our [commit message conventions](#commit). 1. Push your branch to GitHub: ```bash git push origin my-fix-branch ``` 1. In GitHub, send a pull request to `node-express-prisma-v1-official-app:main`. - If we suggest changes then: - Make the required updates. - Rebase your branch and force push to your GitHub repository (this will update your Pull Request): ```bash git rebase main -i git push -f ``` That's it! Thank you for your contribution! #### After your pull request is merged After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository: - Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: ```bash git push origin --delete my-fix-branch ``` - Check out the main branch: ```bash git checkout main -f ``` - Delete the local branch: ```bash git branch -D my-fix-branch ``` - Update your main with the latest upstream version: ```bash git pull --ff upstream main ``` ## Commit Message Guidelines > These guidelines have been added to the project starting from We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**. ### Commit Message Format Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject**: ``` ():