<<<<<<< HEAD
Stayvora is a modern full-stack accommodation booking platform inspired by the idea of seamless travel, comfortable stays, and memorable experiences. Users can explore properties, view detailed listings, upload images, leave reviews, and manage bookings through an intuitive interface.
Stayvora helps travelers discover unique places to stay while allowing hosts to showcase their properties efficiently. The platform focuses on clean UI, smooth user experience, and scalable architecture.
Whether it’s a short vacation, work trip, or long-term stay — Stayvora makes finding the perfect place easier.
- User Authentication & Authorization
- Secure Login & Signup
- Explore Property Listings
- Search & Filter Properties
- Property Details Page
- Upload Property Images
- Add Reviews & Ratings
- Responsive Design for All Devices
- Add New Listings
- Edit Existing Listings
- Delete Listings
- Manage Property Information
- Upload Multiple Property Images
- Password Encryption
- Session Management
- Authorization Middleware
- Protected Routes
- HTML5
- CSS3
- JavaScript
- Bootstrap / Tailwind CSS
- EJS Templates
- Node.js
- Express.js
- MongoDB
- Mongoose ODM
- Passport.js
- Express Session
- bcrypt
- Cloudinary
- Multer
- Mapbox API
- Render / Railway / Vercel
Stayvora/
│
├── models/
├── routes/
├── controllers/
├── views/
├── public/
├── middleware/
├── utils/
├── uploads/
├── app.js
├── package.json
└── README.md
=======
# Stayvora
A full-stack vacation rental platform where users can discover, list, and review properties from around the world. Built with Node.js, Express, and MongoDB.
---
## Features
- **User Authentication** — Register, log in, and log out securely with Passport.js (local strategy)
- **Listings** — Create, view, edit, and delete property listings with title, description, price, location, and image
- **Image Uploads** — Upload property photos directly to Cloudinary
- **Interactive Maps** — Every listing displays an interactive Leaflet map with an accurate pin; the edit form includes a geocoding search to find and update the pin by location name
- **Reviews** — Authenticated users can leave star ratings and comments on any listing
- **Search** — Filter listings by title, location, or country from the home page
- **Authorization** — Only listing owners can edit or delete their listings; only review authors can delete their reviews
- **Flash Messages** — Success and error feedback on all actions
---
## Tech Stack
| Layer | Technology |
|---|---|
| Runtime | Node.js |
| Framework | Express 5 |
| Database | MongoDB + Mongoose 9 |
| Templating | EJS + ejs-mate |
| Authentication | Passport.js (passport-local, passport-local-mongoose) |
| Image Storage | Cloudinary + Multer |
| Maps | Leaflet.js + CartoDB Voyager tiles |
| Geocoding | Nominatim (OpenStreetMap) |
| Validation | Joi |
| Styling | Bootstrap 5 |
| Environment | dotenv |
---
## Getting Started
### Prerequisites
- Node.js v18+
- MongoDB Atlas account (or local MongoDB)
- Cloudinary account
### Installation
1. **Clone the repository**
```bash
git clone https://github.com/your-username/stayvora.git
cd stayvora-
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:ATLASDB_URL=your_mongodb_connection_string SECRET=your_session_secret CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_KEY=your_api_key CLOUDINARY_SECRET=your_api_secret
-
Run the app
node app.js
The server starts at
http://localhost:8080
stayvora/
├── controllers/
│ ├── listings.js # Listing CRUD logic
│ ├── reviews.js # Review logic
│ └── user.js # Auth logic
├── models/
│ ├── listing.js # Listing schema
│ ├── review.js # Review schema
│ └── user.js # User schema
├── routes/
│ ├── listing.js # /listings routes
│ ├── review.js # /listings/:id/reviews routes
│ └── user.js # /users routes
├── utils/
│ ├── geocode.js # Nominatim geocoding helper
│ ├── ExpressError.js # Custom error class
│ └── wrapAsync.js # Async error wrapper
├── views/
│ ├── layouts/ # EJS layout
│ ├── includes/ # Navbar, footer, flash
│ └── listings/ # index, new, show, edit views
├── public/
│ └── js/ # Client-side scripts
├── cloudConfig.js # Cloudinary + Multer config
├── middleware.js # Auth & ownership middleware
├── schema.js # Joi validation schemas
└── app.js # Entry point
| Variable | Description |
|---|---|
ATLASDB_URL |
MongoDB connection string |
SECRET |
Express session secret |
CLOUDINARY_CLOUD_NAME |
Cloudinary cloud name |
CLOUDINARY_KEY |
Cloudinary API key |
CLOUDINARY_SECRET |
Cloudinary API secret |
| Method | Route | Description |
|---|---|---|
| GET | /listings |
All listings (with optional search) |
| GET | /listings/new |
New listing form |
| POST | /listings |
Create a listing |
| GET | /listings/:id |
Show a listing |
| GET | /listings/:id/edit |
Edit listing form |
| PUT | /listings/:id |
Update a listing |
| DELETE | /listings/:id |
Delete a listing |
| POST | /listings/:id/reviews |
Add a review |
| DELETE | /listings/:id/reviews/:reviewId |
Delete a review |
| GET | /users/register |
Register form |
| POST | /users/register |
Register user |
| GET | /users/login |
Login form |
| POST | /users/login |
Log in |
| GET | /users/logout |
Log out |
Add screenshots of your home page, listing detail, and map here.
This project is open source and available under the MIT License.
16a5780a4b5cf3baffab59414f615a2ea738e942