REST API for PlantDaddy web app. Leverages a modern, typed Python stack.
One place with all the info you need to keep the plant alive
- Name, classify, categorize, and perform lookups for plants
- Create PlantGroups
- Schedule events for watering/care
- FastAPI (api framework)
- SQLModel (orm)
- Poetry (dependencies/venv)
- Black (formatting)
- Flake8 (linting)
- MyPy (strong typing)
Prerequisite: Poetry installation
(VSCode)
- install Python/Pylance/Toml extensions
- update poetry virtual environments setting to keep it in the project instead of default location by running:
poetry config virtualenvs.in-project true
- Create Virtual Environments with poetry:
poetry env use python3.10
andpoetry env use python3.9
. - Activate the venv using
poetry shell
- Install the packages listed in
pyproject.toml
into your venv usingpoetry install
.
- Create a local SQLite database file by creating a file ending in
.db
. - Create a file ".env" in the project root and add the absolute path to your
.db
file to a variableSQLITE_FILE
.
- Start the server by running
python3 -m app.console
from the project root. - Alternatively, run from the command line with
uvicorn app.api.v1.endpoints.plant:app --reload
- Test the endpoints by going to the localhost link which appears in the console and appending "/docs" to the URL