* ♻️ Refactor backend, update DB session handling
* ✨ Add mypy config and plugins
* ➕ Use Python-jose instead of PyJWT
as it has some extra functionalities and features
* ✨ Add/update scripts for test, lint, format
* 🔧 Update lint and format configs
* 🎨 Update import format, comments, and types
* 🎨 Add types to config
* ✨ Add types for all the code, and small fixes
* 🎨 Use global imports to simplify exploring with Jupyter
* ♻️ Import schemas and models, instead of each class
* 🚚 Rename db_session to db for simplicity
* 📌 Update dependencies installation for testing
* Ignore Flake8 unused import error F401
https://flake8.readthedocs.io/en/latest/user/error-codes.html
The apparently unused imports may be needed for SQLAlchemy.
As the code comment says:
make sure all SQL Alchemy models are imported before initializing DB
otherwise, SQL Alchemy might fail to initialize properly relationships
See GitHub 28 and 29
* Ignore Flake8 unused variable error F841
https://flake8.readthedocs.io/en/latest/user/error-codes.html
The apparently unused variables may be needed for tests.
* Bring line length into compliance with Black
Should be 88 characters.
* Format alembic code with Black
* Add some information how to run backand test for local backand development
* Bug fixes in backend app
* 🎨 Update format
* ✅ Use random_email for test_update_user
Co-authored-by: Mocsar Kalman <mocsar.kalman@gravityrd.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
* Use Pydantic BaseSettings for config settings
* Update fastapi dep to >=0.47.0 and email_validator to email-validator
* Fix deprecation warning for Pydantic >=1.0
* Properly support old-format comma separated strings for BACKEND_CORS_ORIGINS
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
* Update CRUD utils to use types better.
* Simplify Pydantic model names, from `UserInCreate` to `UserCreate`, etc.
* Upgrade packages.
* Add new generic "Items" models, crud utils, endpoints, and tests. To facilitate re-using them to create new functionality. As they are simple and generic (not like Users), it's easier to copy-paste and adapt them to each use case.
* Update endpoints/*path operations* to simplify code and use new utilities, prefix and tags in `include_router`.
* Update testing utils.
* Update linting rules, relax vulture to reduce false positives.
* Update migrations to include new Items.
* Update project README.md with tips about how to start with backend.