https://github.com/mohosin2126/tour-guide-server-v1
This Node.js application uses Express and MongoDB to create a Tourist Guide website with user authentication, role-based access, and API routes for handling data, bookings, and user interactions.
https://github.com/mohosin2126/tour-guide-server-v1
database express jwt middleware mongodb nodejs nodemon nosql
Last synced: 2 days ago
JSON representation
This Node.js application uses Express and MongoDB to create a Tourist Guide website with user authentication, role-based access, and API routes for handling data, bookings, and user interactions.
- Host: GitHub
- URL: https://github.com/mohosin2126/tour-guide-server-v1
- Owner: mohosin2126
- Created: 2023-11-26T10:04:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-09T10:15:45.000Z (10 months ago)
- Last Synced: 2025-01-14T22:32:30.059Z (5 months ago)
- Topics: database, express, jwt, middleware, mongodb, nodejs, nodemon, nosql
- Language: JavaScript
- Homepage:
- Size: 1.93 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tour-guide-server
- Express Framework:Utilized Express for building a web server to handle HTTP requests and responses.
CORS Middleware:- Incorporated the CORS middleware to enable cross-origin resource sharing.
Environment Variables:- Employed the dotenv package to manage and access environment variables securely.
JSON Web Tokens (JWT):- Implemented JWT for user authentication, generating and validating tokens for secure access to protected routes.
MongoDB Connection:Established a connection to a MongoDB database using the mongodb and mongoose libraries.
- API Routes:Defined various API routes for different functionalities, including data retrieval, user management, authentication, and handling bookings.
- Middleware Functions:Created middleware functions for JWT verification, admin role verification, and guide role verification to ensure secure access to specific routes.
- Collections in MongoDB:
Utilized MongoDB collections for storing data related to tours (dataCollection), tour categories (categoryCollection), tour guides (guideCollection), wishlists (wishlistCollection), bookings (bookingCollection), users (userCollection), stories (storyCollection), and comments (commentCollection).
- User Role Management:
Implemented functionality to assign roles (admin or guide) to users and verified their roles using middleware.
- Express Routes:
Created routes for handling user authentication, admin functionalities, guide functionalities, wishlists, bookings, and story sections.
Server Deployment:Configured the server to run on the specified port, defaulting to 5000 if no port is provided.
- Listening to Requests:Configured the server to listen for incoming requests and respond with appropriate messages.