From 7dcbdc5b86749db404410552562bd57386b72f78 Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Fri, 19 Dec 2025 15:17:45 +0800 Subject: [PATCH] Add an independent contribution document --- CONTRIBUTING.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++ backend/README.md | 63 ----------------------------------------------- 2 files changed, 62 insertions(+), 63 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..a40fe1de --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,62 @@ +## Backend + +1. Prerequisites + + - Python >= 3.10 + - Git + - [uv](https://docs.astral.sh/uv/getting-started/installation/) + - Fork this repository to your GitHub account + +2. Installation and setup + + Clone your forked repository: + + ```shell + git clone https://github.com//fastapi_best_architecture.git + ``` + + Go to the root directory of the project, open the terminal, and run the following command: + + ```sh + uv sync + ``` + +3. Checkout + + Checkout a new branch and make your changes + + ```shell + git checkout -b your-new-feature-branch + ``` + +4. Format and Lint + + Auto-formatting and lint via `prek` + + ```shell + prek run --all-files + ``` + +5. Commit and push + + Commit your changes and push your branch to the GitHub. + +6. PR + + Create a PR via GitHub + +## Scripts + +> [!WARNING] +> +> The following script may not apply to the Windows platform +> +> It is recommended to execute under the backend directory, and chmod authorization may be required + +- `migrate.sh`: Perform automatic database migration + +- `scripts/format.sh`: Perform ruff format check + +- `scripts/lint.sh`: Perform prek formatting + +- `scripts/export.sh`: Execute uv export dependency package diff --git a/backend/README.md b/backend/README.md index 3f14c192..2541ae7a 100644 --- a/backend/README.md +++ b/backend/README.md @@ -16,66 +16,3 @@ ```shell docker run -d -p 8000:8000 --name fba_server fba_backend_independent ``` - -## Contributing - -1. Prerequisites - - - Python >= 3.10 - - Git - - [uv](https://docs.astral.sh/uv/getting-started/installation/) - - Fork this repository to your GitHub account - -2. Installation and setup - - Clone your forked repository: - - ```shell - git clone https://github.com//fastapi_best_architecture.git - ``` - - Go to the root directory of the project, open the terminal, and run the following command: - - ```sh - uv sync --frozen - ``` - -3. Checkout - - Checkout a new branch and make your changes - - ```shell - git checkout -b your-new-feature-branch - ``` - -4. Format and Lint - - Auto-formatting and lint via `prek` - - ```shell - prek run --all-files - ``` - -5. Commit and push - - Commit your changes and push your branch to the GitHub. - -6. PR - - Create a PR via GitHub - -## Scripts - -> [!WARNING] -> -> The following script may not apply to the Windows platform -> -> It is recommended to execute under the backend directory, and chmod authorization may be required - -- `pre_start.sh`: Perform automatic database migration - -- `scripts/format.sh`: Perform ruff format check - -- `scripts/lint.sh`: Perform prek formatting - -- `scripts/export.sh`: Execute uv export dependency package