Skip to content

VISHRUT86/node_hotels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏨 Node Hotels API

A backend Hotel Management REST API built using Node.js, Express, and MongoDB.
This project manages hotel staff (persons) and menu items, providing clean and structured APIs for CRUD operations.


🚀 Features

👤 Person Management

  • Add new staff/person
  • Fetch all persons
  • Filter persons by work type (chef, manager, waiter)
  • Structured MongoDB schema using Mongoose

🍽️ Menu Management

  • Add menu items
  • Fetch all menu items
  • Update and delete menu items
  • RESTful API design

🛠️ Tech Stack

  • Backend: Node.js, Express.js
  • Database: MongoDB
  • ODM: Mongoose
  • Tools: Postman, npm
  • Environment Config: dotenv

📂 Project Structure

image

▶️ How to Run the Project

1️⃣ Clone the Repository

git clone https://github.com/VISHRUT86/node_hotels.git

2️⃣ Go to Project Folder

cd node_hotels

3️⃣ Install Dependencies

npm install

4️⃣ Setup Environment Variables

Create a .env file in the root directory and add: MONGO_URI=your_mongodb_connection_string PORT=3000

5️⃣ Start the Server

node server.js

6️⃣ Server Runs At

http://localhost:3000


🔐 API Endpoints

👤 Person Routes

  • POST /person
  • GET /person
  • GET /person/:workType

🍽️ Menu Routes

  • POST /menu
  • GET /menu
  • PUT /menu/:id
  • DELETE /menu/:id

🎯 Learning Outcomes

  • Building RESTful APIs using Express
  • Designing MongoDB schemas with Mongoose
  • API routing and controller separation
  • Backend authentication structure basics
  • Environment configuration and database connection handling

🔮 Future Improvements

  • Add JWT-based authentication
  • Role-based access control
  • Validation and error handling improvements
  • API documentation using Swagger
  • Deploy on cloud (Render / Railway)

🤝 Contributing

Contributions are welcome.
Feel free to fork the repository and submit pull requests.


👨‍💻 Author

Vishrut Bharti
GitHub: https://github.com/VISHRUT86

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published