- Travel Vista Backend
The Travel Vista Backend is a comprehensive backend solution designed to manage the booking of travel services. It enables users to sign up, log in, browse available services, book appointments, and manage their bookings. Admins have additional functionalities, including managing services, booking slots, and user accounts.
The backend server is hosted live at Travel Vista Backend Demo.
- User registration and login with secure password hashing.
- Role-based access control (Admin and Regular User).
- CRUD operations for managing travel services.
- Admin-only access to create, update, and delete services.
- Users can view available slots and make bookings.
- Admins can manage all bookings and slots.
- MongoDB used as the database with Mongoose ODM.
- Support for transactional operations to ensure data consistency.
- JWT-based authentication and role-based authorization.
- Input validation and sanitization to prevent injection attacks.
- Comprehensive API documentation created using Swagger or Postman.
- Endpoints categorized by functionality for ease of testing and development.
- Node.js: Runtime environment.
- Express.js: Web framework.
- TypeScript: Strongly typed JavaScript for scalability and maintainability.
- MongoDB: NoSQL database.
- Mongoose: ODM for MongoDB.
- JWT: Authentication.
- bcrypt.js: Password hashing.
- Git & GitHub: Version control.
- Postman: API testing.
- VS Code: Development environment.
git clone https://github.com/Kamrulthedev/Travel-vista-new-version-server
cd Travel-vista-server
npm install
Create a .env
file in the root directory and add the following:
PORT=5000
MONGODB_URI=your-mongodb-uri
JWT_SECRET=your-jwt-secret
BCRYPT_SALT_ROUNDS=10
STRIPE_SECRET_KEY=your-stripe-secret-key
AAMARPAY_STORE_ID=your-aamarpay-store-id
AAMARPAY_STORE_PASSWORD=your-aamarpay-store-password
For development:
npm run dev
For production:
npm start
The server will run on http://localhost:5000
.
- Use a tool like Postman to test the API endpoints.
- Endpoints are secured and require a JWT token for access.
- Admin users can manage services and bookings.
The following environment variables are required:
Variable | Description |
---|---|
PORT |
Port number for the server. |
MONGODB_URI |
MongoDB connection URI. |
JWT_SECRET |
Secret key for JWT tokens. |
BCRYPT_SALT_ROUNDS |
Salt rounds for bcrypt hashing. |
STRIPE_SECRET_KEY |
Stripe API secret key. |
AAMARPAY_STORE_ID |
Aamarpay store ID. |
AAMARPAY_STORE_PASSWORD |
Aamarpay store password. |
The backend includes middleware for structured error handling, including:
- Validation errors for user input.
- Authentication errors for unauthorized access.
- General server errors with proper HTTP status codes.
- JWT-based authentication ensures secure access to protected routes.
- Role-based authorization controls access to admin-specific functionalities.
Comprehensive API documentation is available at API Documentation. It includes details of all endpoints, request/response formats, and example payloads.
- Develop a frontend interface for improved user experience.
- Add email notifications for booking confirmations and updates.
- Enhance security features such as rate limiting, logging, and monitoring.
- Support for multiple languages for a global audience.
This project is licensed under the MIT License.
Travel Smarter, Explore Further!