{"id":22897291,"url":"https://github.com/nandkumar1000/bookmystay","last_synced_at":"2026-04-10T14:37:21.128Z","repository":{"id":260344460,"uuid":"880627260","full_name":"nandkumar1000/BookMyStay","owner":"nandkumar1000","description":"BookMyStay  is an online accommodation booking system that allows users to book rooms from hotels, restaurants, villas, and more. Built with EJS, Node.js, MongoDB, and Passport.js for secure authentication.","archived":false,"fork":false,"pushed_at":"2025-01-13T18:42:21.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T02:32:11.595Z","etag":null,"topics":["bootstrap","css","ejs-template-engine","expressjs","html","js","mongodb","mongoose","nodejs","passportjs","restful-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nandkumar1000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-30T03:44:58.000Z","updated_at":"2025-01-13T18:42:25.000Z","dependencies_parsed_at":"2025-01-02T08:20:04.093Z","dependency_job_id":"796259dd-a917-4da0-b4f9-5232475d9a15","html_url":"https://github.com/nandkumar1000/BookMyStay","commit_stats":null,"previous_names":["nandkumar1000/bookmystay"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nandkumar1000%2FBookMyStay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nandkumar1000%2FBookMyStay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nandkumar1000%2FBookMyStay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nandkumar1000%2FBookMyStay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nandkumar1000","download_url":"https://codeload.github.com/nandkumar1000/BookMyStay/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246563384,"owners_count":20797446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","css","ejs-template-engine","expressjs","html","js","mongodb","mongoose","nodejs","passportjs","restful-api"],"created_at":"2024-12-14T00:16:29.750Z","updated_at":"2025-12-30T19:06:42.063Z","avatar_url":"https://github.com/nandkumar1000.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# 🏨 **Welcome to BookMyStay!** 🌟\n\nHello there! 👋 Welcome to **BookMyStay** – your ultimate online accommodation booking system! From cozy hotels 🏨 to luxurious villas 🏡, we've got a wide range of places you can book near you. Perfect for your next adventure! 🌍✨\n\n---\n\n## ✨ **Abstract**\n\n**BookMyStay** allows users to seamlessly book rooms from a wide range of accommodations such as **hotels**, **restaurants**, **farmhouses**, **individual stays**, and **villas**. 🌟 It’s a secure platform 🔐 built using the **MVC (Model-View-Controller)** architecture for a modular and maintainable codebase. The platform supports **flash messages**, **session management**, and robust **authorization mechanisms** to provide an efficient, user-friendly experience for both travelers and property owners.\n\n---\n\n## 🛠️ **Technology Stack**\n\nWe’ve used a powerful stack of technologies to bring this platform to life! 💻🎉\n\n- **HTML5 \u0026 CSS3** 🌐 – Structured and styled web pages.\n- **EJS** 🧩 – Dynamic web page rendering.\n- **JavaScript** 💻 – Interactive features and smooth user experience.\n- **Node.js \u0026 Express.js** 🚀 – Backend logic, routing, and session handling.\n- **MongoDB** 🍃 – Stores all the accommodation listings and user details securely.\n- **Bootstrap** 🎨 – Responsive design that looks great on any device.\n- **Passport.js** 🔑 – Provides secure user authentication and login features.\n- **Express-Session** 🔐 – Manages user sessions.\n- **Connect-Flash** ⚡ – Displays one-time messages for feedback, errors, or status updates.\n\n---\n\n## 🛡️ **Security Features**\n\n1. **Authentication**:  \n   - Using **Passport.js** to securely log in users with encrypted credentials.  \n2. **Authorization**:  \n   - Role-based access ensures admins and users access only their designated features.\n   - Admins can manage listings, while users can book accommodations.  \n3. **Session Management**:  \n   - **Express-Session** tracks user sessions, ensuring persistent logins and access control.  \n4. **Flash Messages**:  \n   - Powered by **Connect-Flash**, users receive clear feedback on actions like login errors, successful bookings, or unauthorized access.\n\n---\n\n## 🌟 **Features**\n\nHere’s what **BookMyStay** offers:\n\n- 🏨 **Easy Booking** – Users can browse and book rooms easily.\n- ⭐ **Feedback System** – Share reviews and rate stays.  \n- 🔐 **Role-Based Authorization** –  \n   - Users: Can book accommodations and leave reviews.  \n   - Admins: Can manage listings (add, edit, delete).  \n- 🛡️ **Flash Messages** –  \n   - Success and error messages displayed dynamically (e.g., \"Login successful,\" \"Booking confirmed\").  \n- 📶 **Session Tracking** – Users remain logged in until they manually log out.\n\n---\n\n## 🌐 **MVC Architecture**\n\n**BookMyStay** follows the **MVC (Model-View-Controller)** pattern for organized and efficient code:  \n\n1. **Model**:  \n   - Defines the structure of data using MongoDB schemas (e.g., `AccommodationModel`, `UserModel`).  \n2. **View**:  \n   - EJS templates render dynamic content, allowing users to interact seamlessly.  \n3. **Controller**:  \n   - Manages the business logic. For example:  \n     - Validating user input.  \n     - Communicating with models to fetch/update data.  \n     - Redirecting users and displaying flash messages.\n\n---\n\n## 🗂️ **File Structure**\n\n```plaintext\n📁 BookMyStay/\n├── 📁 config/\n│   ├── passport.js     # Passport.js configuration\n│   └── session.js      # Express-session configuration\n├── 📁 controllers/\n│   ├── authController.js           # Login/signup logic\n│   └── accommodationController.js  # CRUD operations for accommodations\n├── 📁 models/\n│   ├── userModel.js                # MongoDB schema for users\n│   └── accommodationModel.js       # MongoDB schema for accommodations\n├── 📁 public/\n│   ├── css/        # CSS files for styling\n│   ├── js/         # Client-side JavaScript\n│   └── images/     # Images for the app\n├── 📁 routes/\n│   ├── authRoutes.js               # Routes for authentication\n│   └── accommodationRoutes.js      # Routes for accommodations\n├── 📁 views/\n│   ├── 📄 index.ejs                # Home page template\n│   ├── 📄 login.ejs                # Login form\n│   ├── 📄 dashboard.ejs            # Admin dashboard\n│   └── 📄 error.ejs                # Error page\n\n```\n\n---\n\n## 🚀 **How It Works**\n\n### **Authentication and Authorization**\n\n- **Login System**:  \n   Users authenticate securely using Passport.js. Sessions are created to maintain login states.  \n\n- **Role-Based Access**:  \n   Routes are protected to allow only authorized access based on user roles (e.g., admin routes are restricted).\n\n---\n\n### **Flash Messages**\n\n- After critical actions (e.g., login, booking, or admin actions), flash messages provide instant feedback to users.  \n  Example:\n  - **Success**: “Your booking was confirmed!”  \n  - **Error**: “Invalid credentials. Please try again.”\n\n### **Session Management**\n\n- **Express-Session** keeps users logged in for the duration of their session, storing key details like user ID securely.  \n- Sessions are invalidated on logout, ensuring security.\n\n---\n\n## 🏁 **Conclusion**\n\n**BookMyStay** is a highly secure, modular, and user-friendly accommodation booking platform. By implementing **MVC**, integrating **flash messages**, and ensuring robust **session management** and **authorization**, this platform provides a seamless experience for users and admins alike. 🌟  \n\nThank you for exploring **BookMyStay**! Feel free to contribute or provide feedback as we make this platform even better. 🎉\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnandkumar1000%2Fbookmystay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnandkumar1000%2Fbookmystay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnandkumar1000%2Fbookmystay/lists"}