This assesment is a full-stack Recipe Viewer application that allows users to browse, search, and view detailed recipe information. The application uses a FastAPI backend to serve recipe data and a JavaScript frontend to display and interact with that data.
The goal of this project is to demonstrate REST API usage, dynamic UI rendering, filtering, pagination, and user interaction through an interface.
Displays recipes in a table with the following columns:
Data is fetched from the backend using a REST API.
Clicking a table row opens a side drawer with detailed recipe information:
Supports field-level filtering:
>= 4.5)<= 120)Uses the /api/recipes/search endpoint.
Filters are applied when the user clicks Search.
Displays user-friendly messages for:
- main.py # FastAPI application
- schema.sql # SQLite schema
- US_recipes_null.json # Raw JSON file
- requirements.txt # Download requirements
- index.html # UI Structure
- script.js # API calls and UI logic
- styles.css # Styling
Get All Recipes (Paginated and Sorted by Rating)
URL: /api/recipes
Method: GET
Query Parameters:
page: Page number for pagination (default is 1)
limit: Number of recipes per page (default is 10)
Response: A list of recipes sorted by rating in descending order.
URL: /api/recipes/search
Method: GET
Query Parameters:
calories: Filter by calories (greater than, less than, or equal to a specific value).
title: Search by recipe title (partial match).
cuisine: Filter by cuisine.
total_time: Filter by total time (greater than, less than, or equal to a specific value).
rating: Filter by rating (greater than, less than, or equal to a specific value).
git clone https://github.com/AWarZeus/Recipes-Assessment
Change directory to “Recipes-Assessment\Backend”
Run in command prompt:
py -m pip install -r requirements.txt
Run Recipes-Assessment\run.bat
OR
In Recipes-Assessment\Backend run:
py -m uvicorn main:app –reload
AND
In Recipes-Assessment\Frontend run:
If you see endpoints here “http://127.0.0.1:8000/docs” backend is running
Frontend is at “http://127.0.0.1:5500”