Files
trading-journal/backend
Tianyu Liu 5753ad3767
All checks were successful
Backend CI / unit-test (push) Successful in 24s
fix test teardown
2025-09-14 17:17:48 +02:00
..
2025-09-11 18:24:36 +00:00
2025-09-12 14:06:58 +00:00
2025-09-14 17:17:48 +02:00
2025-09-14 17:03:39 +02:00
2025-09-14 15:40:11 +02:00
2025-09-11 18:24:36 +00:00
2025-09-12 15:05:01 +00:00
2025-09-12 23:24:46 +02:00
2025-09-11 18:24:36 +00:00
2025-09-11 18:24:36 +00:00
2025-09-11 18:24:36 +00:00
2025-09-12 23:24:46 +02:00
2025-09-12 23:24:46 +02:00
2025-09-13 21:14:14 +02:00
2025-09-11 18:24:36 +00:00

FastAPI Template

This sample repo contains the recommended structure for a Python FastAPI project. In this sample, we use fastapi to build a web application and the pytest to run tests.

For a more in-depth tutorial, see our Fast API tutorial.

The code in this repo aims to follow Python style guidelines as outlined in PEP 8.

Set up instructions

This sample makes use of Dev Containers, in order to leverage this setup, make sure you have Docker installed.

To successfully run this example, we recommend the following VS Code extensions:

In addition to these extension there a few settings that are also useful to enable. You can enable to following settings by opening the Settings editor (Ctrl+,) and searching for the following settings:

  • Python > Analysis > Type Checking Mode : basic
  • Python > Analysis > Inlay Hints: Function Return Types : enable
  • Python > Analysis > Inlay Hints: Variable Types : enable

Running the sample

  • Open the template folder in VS Code (File > Open Folder...)
  • Open the Command Palette in VS Code (View > Command Palette...) and run the Dev Container: Reopen in Container command.
  • Run the app using the Run and Debug view or by pressing F5
  • Ctrl + click on the URL that shows up on the terminal to open the running application
  • Test the API functionality by navigating to /docs URL to view the Swagger UI
  • Configure your Python test in the Test Panel or by triggering the Python: Configure Tests command from the Command Palette
  • Run tests in the Test Panel or by clicking the Play Button next to the individual tests in the test_main.py file