From d60d1f656ec3fc68c5ca3449566d17b13049a1ef Mon Sep 17 00:00:00 2001 From: piyushkumar0707 <121piyush466mits@gmail.com> Date: Sun, 19 Oct 2025 00:40:25 +0530 Subject: [PATCH 1/6] docs: add .env.example for server/client, fix README (commands, env var names, ports, correct clone URL) --- README.md | 20 ++++++++++++++------ client/.env.example | 2 ++ server/.env.example | 11 +++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 client/.env.example create mode 100644 server/.env.example diff --git a/README.md b/README.md index b8777f7..3af24d8 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ QuickStay/ ```bash cd server npm install -npm run server # Starts Express backend using nodemon +npm run server # Starts Express backend using nodemon (default http://localhost:3000) ``` ### 🌐 Frontend (Client) @@ -75,7 +75,7 @@ npm run server # Starts Express backend using nodemon ```bash cd client npm install -npm start # Starts React frontend on http://localhost:3000 +npm run dev # Starts Vite dev server (defaults to http://localhost:5173) ``` --- @@ -87,19 +87,20 @@ Create `.env` files in both `server/` and `client/` with the following: ### For Server ``` -PORT=5000 -MONGO_URI=your_mongodb_uri +PORT=3000 +MONGODB_URI=your_mongodb_connection_string # e.g. mongodb://localhost:27017 CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret CLERK_SECRET_KEY=your_clerk_secret +CLERK_WEBHOOK_SECRET=your_clerk_webhook_secret ``` ### For Client ``` VITE_CLERK_PUBLISHABLE_KEY=your_clerk_key -VITE_API_BASE_URL=http://localhost:5000/api +VITE_API_BASE_URL=http://localhost:3000/api ``` --- @@ -129,7 +130,14 @@ VITE_API_BASE_URL=http://localhost:5000/api Feel free to fork this project and raise a Pull Request. ```bash -git clone https://github.com/manishkumar8312/QuickStay.git +git clone https://github.com/manishkumar8312/Hotel-Booking.git +``` + +You can also use the provided `.env.example` files in both `server/` and `client/` as templates: + +``` +cp server/.env.example server/.env +cp client/.env.example client/.env ``` --- diff --git a/client/.env.example b/client/.env.example new file mode 100644 index 0000000..ce4d187 --- /dev/null +++ b/client/.env.example @@ -0,0 +1,2 @@ +VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key +VITE_API_BASE_URL=http://localhost:3000/api diff --git a/server/.env.example b/server/.env.example new file mode 100644 index 0000000..7052121 --- /dev/null +++ b/server/.env.example @@ -0,0 +1,11 @@ +PORT=3000 +MONGODB_URI=mongodb://localhost:27017 + +# Cloudinary (for image uploads) +CLOUDINARY_CLOUD_NAME=your_cloud_name +CLOUDINARY_API_KEY=your_api_key +CLOUDINARY_API_SECRET=your_api_secret + +# Clerk (server-side only) +CLERK_SECRET_KEY=your_clerk_secret +CLERK_WEBHOOK_SECRET=your_clerk_webhook_secret From e5a28de22f00386012d13f4d151c0c0ead6eec2d Mon Sep 17 00:00:00 2001 From: piyushkumar0707 <121piyush466mits@gmail.com> Date: Sun, 19 Oct 2025 00:42:13 +0530 Subject: [PATCH 2/6] docs: add CONTRIBUTING and CODE_OF_CONDUCT; add MIT LICENSE; link guides from README --- CODE_OF_CONDUCT.md | 13 +++++++++ CONTRIBUTING.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++ README.md | 2 ++ 4 files changed, 109 insertions(+) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..1def34b --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,13 @@ +# Code of Conduct + +We are committed to fostering a welcoming and inclusive community. All participants are expected to abide by this code of conduct. + +- Be respectful and considerate. +- Use inclusive language. +- No harassment, trolling, or personal attacks. +- Respect differing viewpoints and experiences. +- Gracefully accept constructive criticism. + +If you experience or witness unacceptable behavior, please report it to the maintainers via GitHub issues or contact listed in the repository. + +This project is open source and follows the spirit of the Contributor Covenant. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..079212e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,73 @@ +# Contributing to QuickStay (Hotel-Booking) + +Thanks for your interest in contributing! This guide walks you through the setup, coding standards, and pull request process. New contributors are welcome — issues labeled with good first issue or gssoc 25 are great starting points. + +## Quick Start + +1. Fork the repo on GitHub. +2. Clone your fork: + - HTTPS: `git clone https://github.com//Hotel-Booking.git` +3. Add the upstream remote: + - `git remote add upstream https://github.com/manishkumar8312/Hotel-Booking.git` +4. Create a feature branch: + - `git checkout -b docs/add-env-examples` (use a descriptive name) + +## Local Setup + +- Requirements: + - Node.js 18+ (20+ recommended) + - npm 9+ + - MongoDB (local or Atlas) + +- Install and run: + - Backend + - `cd server` + - `npm install` + - Copy env: `cp .env.example .env` and fill values + - `npm run server` (defaults to http://localhost:3000) + - Frontend + - `cd client` + - `npm install` + - Copy env: `cp .env.example .env` and fill values + - `npm run dev` (defaults to http://localhost:5173) + +## Environment Variables + +- Templates are provided in `server/.env.example` and `client/.env.example`. +- Never commit real secrets. `.env` is already gitignored. + +## Coding Standards + +- Lint: `npm run lint` (from client/) +- Prefer Conventional Commits for messages, e.g. + - `feat: add hotel rating component` + - `fix: resolve navbar overlap on mobile` + - `docs: align env examples with README` +- Keep PRs focused and small when possible. + +## Commit & PR Process + +1. Ensure your branch is up to date: + - `git fetch upstream` ; `git rebase upstream/main` +2. Commit changes with clear messages. +3. Push to your fork: + - `git push -u origin ` +4. Open a Pull Request targeting `main` of the upstream repo. +5. In the PR description, include: + - What/why of the change + - Screenshots for UI changes (before/after) + - Linked issue: `Closes #` + +## Issue Types You Can Pick + +- docs: Improving README, adding CONTRIBUTING, CODE_OF_CONDUCT, LICENSE +- bug: UI/UX polish (e.g., mobile overlaps), 404 handling, minor runtime fixes +- feat: Small features (e.g., simple client-side validation) +- perf: Minor optimizations (e.g., memoization) + +## Communication + +- Be respectful and follow our Code of Conduct. +- If unsure, open an issue or draft PR to discuss. + +Happy contributing! 💙 \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..00ffc82 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 QuickStay contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 3af24d8..9ceb80b 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,8 @@ Feel free to fork this project and raise a Pull Request. git clone https://github.com/manishkumar8312/Hotel-Booking.git ``` +See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed setup, coding standards, and PR process. Please follow our [Code of Conduct](CODE_OF_CONDUCT.md). + You can also use the provided `.env.example` files in both `server/` and `client/` as templates: ``` From bb025810a776b6afd4fab420b26c1dfe2fdbd36a Mon Sep 17 00:00:00 2001 From: piyushkumar0707 <121piyush466mits@gmail.com> Date: Sun, 19 Oct 2025 00:43:24 +0530 Subject: [PATCH 3/6] docs: align sample.env files with README and .env.example (MONGODB_URI, ports, VITE_API_BASE_URL) --- client/sample.env | 5 ++--- server/sample.env | 14 +++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/client/sample.env b/client/sample.env index 7c6199a..8231193 100644 --- a/client/sample.env +++ b/client/sample.env @@ -1,3 +1,2 @@ -VITE_CLERK_PUBLISHABLE_KEY=Enter_the_key -VITE_BACKEND_URL=your_backend_url -VITE_CURRENCY=your_preferred_currency \ No newline at end of file +VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key +VITE_API_BASE_URL=http://localhost:3000/api \ No newline at end of file diff --git a/server/sample.env b/server/sample.env index 2af365c..95b07b7 100644 --- a/server/sample.env +++ b/server/sample.env @@ -1,7 +1,11 @@ -MONGODB_URI = database_uri +PORT=3000 +MONGODB_URI=mongodb://localhost:27017 +# Cloudinary (for image uploads) +CLOUDINARY_CLOUD_NAME=your_cloud_name +CLOUDINARY_API_KEY=your_api_key +CLOUDINARY_API_SECRET=your_api_secret -#Clerk Keys -CLERK_PUBLISHABLE_KEY=your_publishable_key -CLERK_SECRET_KEY=your_secret_key -CLERK_WEBHOOK_SECRET=your_webhook_key \ No newline at end of file +# Clerk (server-side only) +CLERK_SECRET_KEY=your_clerk_secret +CLERK_WEBHOOK_SECRET=your_clerk_webhook_secret \ No newline at end of file From 4cade49e6bed81e23120691b1366f173c4584040 Mon Sep 17 00:00:00 2001 From: piyushkumar0707 <121piyush466mits@gmail.com> Date: Sun, 19 Oct 2025 00:49:08 +0530 Subject: [PATCH 4/6] fix(404): add NotFound page and catch-all route; improve API 404 and error responses with consistent JSON (#29) --- client/src/App.jsx | 2 ++ client/src/pages/NotFound.jsx | 24 ++++++++++++++++++++++++ server/server.js | 23 ++++++++++++++++------- 3 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 client/src/pages/NotFound.jsx diff --git a/client/src/App.jsx b/client/src/App.jsx index 15e7c86..771d7ea 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -12,6 +12,7 @@ import Dashboard from './pages/hotelOwner/Dashboard'; import AddRoom from './pages/hotelOwner/AddRoom'; import ListRoom from './pages/hotelOwner/ListRoom'; import HotelMap from './pages/HotelMap'; +import NotFound from './pages/NotFound'; const App = () => { @@ -33,6 +34,7 @@ const App = () => { }/> }/> + } />