Skip to content

ddnthemc/basic-fastapi-reportlab

Repository files navigation

Basic Fastapi ReportLab

Basic Skeleton of a simple backend server for educational purposes.

  • built using Fastapi.
  • PDF generation using Reportlab

🚀 Quick Start

This project uses uv for extremely fast, reliable Python package management. You don't need to manually create virtual environments.

Prerequisites

Install uv if you haven't already:

  • macOS/LinuxBoxes (bash):

    curl -LsSf [https://astral.sh/uv/install.sh](https://astral.sh/uv/install.sh) | sh
  • Windows (PowerShell):

    powershell -c "irm [https://astral.sh/uv/install.ps1](https://astral.sh/uv/install.ps1) | iex"

    Note: After installing on Windows, you may need to restart your terminal (or PyCharm's terminal) for the uv command to be recognized.

    Why the Windows command looks like that

    If your users ask or if you're curious, here is what that command is actually doing:

    • powershell -c: Tells the system to run the following string as a PowerShell command.
    • irm (Invoke-RestMethod): Downloads the installation script from the astral.sh URL.
    • iex (Invoke-Expression): Executes the script it just downloaded to handle the actual setup on the user's machine.

    One Last PyCharm Tip for Windows

    If you or your users are using the terminal inside PyCharm on Windows, sometimes it defaults to the old cmd.exe.

    To make it work better with uv, go to Settings > Tools > Terminal and ensure the Shell path is set to powershell.exe.


Working with PyCharm

If you prefer using PyCharm's visual interface over the command line, follow these steps:

  1. Clone the Project:

    • Open PyCharm and select Get from Version Control (Go to File > Project from Version Control).
    • Paste the GitHub URL and click Clone.
  2. Set up the Interpreter (uv):

    • Once the project opens, PyCharm should detect the pyproject.toml file.
    • Go to Settings (Ctrl+Alt+S) > Project > Python Interpreter.
    • Click Add Interpreter > Add Local Interpreter...
    • Select uv Environment from the left sidebar. *PyCharm will automatically find your uv executable and create the virtual environment based on the uv.lock file.
  3. Install Dependencies:

    • If PyCharm shows a gold bar at the top saying "Packages listed in pyproject.toml are not installed," simply click Install requirements.
    • Alternatively, PyCharm will run uv sync automatically when you set the interpreter.
  4. Run the Code: Right-click your app.py (or your entry point) and select Run 'main'.

Note:

Because we use uv.lock, PyCharm will configure your environment in seconds, ensuring you have the exact same library versions as the developers.

About

Simple project skeleton for educational purposes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published