Skip to content

Latest commit

 

History

History
220 lines (165 loc) · 9.18 KB

File metadata and controls

220 lines (165 loc) · 9.18 KB

🍽️ Yummy Restaurant — API & Admin Dashboard

A fully-featured, modern restaurant management platform built with ASP.NET Core 6. It seamlessly integrates a RESTful Web API, an elegant MVC front-end with a Premium Glassmorphism Admin Panel, and cutting-edge AI capabilities (OpenAI & Hugging Face) for automated content generation and message moderation.

.NET 6 ASP.NET Core Web API EF Core SQL Server OpenAI Hugging Face


📑 Table of Contents


🧭 Overview

APIProject6 is a comprehensive restaurant management web application composed of two independent projects working in harmony:

Project Role
APIProject6.WebAPI RESTful Web API — data access, business rules, and persistence via Entity Framework Core + SQL Server.
APIProject6.WebUI ASP.NET Core MVC front-end — Features a public restaurant website and a beautifully crafted, modern Admin Dashboard utilizing premium CSS design concepts (Glassmorphism, CSS Grid).

Beyond standard CRUD operations, the platform acts as an intelligent assistant by introducing AI-powered features: Recipe generation, AI-assisted customer support, and automatic translation + toxicity moderation for inbox messages.


✨ Key Features

Web API

  • 🏗️ RESTful Architecture with clean, resource-oriented endpoints.
  • 🔄 Full CRUD operations across all domain modules (Categories, Products, Chefs, Messages, etc.).
  • 🗄️ Entity Framework Core (Code-First) with SQL Server backend.
  • 📦 DTO-based data transfer configured seamlessly with AutoMapper.
  • FluentValidation for robust incoming request validation.
  • 📖 Swagger / OpenAPI integration for interactive documentation and testing.

Premium Web UI & Admin Panel

  • 🎨 Modern Design System: The Admin Dashboard features a highly polished UI with Glassmorphism effects, responsive CSS Grids, smooth hover micro-animations, and gradient buttons.
  • 🖼️ Native Image Lightbox: A beautifully integrated gallery page for administrators with a native, dependency-free CSS/JS lightbox.
  • 📍 Interactive Contact Map: Embedded Google Maps UI directly into the admin contact panel for real-time location previewing.
  • 🌐 Public Website: A complete front-end for customers featuring hero banners, dynamic menus, chefs, testimonials, and contact forms.
  • 🚀 ViewComponents: Reusable, modular UI components to keep Razor views clean.

AI-Powered Integrations

  • 🤖 AI Recipe Generator (OpenAI): Input ingredients and receive a beautifully formatted recipe instantly.
  • 💬 Smart Support Replies (OpenAI): The system reads customer feedback and drafts polite, on-brand responses (handling complaints, questions, or praise automatically).
  • 🌐 Auto-Translation (Hugging Face): Translates incoming Turkish messages to English seamlessly in the background (Helsinki-NLP/opus-mt-tr-en).
  • 🛡️ Toxicity Moderation (Hugging Face): Scans incoming messages using a classifier (unitary/toxic-bert), flagging them as safe or toxic.
  • Retroactive Moderation: A dedicated one-click "Analyze Toxicity" feature for messages manually inserted into the database.

🧠 AI & Integrations

Capability Provider Model / Endpoint Where
Recipe Generation OpenAI Chat Completions API AIController.CreateRecipeWithOpenAI
Support-reply Drafting OpenAI Chat Completions API MessageController.AnswerMessageWithOpenAI
Message Translation Hugging Face Helsinki-NLP/opus-mt-tr-en MessageController.SendMessage
Toxicity Classification Hugging Face unitary/toxic-bert MessageController.SendMessage & AnalyzeExistingMessage

Security Note: All AI keys are supplied through configuration (dotnet user-secrets) and are never committed to source control.


🏗️ Architecture

APIProject6/
├── APIProject6.WebAPI/          # RESTful Web API Layer
│   ├── Controllers/             # API Endpoints
│   ├── Context/                 # EF Core DbContext
│   ├── Dtos/                    # Data Transfer Objects
│   ├── Entities/                # Domain models
│   ├── Mapping/                 # AutoMapper profiles
│   ├── Migrations/              # EF Core Code-First migrations
│   └── ValidationRules/         # FluentValidation rules
│
├── APIProject6.WebUI/           # ASP.NET Core MVC Layer
│   ├── Controllers/             # MVC Controllers (Website, Admin, AI)
│   ├── Views/                   # Razor views with premium styling
│   ├── ViewComponents/          # UI components
│   ├── Dtos/                    # Client-side DTOs
│   └── wwwroot/                 # Static assets (CSS, JS, images)
│
└── APIProject6.sln

🧰 Tech Stack

  • Backend: ASP.NET Core 6 (Web API & MVC)
  • Database: Entity Framework Core, Microsoft SQL Server
  • Libraries: AutoMapper, FluentValidation, Newtonsoft.Json, Swashbuckle
  • AI Services: OpenAI API, Hugging Face Inference API
  • Frontend: HTML5, Vanilla CSS3 (Glassmorphism, CSS Grid), JavaScript (ES6), Bootstrap

🚀 Getting Started

Prerequisites

  • .NET 6 SDK
  • Visual Studio 2022 / JetBrains Rider / VS Code
  • SQL Server (LocalDB or Express)
  • EF Core CLI (dotnet tool install --global dotnet-ef)

1. Clone & Restore

git clone https://github.com/Houzcetin/APIProject6.git
cd APIProject6
dotnet restore

2. Configure the Database

Update the connection string in APIProject6.WebAPI/Context/APIContext.cs to point to your local SQL Server instance.

3. Apply Migrations

dotnet ef database update --project APIProject6.WebAPI

🔐 Configuration (API Keys & Secrets)

To enable the AI features (OpenAI and Hugging Face), you must configure your API keys securely using .NET User Secrets:

cd APIProject6.WebUI

dotnet user-secrets init
dotnet user-secrets set "OpenAI:ApiKey" "sk-your-openai-key"
dotnet user-secrets set "HuggingFace:ApiKey" "hf_your-huggingface-token"

▶️ Running the Applications

Both projects must be running simultaneously. The Web UI expects the Web API to be hosted at https://localhost:7277.

  1. Start the Web API:

    dotnet run --project APIProject6.WebAPI

    Swagger documentation will be available at https://localhost:7277/swagger.

  2. Start the Web UI:

    dotnet run --project APIProject6.WebUI

    The main application will be available at https://localhost:7208.


📡 API Reference

The API follows strict RESTful conventions. Here is an example of the /api/Products endpoint:

Method Endpoint Description
GET /api/Products List all products
POST /api/Products Create a new product
GET /api/Products/GetProduct?id={id} Get a product by ID
PUT /api/Products Update an existing product
DELETE /api/Products?id={id} Delete a product

📸 Screenshots

1. Modern Admin Dashboard (Glassmorphism & Grid UI)

Admin Dashboard & Contact UI

2. Premium Image Gallery & Native Lightbox

Glassmorphism Gallery & Lightbox

3. AI Message Moderation (Toxic-Bert) & Auto-Reply

AI Toxicity Analyzer & Message List

4. Public Restaurant Website

Public Restaurant Website


Developed by Oğuz Çetin
GitHub Profile

Built with passion, ASP.NET Core 6, and modern AI.