chore: initial project setup with backend, frontend, and infrastructure
Add complete NexaPantry application structure including: - Docker Compose configuration with PostgreSQL, Redis, FastAPI backend, worker, frontend and Caddy - Environment configuration template with database, auth, and service settings - GitHub Actions CI workflow for backend/frontend linting, testing, auditing and Docker builds - AGPL-3.0 license and comprehensive README with setup, development, and security documentation - Backend
This commit is contained in:
18
backend/app/api/routes/recipes.py
Normal file
18
backend/app/api/routes/recipes.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.api.deps import current_user, require_home_member
|
||||
from app.db.session import get_db
|
||||
from app.models.entities import Product, User
|
||||
from app.services.recipes import suggest
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("")
|
||||
def recipe_suggestions(home_id: str, user: User = Depends(current_user), db: Session = Depends(get_db)) -> list[dict]:
|
||||
require_home_member(home_id, db, user)
|
||||
products = list(db.scalars(select(Product).where(Product.home_id == home_id)).all())
|
||||
return suggest(products, user.language)
|
||||
|
||||
Reference in New Issue
Block a user