Skip to content

StaySuite's Server side, a property rental platform built with Nest.js, Socket.io, and MongoDB. It features secure JWT authentication, real-time updates with Socket-IO, and seamless image uploads with Multer, delivering a reliable and scalable experience for guests and hosts

Notifications You must be signed in to change notification settings

BazilSuhail/StaySuite-Server

Repository files navigation

StaySuite's Server

StaySuite is a property rental platform similar offering key features such as user authentication, booking management, saving travelling history and favurite listings for guests while enabling host to manange listings via dashboard and seamlessly handle reservations made on there listings. It supports secure authentication using JWT, real-time updates for both guests and hosts with Socket.io, and image uploads of listings with Multer. Built with Nuxt.js for the frontend,Nest.jsfor the backend, and MongoDB for data storage, the platform ensures a seamless and efficient user experience.


Open Source Love svg1 contributions welcome

Project Description

This repository contains the backend for the StaySuite property rental platform, built with Nest.js, MongoDB, JWT, Socket.io, and Multer. It handles user authentication, booking management, real-time updates, and secure file uploads, ensuring a scalable and efficient system.

Nest.js, with its modular architecture and TypeScript support, is ideal for this project as it enhances maintainability, enforces best practices, and provides built-in support for WebSockets, making real-time features seamless. MongoDB ensures flexible data handling, while JWT secures authentication. Socket.io enables instant communication between guests and hosts, and Multer efficiently manages media uploads.

🤖 Tech Stack

TypeScript Nest.js MongoDB JWT Auth Socket.IO

Run Locally

Clone the project using the following command:

   git clone https://github.com/BazilSuhail/StaySuite-Server.git

Go to the project directory

   cd StaySuite-Server

Then Run this command in your terminal to install all required dependancies:

   npm install

In the project directory, you can run:

   npm run start:dev

Runs the app in the development mode. Your server will be running at port 3001, Open http://localhost:3001 or also you can modify it in the .env file.

Features

User Authentication

  • Signup Page: A registration api for new users to get register themselves as a Guest or Host.
  • Login Page: A login api for existing users allowing them to log into there accounts.

Admin Panel

  • Listings Management: Admin api enabling him to view, add, and remove property listings.
  • Bookings Management: Admin api enabling him to view all bookings, including user and property details.

Protected Routes

  • User Profile: User api enabling him to view his information and .
  • Admin Panel: Accessible api's only to Host users.
  • Booking history: Guests api's enabling them to can view there booking history.
  • Redirection for Unauthenticated Users: Users attempting to access protected routes are redirected to the login page.

Booking System

  • Booking Page: Users api enabling them to submit bookings, which are saved to the backend.
  • Reserved Bookings for Guests Page: Displaying reserved bookings api for each user.
  • Reserved Bookings for Host Page: Displaying api for reserved bookings on Hosts Listings.

Mini Admin Panel

  • Listings Management: Api for Host to add new listings with property details and images, and list view for displaying and deleting existing listings.
  • Bookings Management: Admin's api to overview of all bookings with details for each booking, including user and property information.

Backend Security

  • Role-Based Access Control: Routes are protected based on user roles (e.g., admin).
  • JWT Middleware: Secures routes that require authentication.
  • Password Hashing: Passwords are hashed using bcrypt before being saved to the database.

Backend

  • Controllers: Handles API logic (e.g., authentication, listings, bookings).
  • Services: Business logic for interacting with the database.
  • Middleware: JWT authentication and role-based access control.
  • Models: MongoDB schemas for listings, bookings, and users.

About

StaySuite's Server side, a property rental platform built with Nest.js, Socket.io, and MongoDB. It features secure JWT authentication, real-time updates with Socket-IO, and seamless image uploads with Multer, delivering a reliable and scalable experience for guests and hosts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published