Files
fastapi_best_architecture/backend
Wu Clan 2b56168ad0 Refactor foreign keys and relationships to pure logic (#901)
* Refactor foreign keys and relationships to pure logic

* Revert of some changes

* More revert

* Update the user paginate

* Update user create and update

* Update dept select and delete

* Rename the join query functions

* Update select_join_serialize doc and README

* Fix typo in README

* Update the user delete

* Update the user social

* Update the dict plugin crud

* Update the dict plugin version

* Bump dependencies and pre-commits

* Update the code generator plugin crud

* Update the menu crud

* Update the role crud

* Update the data scope and rule crud

* Restore get_paginated to get_select

* Update the code generator plugin version

* Add the py version in pre-commit

* Remove the plugin include parameter config

* Add more cache cleaning TODO

* Rename get_with_relation to get_join

* Add the user cache clear

* Fix known compatibility issues

* Update the version number to 1.11.0

* Fix lint

* Optimize select_join_serialize logic

* Delete cache cleanup comments

* Update the oauth2 plugin version

* Fix user-role table cleanup when user update
2025-11-12 13:06:26 +08:00
..
2025-10-17 13:02:28 +08:00

FastAPI Best Architecture - Backend

Docker

  1. Make sure you're at the root of the project

  2. Run the following Docker command to build container:

    docker build -f Dockerfile -t fba_backend_independent .
    
  3. Start container

    Native boot needs to change 127.0.0.1 in .env to host.docker.internal

    docker run -d -p 8000:8000 --name fba_server fba_backend_independent
    

Contributing

  1. Prerequisites

    • Python >= 3.10
    • Git
    • uv
    • Fork this repository to your GitHub account
  2. Installation and setup

    Clone your forked repository:

    git clone https://github.com/<your account>/fastapi_best_architecture.git
    

    Go to the root directory of the project, open the terminal, and run the following command:

    uv sync --frozen
    
  3. Checkout

    Checkout a new branch and make your changes

    git checkout -b your-new-feature-branch
    
  4. Format and Lint

    Auto-formatting and lint via prek

    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

  • celery-start.sh: For celery docker script, implementation is not recommended

  • scripts/format.sh: Perform ruff format check

  • scripts/lint.sh: Perform prek formatting

  • scripts/export.sh: Execute uv export dependency package