Skip to content

eDeveloper132/LuxuryStay-Admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuxuryStay Admin Panel

Project Overview

LuxuryStay Admin is the admin-facing backend and static dashboard for the LuxuryStay hotel chain. It provides administrators with a comprehensive interface to manage hotel operations using a modern tech stack of Express.js, TypeScript, Tailwind CSS, MongoDB (Mongoose), and Socket.IO.

Features

  • Admin Authentication (JWT-based)
  • Dashboard Analytics for monitoring rooms, bookings, and revenue
  • CRUD Management for rooms, bookings, invoices, housekeeping, and maintenance
  • Real-Time Notifications via Socket.IO
  • Role & Permissions system with admin model featuring granular scopes

Technology Stack

  • Backend: Express.js (v5.1.0)
  • Language: TypeScript
  • Database: MongoDB with Mongoose ODM
  • Authentication: JWT (JSON Web Tokens)
  • Styling: Tailwind CSS
  • Real-time Communication: Socket.IO
  • Security: bcrypt for password hashing
  • Environment: dotenv for environment variable management

Architecture & Structure

Directory Structure

luxurystay-admin/
├── .env
├── .env.example
├── .gitignore
├── LICENSE
├── package-lock.json
├── package.json
├── Readme.md
├── tsconfig.json
├── vercel.json
├── node_modules/
├── public/          # Static assets and HTML pages
└── src/
    ├── controllers/ # Request handling logic
    ├── interfaces/  # TypeScript interfaces
    ├── middleware/  # Express middleware
    ├── routes/      # API route definitions
    └── utils/       # Utility functions

Building and Running

Prerequisites

  • Node.js (v18 or higher)
  • MongoDB (local instance or cloud Atlas)
  • Environment variables configured in .env files

Setup Instructions

  1. Navigate to the project directory:
cd luxurystay-admin
  1. Install dependencies:
npm install
  1. Configure environment variables:
cp .env.example .env
# Edit .env with your configuration
  1. Build and run the application:
npm run start

The application will compile TypeScript files and start the server on the configured port (typically 5000, but check your .env file).

Key Endpoints

  • / - Main dashboard
  • /api - Dashboard statistics API
  • /api/auth - Authentication-related endpoints
  • /login - Login page
  • /signup - Signup page
  • /logout - Logout functionality

Security

  • JWT-based authentication system
  • Password hashing with bcrypt
  • Cookie-based session management
  • Protected routes with middleware

Development Conventions

  • TypeScript is used throughout the application
  • Modern ESNext features with NodeNext module resolution
  • Strict TypeScript configuration with comprehensive type checking
  • Consistent file naming with .mjs for modules

Deployment

The project includes a vercel.json file, suggesting it's configured for deployment on Vercel. The application can also be deployed to other Node.js hosting platforms with minimal configuration.

Database Models

Since this is an admin panel, it likely interacts with the same MongoDB collections as the main application but focuses on administrative views and actions.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published