LuxuryStay is a comprehensive role-based hotel management application that provides different features based on the user type. The system supports four distinct roles: Manager, Receptionist, Housekeeping, and Guest. Built with TypeScript, Express, MongoDB, and additional modern tools, it's designed for learning purposes or small-scale real-world use.
- π CRUD & status management on Rooms
- π οΈ CRUD & status management on Issues
- πΈ Generate, view, download, and pay Invoices
- π Schedule, update, and delete Tasks
- π Manage Bookings (view, cancel, update status)
- π View Rooms
- π£ Report Issues
- πΈ Generate, view, and download Invoices
- π Schedule and view Tasks
- π View and update Bookings
- π View and update Room Status
- π View and update Issue Status
- π View and update Task Status
- π View Rooms
- π£ Report Issues
- πΈ View and download Own Invoices
- π View and update Own Profile
- π Create, view, and cancel Own Bookings
- Backend: Node.js + Express.js (v5.1.0)
- Language: TypeScript with ESNext target
- Database: MongoDB with Mongoose ODM (v8.16.2)
- Authentication: JWT (JSON Web Tokens) with cookie-based sessions
- Styling: Tailwind CSS
- Real-time Communication: Socket.IO
- Security: bcrypt for password hashing
- Email Services: Nodemailer
- AI Integration: OpenAI API and Pinecone vector database
- PDF Generation: PDFKit for invoice generation
- Environment: dotenv for environment variable management
- CORS: Cross-origin resource sharing support
- Utilities: UUID for unique identifiers, MathJS for mathematical operations
luxurystay-user/
βββ .env
βββ .env.example
βββ .gitignore
βββ LICENSE
βββ package-lock.json
βββ package.json
βββ Readme.md
βββ tsconfig.json
βββ vercel.json
βββ emailconfig.js
βββ emailconfig.ts
βββ emailservice.js
βββ emailservice.ts
βββ node_modules/
βββ public/ # Static assets and HTML pages
βββ src/
βββ agents/ # AI agent system
βββ client/ # Client-side utilities
βββ config/ # Configuration files
βββ controllers/ # Request handling logic
βββ memory/ # Session and state management
βββ middleware/ # Express middleware
βββ models/ # Mongoose schemas
βββ routes/ # API route definitions
βββ tools/ # AI tools and utilities
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions
- Node.js (v18 or higher)
- MongoDB (local instance or cloud Atlas)
- Environment variables configured in
.envfiles
- Navigate to the project directory:
cd luxurystay-user- Install dependencies:
npm install- Configure environment variables:
cp .env.example .env
# Edit .env with your configurationRequired environment variables:
PORT=4000
MONGO_URI=mongodb+srv://<user>:<pass>@cluster0.mongodb.net/luxurystay
JWT_SECRET=supersecretkey
EMAIL_USER=you@domain.com
EMAIL_PASS=yourEmailPassword
- Build and run the application:
npm run startThis compiles TypeScript (tsc) and boots the Node.js server.
For development with hot-reload:
npx ts-node ./src/index.mjs/api/auth- Authentication-related endpoints/login- Login page/signup- Signup page/logout- Logout functionality/verify-email- Email verification/verify-email-two- Secondary email verification/reset-password- Password reset endpoint
/- Main dashboard (role-dependent)/room-management- Manager room management/issue-management- Manager issue management/task-management- Manager task management/invoice-management- Manager invoice management/booking-management- Manager booking management/hkeep-room- Housekeeping room view/hkeep-maintenance- Housekeeping maintenance view/hkeep-tasks- Housekeeping tasks view/recept-rooms- Receptionist rooms view/recept-invoices- Receptionist invoices view/recept-tasks- Receptionist tasks view/recept-bookings- Receptionist bookings view/recept-issue- Receptionist issue reporting/guest-rooms- Guest rooms view/guest-bookings- Guest bookings view/guest-issues- Guest issue reporting
/api/guest- Guest-related APIs/api/bookings- Booking management APIs/api/invoices- Invoice management APIs/api/housekeeping- Housekeeping APIs/api/maintenance- Maintenance APIs/api/rooms- Room management APIs/usermanagement- User management APIs
/agent- AI-powered booking and management assistant
The application includes several Mongoose models:
- User Model: Account management and role-based access
- Room Model: Room information and availability
- Booking Model: Booking records and status
- Invoice Model: Financial records and payments
- Issue Model: Maintenance and reporting system
- Task Model: Task assignment and completion tracking
The application features an AI agent system that can:
- Parse booking requests from natural language
- Handle room booking processes
- Process booking cancellations
- Show available rooms based on criteria
- Assist with other hotel management tasks through a
/agentendpoint
The AI system uses OpenAI API integration with custom tools defined in the /tools/ directory.
The application includes comprehensive email functionality:
- Account verification emails
- Password reset functionality
- Booking confirmations
- Custom email configuration files (both JavaScript and TypeScript versions)
- JWT-based authentication system
- Password hashing with bcrypt
- Cookie-based session management
- Role-based access control
- Protected routes with middleware
- Input validation and sanitization
- 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
- Comprehensive documentation in JSDoc style
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.
The default npm test command currently just echoes an error message, indicating that tests would need to be added as needed. The suggested commands for development include:
- Linting:
npm run lint(eslint) - Formatting:
npm run format(prettier)