Skip to content

HoPHNiDev/coffee_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✅ Implementation of the Coffee Shop API technical assignment

ER-Diagram of DB

img.png

ℹ️ How to run the project

Installing

  1. Clone the repository and navigate to the project directory:
git clone https://github.com/HoPHNiDev/coffee_api.git
cd coffee_api
  1. Install the dependencies:
pip install uv
uv venv
source .venv/bin/activate
uv sync
  1. Fulfill the .env-example environment variables'
  2. 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
  1. Run the migrations:
alembic upgrade head

Running the project

python3 app/main.py

Key differences with Technical specification(TS)

  • POST /auth/verify's method implemented as GET 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.

Project structure

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.

✍️ Questions? Pm me

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published