Skip to content

haranck/DineMap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

42 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍽️ Restaurant Management System

A modern, full-stack solution for managing restaurant operations, built with scalable architecture.

🌐 Live Demo: https://dine-map.vercel.app/

TypeScript Node.js Express React PostgreSQL Prisma Redis Tailwind


πŸ“– Overview

This Restaurant Management System is a robust, end-to-end application designed to streamline restaurant operations. It features a scalable backend built on Node.js, Express, and Clean Architecture principles, heavily utilizing Dependency Injection. The frontend is a modern React 19 application, focused on high performance and a rich user experience, styled with Tailwind CSS v4.

Data is securely managed using PostgreSQL via Prisma ORM, with Redis implemented for high-performance caching. The entire stack is fully typed with TypeScript, ensuring maximum reliability and developer productivity.


✨ Key Features

  • πŸ” Secure Authentication: Robust JWT-based authentication with Access and Refresh tokens.
  • πŸ›‘οΈ Role-Based Access Control (RBAC): Granular permissions for different user roles (Admin, Manager, Staff).
  • 🏒 Restaurant CRUD: Complete lifecycle management for restaurant entities.
  • πŸ“¦ Clean Architecture: Separation of concerns using Controllers, Services, and Repositories (with tsyringe for DI).
  • ⚑ High Performance: Integrated Redis caching for lightning-fast data retrieval.
  • πŸ–ΌοΈ Image Uploads: Seamless media handling using Cloudinary.
  • 🎨 Modern UI/UX: Built with React 19, Redux Toolkit, React Query, and responsive Tailwind styling.
  • βœ… Type Safety: End-to-end TypeScript implementation.

πŸ› οΈ Technology Stack

Backend (/backend)

  • Core: Node.js, Express.js, TypeScript
  • Database & ORM: PostgreSQL, Prisma ORM
  • Caching: Redis (ioredis)
  • Architecture: Clean Architecture, Dependency Injection (tsyringe)
  • Security: JWT, bcryptjs, Zod (validation)
  • Storage: Cloudinary

Frontend (/frontend)

  • Core: React 19 (Vite), TypeScript
  • State Management: Redux Toolkit, Redux Persist
  • Data Fetching: TanStack React Query v5, Axios
  • Styling & UI: Tailwind CSS v4, Lucide React, shadcn/ui
  • Forms & Validation: React Hook Form, Zod
  • Routing: React Router DOM v7

πŸ“‚ Project Structure

πŸ“¦ restaurant-management
β”œβ”€β”€ πŸ“‚ backend/               # Node.js API server
β”‚   β”œβ”€β”€ πŸ“‚ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ controllers/   # Request handlers
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ services/      # Business logic
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ repositories/  # Database access layer
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ routes/        # API route definitions
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ DI/            # Dependency injection setup
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ cache/         # Redis caching logic
β”‚   β”‚   └── πŸ“‚ config/        # Environment and app config
β”‚   └── πŸ“œ prisma/schema      # Database schema
└── πŸ“‚ frontend/              # React client application
    β”œβ”€β”€ πŸ“‚ src/
    β”‚   β”œβ”€β”€ πŸ“‚ components/    # Reusable UI components
    β”‚   β”œβ”€β”€ πŸ“‚ pages/         # Application views
    β”‚   β”œβ”€β”€ πŸ“‚ store/         # Redux configuration
    β”‚   β”œβ”€β”€ πŸ“‚ services/      # API communication layer
    β”‚   └── πŸ“‚ hooks/         # Custom React hooks

πŸš€ Getting Started

Follow these instructions to get the project up and running on your local machine.

Prerequisites

Ensure you have the following installed:

  • Node.js (v18 or higher)
  • PostgreSQL
  • Redis server running locally or remotely

1. Backend Setup

Navigate to the backend directory and install dependencies:

cd backend
npm install

Create a .env file in the /backend directory based on the required variables:

# Server
PORT=5000

# Database (PostgreSQL)
DATABASE_URL="postgresql://user:password@localhost:5432/restaurant_db?schema=public"

# Redis
REDIS_URL="redis://localhost:6379"

# JWT Secrets
JWT_ACCESS_SECRET="your_super_secret_access_key_here"
JWT_REFRESH_SECRET="your_super_secret_refresh_key_here"

# Cloudinary (If applicable)
CLOUDINARY_CLOUD_NAME="your_cloud_name"
CLOUDINARY_API_KEY="your_api_key"
CLOUDINARY_API_SECRET="your_api_secret"

Run database migrations and start the server:

# Generate Prisma Client & Run Migrations
npm run db:migrate

# Start the development server
npm run dev

2. Frontend Setup

Open a new terminal, navigate to the frontend directory, and install dependencies:

cd frontend
npm install

Create a .env file in the /frontend directory:

VITE_API_URL="http://localhost:5000/api/v1"

Start the Vite development server:

npm run dev

The application should now be running at http://localhost:5173.


πŸ“œ Available Scripts

Backend

Command Description
npm run dev Starts the server in development mode using nodemon.
npm run build Compiles TypeScript and generates Prisma client.
npm run start Runs the compiled application.
npm run db:migrate Applies pending Prisma migrations to the database.

Frontend

Command Description
npm run dev Starts the Vite development server.
npm run build Builds the application for production.
npm run lint Runs ESLint to check for code quality.

🀝 Contributing

Contributions, issues, and feature requests are welcome!


πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgements


πŸ‘€ Author

Haran


Made with ❀️ using TypeScript and React

About

Built a full-stack restaurant management system using TypeScript and modern web technologies. Implemented secure JWT-based authentication with role-based access control. Designed using clean architecture principles for scalability and maintainability. Integrated PostgreSQL, Prisma, and Redis for efficient data handling and performance.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors