Skip to content

Latest commit

 

History

History
74 lines (56 loc) · 1.34 KB

DOCS.md

File metadata and controls

74 lines (56 loc) · 1.34 KB

Documentation

✅ First Setup

  1. Initialise project

    poetry install
    
  2. All command after this need to be executed inside poetry shell

    poetry shell
    
  3. Install pre-commit hooks

    pre-commit install --install-hooks
    
  4. Vscode workspace setting with Pylance extension

    {
        "python.defaultInterpreterPath": "/home/*/.cache/pypoetry/virtualenvs/rest-template-***/"
    }
    

🏃‍♂️ Running

  • Development mode
    ./start.sh
    

📦 Packages

  • Add new python package into project

    poetry add <package>
    

    Poetry tend to upgrade unrelated package and its takes a long time to resolve. To avoid it when add/upgrade single package, change the pyproject.toml manually and then execute:

    poetry lock --no-update
    poetry install
    

⏭ Migrations

  • Migration history
    alembic history
    
  • Migrate to latest
    alembic upgrade head
    
  • Reset migration
    alembic downgrade base
    

🌲 File Hierarchy

To avoid circular dependencies, here's a guide line of the file hierarchy:

  • /config.py
  • /utils.py
  • /database.py ; /models.py ; /schemas/*
  • /services/*
  • /routers/* ; /middlewares/*