Skip to content

shox17/burak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍽️ 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.

image

src/models Service models defining the business logic.

image

src/schema Database models (Schema Models) defining the structure of data.

image

src/views EJS templates for the Admin Dashboard UI.

image

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).

image

User Management: View registered users and manage their access levels.

image

🚀 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.

  1. Prerequisites

Node.js (v14 or higher) MongoDB (Local or Atlas URL)

  1. Installation

Clone the repository

git clone https://github.com/shox17/burak.git

Navigate to the directory

cd burak

Install dependencies

npm install

  1. 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

  1. Running the Server

Development mode (with hot reload)

npm run dev

Production build

npm run build npm start

Commit your changes.

Push to the branch and open a Pull Request.

Developed by: [Your Name]

About

This is burak project backend source

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors