Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alokkkxpixel/Food-View repository with technology badges and authentication API endpoints.

FoodieHub

React Express.js MongoDB TailwindCSS JWT Vite

A TikTok-style video platform for food discovery where users can browse food videos and food partners can showcase their offerings.

📱 Mobile Preview

Here’s how the app looks on a mobile viewport (simulated):

Screen Description
Mobile Home Vertical “TikTok-style” video scroll feed
Upload View Food partner upload / management view

You can place mobile screenshots under a docs/ folder (e.g. docs/mobile-home.png, docs/mobile-upload.png, etc.).


🚀 Features

For Regular Users

  • Browse vertical video feed of food content
  • Like and save food videos
  • View saved content
  • Profile management with account settings

For Food Partners

  • Upload and manage food videos
  • Update food prices and delete items
  • Track engagement metrics

🛠️ Tech Stack

Frontend:

  • React 19.1.1 1
  • Tailwind CSS 4.1.13 2
  • Vite 7.1.2 3
  • Axios for API calls 4
  • GSAP for animations 5

Backend:

  • Express.js with Node.js 6
  • MongoDB for data persistence
  • JWT Authentication 7
  • ImageKit for media storage 8
  • bcrypt for password hashing 9

🔐 Authentication API Endpoints

User Authentication

Method Endpoint Description Middleware
POST /api/auth/user/register Register new user with profile image multer.single("image"), registerUserValidator
POST /api/auth/user/login User login with email/password None
POST /api/auth/user/logout User logout None
DELETE /api/auth/user/:id Delete user account None

Food Partner Authentication

Method Endpoint Description Middleware
POST /api/auth/foodpartner/register Register new food partner multer.single("image"), registerFoodPartnerValidator
POST /api/auth/foodpartner/login Food partner login None
POST /api/auth/foodpartner/logout Food partner logout None
DELETE /api/auth/foodpartner/:id Delete food partner account None

Authentication Middleware

  • authUserMiddleware: Validates JWT tokens for regular users 12
  • authFoodPartnerMiddleware: Validates JWT tokens for food partners 13

📡 Additional API Routes

Food Item Management

Method Endpoint Description Authentication
POST /api/food/ Create food item with video Food Partner
GET /api/food/ Get paginated food items User
POST /api/food/like Toggle like on food item User
POST /api/food/save Save food item User
GET /api/food/savedfood Get saved food items User
DELETE /api/food/:id Delete food item None
PUT /api/food/:id/price Update food price None

Food Partner Profile

Method Endpoint Description Authentication
GET /api/food-partner/profile Get logged-in partner profile Food Partner
GET /api/food-partner/:id Get partner profile by ID Food Partner

🏗️ Architecture

The platform follows a three-tier architecture:

  • Frontend: React SPA with routing 16
  • Backend: Express.js REST API 17
  • Database: MongoDB with Mongoose ODM
  • Storage: ImageKit CDN for media files

🚦 Getting Started

  1. Clone the repository

    git clone https://github.com/alokkkxpixel/Food-View.git
    cd Food-View
  2. Backend Setup

    cd backend
    npm install
  3. Frontend Setup

    cd frontend
    npm install
  4. Environment Variables Create .env files with:

    • JWT_SECRET
    • IMAGEKIT_PUBLIC_KEY
    • IMAGEKIT_PRIVATE_KEY
    • IMAGEKIT_ENDPOINT
    • MongoDB connection string
  5. Start Development Servers

    # Backend (port 3000)
    cd backend && npm start
    
    # Frontend (port 5173)
    cd frontend && npm run dev

📱 Frontend Routes

The application uses React Router for navigation: 18

  • /user/register - User registration
  • /user/login - User login
  • /foodpartner/register - Food partner registration
  • /foodpartner/login - Food partner login
  • /home - Main video feed
  • /savedfood - Saved content
  • /create-food - Upload food content
  • /food-partner/profile - Partner dashboard

Notes

The codebase implements a comprehensive dual-authentication system supporting both regular users and food partners, with role-based access control and secure JWT token management. The API follows REST conventions with proper middleware validation and file upload handling via multer and ImageKit integration.

Wiki pages you might want to explore:

Citations

File: frontend/package.json (L15-15)

    "axios": "^1.11.0",

File: frontend/package.json (L20-20)

    "gsap": "^3.13.0",

File: frontend/package.json (L23-23)

    "react": "^19.1.1",

File: frontend/package.json (L27-27)

    "tailwindcss": "^4.1.13"

File: frontend/package.json (L39-39)

    "vite": "^7.1.2"

File: backend/src/app.js (L2-2)

const express = require("express");

File: backend/src/app.js (L20-23)

//Routes
app.use("/api/auth", authRoutes);
app.use("/api/food", foodItemRoutes);
app.use("/api/food-partner", foodpartnerRoutes);

Releases

Packages

Contributors

Languages