This repository contains the frontend implementation of an Indonesian food classification web application. The application allows users to upload images of Indonesian food, sends them to a backend API for classification, and displays AI-generated recipes based on the prediction results.
The frontend is built using Vanilla JavaScript with a modular structure and is designed to be lightweight, responsive, and easy to integrate with different backend environments.
- Integration with a RESTful backend API
- Display of classification results and confidence score
- AI-generated recipe rendering
- Fully responsive user interface
- Progressive Web App (PWA) support
Frontend:
- Vanilla JavaScript (ES6+)
- Bootstrap 5
Backend (separate repository):
- Flask (Python)
- CNN-based food classification model (MobileNetV2)
- Large Language Model for recipe generation
- You can access the Backend repository here.
- User uploads an image of Indonesian food.
- The image is sent to the backend API.
- The backend performs food classification using a CNN model.
- The predicted food name is passed to an LLM to generate a recipe.
- The frontend renders:
- Food name
- Generated recipe content
git clone https://github.com/yourusername/food-classification-frontend.git
cd food-classification-frontendUpdate the backend base URL inside the API utility file:
// src/utils/api.js
const BASE_URL = 'http://localhost:5000';Change the URL according to your backend deployment environment.
This project is a static frontend application.
You can run it using:
- Live Server (VS Code extension)
- Any static file server
- Static hosting platforms such as GitHub Pages, Netlify, or Vercel
This application includes PWA support, enabling:
- Offline access for cached assets
- Installable web application experience
- Responsive behavior across devices
Ensure that manifest.json and service-worker.js are properly registered.
- Built with Vanilla JavaScript to emphasize core JavaScript fundamentals
- Modular file structure for maintainability
- Separation of concerns between UI logic, API handling, and utilities
- Easily extendable to modern frameworks such as React or Next.js
- Migration to React or Next.js
- User authentication and profile management
- Backend-based history persistence
- Image storage using cloud services
- Multi-language support