- Clone the repository and navigate to the project directory:
git clone https://github.com/HoPHNiDev/coffee_api.git
cd coffee_api
- Install the dependencies:
pip install uv
uv venv
source .venv/bin/activate
uv sync
- Fulfill the
.env-example
environment variables' - Generate JWT public and private keys:
mkdir app/core/keys
openssl genpkey -algorithm RSA -out app/core/keys/jwt-private.pem -pkeyopt rsa_keygen_bits:2048
openssl rsa -pubout -in app/core/keys/jwt-private.pem -out app/core/keys/jwt-public.pem
- Run the migrations:
alembic upgrade head
python3 app/main.py
POST /auth/verify
's method implemented asGET
in code (link to file) for access just from link- Added additional route
POST /auth/logout
for user logout - Verification code sending using FastAPI's BackgroundTasks instance. It can be implemented via Celery or via message brokers (best option is faststream library)
- Unverified user's autodelete could be implemented via Celery
(
task which will get not verified users and delete them and Celery Beat, which will run this task every day
), It’s already 1 AM, and I’m getting sleepy… otherwise, I’d have implemented this feature too.
You can check the structure of this project in this file.
The way I see the structure of the project, I think it is obvious from the structure of the code of this repository.
- Telegram: @HoPHNi