How baratam-saiprasoona/zomato-restaurant-listing-searching works
Project type and purpose
• This is a small full-stack web application built with a lightweight Python web framework (likely Flask) that loads restaurant data into a database, exposes REST API endpoints for querying, and renders HTML pages for users. It also includes a standalone data‐loading/testing script.
File structure
• Top-level files:
• README.md – project description, use cases
• app.py – main web application (API + UI)
• test_import.py – unit test for the loader
• zomato_data.csv & Tomato.restaurants.json – source data
• Directory “templates/” contains Jinja HTML templates:
• restaurant_list.html, restaurant_detail.html, search_results.html, upload.html
• No separate “static” folder implies inline/static links or none.
README for additional insights
• Key functions: data loading into a DB, REST API endpoints (get by ID, list with pagination), web pages for listing, detail view, location search, image-based search.
• Optional filters/search by cuisine, country, spend.
Main components
a. Data Ingestion Layer
– Script (test_import.py/app.py loader) reads CSV/JSON → writes to relational DB
b. Database
– Relational store (e.g., SQLite/MySQL/Postgres) holding restaurant records
c. Web API Service
– app.py exposes endpoints:
• GET /restaurants/{id}
• GET /restaurants?page=&size=
• GET /search?lat=&lng=&radius=
• POST /image-search (accepts uploaded image)
d. Image-Recognition Service (external or internal ML module)
– Optional component called by the API to classify cuisines from user-uploaded images
e. Web UI (Frontend)
– Jinja templates served by app.py: list, detail, search, upload pages
f. Client (Browser)
– User interacts via HTTP(S) to UI or directly to API
Relationships and interactions
• Data Ingestion → Database
• Client Browser → Web UI pages (app.py)
• Web UI → Web API (internal calls)
• Client Browser → API (for AJAX or image upload)
• API → Database (CRUD reads)
• API → Image-Recognition Service (for image search)
Architectural patterns & principles
– MVC variant: templates are the View, app.py routes/controllers are the Controller, the Database is the Model
– Single-process monolith bundling API and UI
– Separation of concerns: ETL script decoupled from runtime service
– RESTful interface for programmatic access
– Optional pluggable ML component for extensibility
Technologies, frameworks, libraries
– Python 3.x, Flask (or similar)
– Jinja2 (templating)
– pytest or unittest (test_import.py)
– pandas or csv module (data loading)
– SQLAlchemy or direct DB connector
– External ML/cv library or microservice for image classification