TripMate is a RESTful API backend for a travel-based application where users can create trips, join others' trips, and explore new destinations. The application supports role-based access, secure authentication, dynamic filtering, and trip management functionality.
- 🧳 Create and manage personal trip events
- 🤝 Request to join others' trips
- 🔐 Role-based access control (Admin, User)
- 🔎 Advanced trip search, filtering, sorting & pagination
- ✅ Trip owner can accept/decline join requests
- 🧑💼 Admin dashboard with full user/trip management
- 🔒 JWT-based authentication and authorization
- 📚 RESTful APIs with proper route separation and structure
| Technology | Description |
|---|---|
| Node.js | JavaScript runtime |
| Express.js | Web framework for Node.js |
| MongoDB | NoSQL database |
| Mongoose | ODM for MongoDB |
| JWT | Authentication |
| dotenv | Environment variable management |
| bcryptjs | Password hashing |
| cors | Cross-origin resource sharing |
| nodemailer | Send email |
- JWT-based login system
- Passwords hashed using
bcryptjs - Role-based route protection:
admin: can manage users and all tripsuser: can create, update, or join trips
- Auth
- Register / Login / Logout
- JWT Token-based access
- Trip
- Create, Read, Update, Delete (CRUD)
- Search by title/destination
- Filter by date, location, category
- Sort by date, popularity, etc.
- Pagination support
- Join Request
- Request to join other's trip
- Accept or reject join request
- Admin
- View all trips and users
- Ban/unban users or remove trips
git clone https://github.com/NiharMondal/trip-mate-backend
cd tripmate-backendnpm install
NODE_ENV
FRONT_END_URL
MONGO_URI
JWT_SECRET
EMAIL #your app password email
PASSWORD #app password credentials
npm run devThe server will start on http://localhost:5000
- Email notifications
- Payment gateway integration
- Real-time updates using WebSocket (e.g., join request notifications)
Nihar Mondal
LinkedIn | Portfolio | GitHub
- Root API: http://localhost:5000/api/v1
-
Get Related Trips
GET /related-trip/:id
-
Get Freshly Added Trips
GET /freshly-added
-
Get Popular Trips
GET /popular-trip
-
Get Trip by ID
GET /by-id/:id
-
Get Trip by Slug
GET /:slug
-
Get Top Destination
GET /top-destination
- Register
POST /auth/register
- Login
POST /auth/login
- Update Profile
PATCH /user/profile/:userId
- Get User's Trips
GET /my-trip/:userId
- Create a Trip
POST /trip
- Update a Trip
PATCH /trip/:id
- Delete a Trip
DELETE /trip/:id
- Send Buddy Request
POST /buddy-request
- Accept Buddy Request
PATCH /buddy-request/:id/accept
- Submit a Review
POST /reviews
- Admin Approve Review
PATCH /reviews/:id/approve