Skip to content

Mr-SKR/FLDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Food Lovers Database (FLDb)

Website

A comprehensive collection and search engine for food vlogs from popular creators like Food Lovers TV, FoodyMonk, and more.

🍽️ About the Project

Food Lovers Database (FLDb) is a fan-made project designed to help food enthusiasts discover restaurants reviewed by their favorite food vloggers. It bridges the gap between entertaining video content and actionable dining discovery by extracting location data directly from video descriptions and enriching it with Google Maps details.

What started as a directory for Food Lovers TV has evolved into a multi-channel platform, aggregating trusted recommendations from across the food vlogging community into a single, location-aware interface.

This repository contains the integrated frontend and synchronization logic.

✨ Key Features

  • πŸ“ Location-Based Discovery: Find restaurants near your current location across multiple creators.
  • πŸ” Powerful Search: Search by restaurant name, location, or video title.
  • πŸŒ“ Dark & Light Mode: Fully responsive UI with persistent theme support.
  • πŸ₯— Dietary Filters: Quickly filter for "Veg Friendly" restaurants.
  • πŸ”„ Automated Data Sync: Integrated background synchronization with YouTube and Google Places APIs for multiple channels.
  • πŸ’¬ Discussion Integration: Comment and discuss reviews via Disqus.

πŸ› οΈ Tech Stack

πŸš€ Getting Started

1. Prerequisites

2. Installation

git clone https://github.com/Mr-SKR/FLDB.git
cd FLDB
yarn install

3. Google API Setup

You need a Google Cloud Project with the following APIs enabled:

  • YouTube Data API v3
  • Maps JavaScript API
  • Places API (requires billing enabled)

4. Environment Variables

Create a .env file in the root directory:

MONGODB_URI=your_mongodb_connection_string
NEXT_PUBLIC_DISQUS_SHORTNAME=your_disqus_shortname

# Database Sync Configuration
YOUTUBE_API_KEY=your_youtube_api_key
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
SYNC_SECRET=your_custom_secure_string_for_api_trigger

πŸ”„ Database Syncing

The database is populated by a multi-step synchronization process that interfaces with the YouTube Data API and Google Places API. The system supports multiple channels and playlists as defined in config/syncConfig.ts.

πŸ›‘οΈ Authorization

All sync requests must be authorized using the SYNC_SECRET defined in your environment variables. For security, authorization is strictly handled via headers to avoid leaking secrets in server logs or browser history.

  • Header: Authorization: Bearer YOUR_SYNC_SECRET

πŸ› οΈ API Actions

The /api/sync endpoint supports the following actions:

1. Get Sources

Retrieve the list of configured channels and playlists.

curl -H "Authorization: Bearer YOUR_SECRET" "http://localhost:3000/api/sync?action=get-sources"

2. List Videos

Fetch a paginated list of videos from a specific YouTube playlist.

curl -H "Authorization: Bearer YOUR_SECRET" "http://localhost:3000/api/sync?action=list&playlistId=PLAYLIST_ID"

3. Sync Individual Video

Trigger a deep sync for a specific video. This extracts location data and enriches it via the Google Places API.

  • mode: soft (updates existing metadata) or hard (re-fetches everything from Google Places)
  • isVeg: true or false (manual override for dietary filtering)
curl -X POST -H "Authorization: Bearer YOUR_SECRET" "http://localhost:3000/api/sync?action=sync&videoId=VIDEO_ID&mode=soft&isVeg=true"

πŸ–₯️ Sync Management Interface

For easier management, FLDb includes a built-in admin dashboard located at /sync. This interface provides a visual way to manage the database without manually using curl.

Features:

  • Source Selection: Choose from multiple configured channels and playlists (e.g., Food Lovers TV, FoodyMonk).
  • Video Discovery: Fetch the latest videos from the selected YouTube playlist.
  • Smart Filtering: Automatically identifies which videos have already been synced to the database.
  • Bulk Operations: Trigger a "Sync Current Page" action to process all unsynced videos in one go.
  • Granular Control:
    • Soft Sync: Updates existing restaurant data (useful for minor metadata refreshes).
    • Hard Sync: Performs a complete re-fetch from the Google Places API (useful if restaurant details like rating or location have changed significantly).

How to use:

  1. Navigate to https://foodloversdatabase.com/sync (or localhost:3000/sync).
  2. Enter your SYNC_SECRET in the "Sync Secret" field.
  3. Select a target channel/playlist.
  4. Click Load Playlist to see the latest videos.
  5. Use the sync buttons on individual videos or the "Sync Current Page" button for bulk updates.

πŸ€– Automation

For production environments, the sync logic can be automated using GitHub Actions or Vercel Cron Jobs to periodically refresh the restaurant database by hitting the API endpoints described above.

πŸ’» Development

Commands

Task Command Description
Start Dev Server yarn dev Launches the local development server with HMR.
Build Project yarn build Compiles the production-ready application.
Start Production yarn start Runs the compiled production build locally.
Linting yarn lint Runs ESLint to check for code quality and style issues.
Type-Check yarn typecheck Runs the TypeScript compiler to verify type safety.

πŸ“¦ Project Structure

  • /components: Reusable UI components including layout elements, cards, and specialized discovery UI.
  • /config: Global constants and synchronization source configurations.
  • /hooks: Custom React hooks for geolocation handling and place filtering logic.
  • /lib: Core libraries for database connectivity, environment management, and location enrichment.
  • /models: Mongoose schemas defining the data structures for Restaurants (Places) and Videos.
  • /pages: Next.js pages and API routes (including the search and sync engines).
  • /services: Business logic for data orchestration and third-party API interactions.
  • /types: TypeScript interface and type definitions used across the application.
  • /utils: Helper functions for geographic calculations, slugification, and data serialization.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Created with ❀️ for the Food Lovers community.

About

Food Lovers Database. A restaurant finder website

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors