🍽️ Burak Restaurant - Admin Backend & API
This is the Backend Server and Admin Panel for the Burak Restaurant Application. It provides the REST API endpoints for the client-side app and serves the server-side rendered (SSR) Admin Dashboard for restaurant management.
🏗️ Project Architecture
This project follows the MVC (Model-View-Controller) pattern to separate business logic, data, and the user interface.
Description
src/controllers Contains logic to handle requests for Orders, Products, and Users.
src/models Service models defining the business logic.
src/schema Database models (Schema Models) defining the structure of data.
src/views EJS templates for the Admin Dashboard UI.
src/router.ts Main API routes for the customer-facing mobile/web app.
src/router-Admin.ts Protected routes specifically for the Admin Panel.
src/server.ts Entry point that initializes the server and database connection.
✨ Key Features 👑 Admin Dashboard (Web)
Product Management: Create, update, and delete menu items (images, prices, categories).
User Management: View registered users and manage their access levels.
🚀 REST API (Backend)
Order Processing:
POST /createOrder: Receive new orders from the frontend. POST /updateOrder: Update status (Pending → Cooking → Ready → Delivery).
Member System: POST /updateMember: Handle user profile updates. POST /updateChosenUser: Admin logic to modify specific user data.
Authentication: Secure login for admins and token verification for API requests.
🛠️ Tech Stack
Runtime: Node.js Language: TypeScript Framework: Express.js Database: MongoDB (with Mongoose) Template Engine: EJS (for Admin UI views) Authentication: JWT & Sessions
🚀 Getting Started
Follow these steps to set up the backend server locally.
- Prerequisites
Node.js (v14 or higher) MongoDB (Local or Atlas URL)
- Installation
git clone https://github.com/shox17/burak.git
cd burak
npm install
- Environment Setup
Create a .env file in the root directory and add your credentials:
PORT=3001 MONGO_URL=mongodb+srv://your_connection_string SESSION_SECRET=your_secret_key
- Running the Server
npm run dev
npm run build npm start
Commit your changes.
Push to the branch and open a Pull Request.
Developed by: [Your Name]