Trip Squad is a web application designed to help users plan and organize their trips efficiently. Whether you're traveling solo or with friends, Trip Squad provides features to manage your trips, find potential travel buddies.
- Programming Language: TypeScript
- Web Framework: Express.js
- Database: Railway Database PostgreSQL with Prisma ORM
- Authentication: JSON Web Tokens (JWT)
- Validation: Zod for schema validation
- Deployment: Vercel
-
User Authentication: Register easily and authenticate securely as either a User or Admin to access the platform.
-
Trip Management: Seamlessly create, update, and delete trip details, ensuring accurate planning and organization.
-
Travel Buddy Requests: Send and respond to trip buddy requests, and conveniently track request history for effective communication.
-
Admin Capabilities: Edit or delete trips, and efficiently manage user roles and permissions for streamlined administration.
-
Search and Filtering: Effortlessly find trips, users, and request buddies with advanced search options for enhanced user experience.
-
User Profile: Keep profile information up-to-date to foster connections and facilitate seamless trip planning and coordination.
Live Link: https://trip-squad-server.vercel.app/
User Credentials
Username: rakibul
Password: Rakibul@2021
git clone https://github.com/misbahurbd/trip-squad-server.git
cd trip-squad-server
npm install
Before starting the project, you need to configure the environment by creating an .env
file in the
project root with the following content:
NODE_ENV="development"
PORT=<PORT_NUMBER>
HASH_ROUND=<BCRYPT_HASH_ROUND>
CLIENT_URL=<LIVE_CLIENT_URL>
DATABASE_URL=<POSTGES_DATABASE_URI>
JWT_ACCESS_SECRET=<ACCESS_SECRET>
JWT_REFRESH_SECRET=<REFRESH_SECRET>
MAILER_EMAIL=<EMAIL_FOR_NODEMAILER>
MAILER_PASS=<NODEMAILER_EMAIL_PASSWORD>
CLOUD_NAME="<CLOUDINARY_CLOUD_NAME>
CLOUD_API_KEY=<CLOUDINARY_API_KEY>
CLOUD_API_SECRET=<CLOUDINARY_API_SECRET>
SEED_ADMIN_NAME=<SEED_ADMIN_NAME>
SEED_ADMIN_USERNAME=<SEED_ADMIN_USERNAME>
SEED_ADMIN_EMAIL=<SEED_ADMIN_EMAIL>
SEED_ADMIN_PASSWORD=<SEED_ADMIN_PASSWORD>
npm run dev
Server will start on http://localhost:5000
as PORT
on .env file
- Endpoint: POST /api/v1/auth/register
Public Only
- Request body: Contain user data object in JSON.
- Example URL:
http://localhost:5000/api/v1/auth/register
- Endpoint: POST /api/v1/auth/login
Public Only
- Request body: Contain user credentials in JSON.
- Example URL:
http://localhost:5000/api/v1/auth/login
- Endpoint: POST /api/v1/auth/verify/:token
- Verify Token: Contain verify token in URL.
- Example URL:
http://localhost:5000/api/v1/auth/verify/:token
- Endpoint: POST /api/v1/auth/refresh-token
- Refresh Token: Refresh token will provided with cookie.
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/auth/refresh-token
- Endpoint: POST /api/v1/auth/resend-verification-link
Public Only
- Example URL:
http://localhost:5000/api/v1/auth/resend-verification-link
- Endpoint: POST /api/v1/auth/change-password
Private
- Request body: Contain user credentials in JSON.
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/auth/change-password
- Endpoint: POST /api/v1/auth/forget-password
Public Only
- Request body: Contain user credentials object in JSON.
- Example URL:
http://localhost:5000/api/v1/auth/forget-password
- Endpoint: POST /api/v1/auth/reset-password/:token
Public Only
- Reset Token: Contain reset token in URL.
- Request body: Contain user credentials object in JSON.
- Example URL:
http://localhost:5000/api/v1/auth/reset-password/:token
- Endpoint: PUT /api/profiles
Private
- Request body: Contain profile data object in JSON
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/profiles
- Endpoint: PUT /api/profiles/profile-photo
Private
- Request body: Contain profile photo in FormData
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/profile/profile-photo
- Endpoint: POST /api/v1/users/create-user
Admin Only
- Request body: Contain user data and images in FormData
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/users/create-user
- Endpoint: POST /api/v1/users/create-user
Admin Only
- Pagination: Use Params to Paginate and Filter
- Searchable Field:
searchTerm
apply withname
,email
,username
,mobile
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/users/create-user
- Endpoint: POST /api/v1/users/update-status/:userId
Admin Only
- Request body: Contain user status object in JSON
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/users/update-status/:userId
- Endpoint: POST /api/v1/users/update-role/:userId
Admin Only
- Request body: Contain user role object in JSON
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/users/update-role/:userId
- Endpoint: POST /api/v1/trips
User Only
- Request body: Contain trip data and images in FormData
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/trips
- Endpoint: PUT /api/v1/trips/:tripId
Private
- Request body: Contain trip data and images in FormData
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/trips/:tripId
- Endpoint: GET /api/v1/trips/:tripId
Public
- Example URL:
http://localhost:5000/api/v1/trips/:tripId
- Endpoint: DELETE /api/v1/trips/:tripId
Private
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/trips/:tripId
- Endpoint: GET /api/v1/trips
Public
- Pagination: Use Params to Paginate and Filter
- Searchable Field:
searchTerm
apply withdestination
,description
,budget
- Filterable Field:
destination
,startDate
,endDate
,budget
- Example URL:
http://localhost:5000/api/v1/trips?searchTerm=paris&page=2
- Endpoint: GET /api/v1/trips/get-my-trips
User Only
- Pagination: Use Params to Paginate and Filter
- Request Headers:
Authorization: <JWT_TOKEN>
- Searchable Field:
searchTerm
apply withdestination
,description
,budget
- Filterable Field:
destination
,startDate
,endDate
,budget
- Example URL:
http://localhost:5000/api/v1/trips/get-my-trips?searchTerm=paris&page=2
- Endpoint: GET /api/v1/trips/trip-type
Public
- Pagination: Use Params to Paginate
- Example URL:
http://localhost:5000/api/v1/trips/trip-type
- Endpoint: GET /api/v1/trips/top-trip-types
Public
- Example URL:
http://localhost:5000/api/v1/trips/top-trip-types
- Endpoint: GET /api/v1/trips/photos
Public
- Example URL:
http://localhost:5000/api/v1/trips/photos
- Endpoint: GET /api/v1/travel-buddies/reqeust/:tripId
User Only
- Request body: Contain trip buddy data object in JSON
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/travel-buddies/reqeust/:tripId
- Endpoint: PUT /api/v1/travel-buddies/response/:buddyId
User Only
- Request body: Contain trip buddy data object in JSON
- Request Headers:
Authorization: <JWT_TOKEN>
- Example URL:
http://localhost:5000/api/v1/travel-buddies/response/:buddyId
- Endpoint: GET /api/v1/travel-buddies
User Only
- Request Headers:
Authorization: <JWT_TOKEN>
- Searchable Field:
searchTerm
apply withdestination
,description
,buddys name
,buddy email
,buddy username
,buddy mobile
- Example URL:
http://localhost:5000/api/v1/travel-buddies
- Endpoint: GET /api/v1/travel-buddies/history
User Only
- Request Headers:
Authorization: <JWT_TOKEN>
- Searchable Field:
searchTerm
apply withdestination
,description
,buddys name
,buddy email
,buddy username
,buddy mobile
- Example URL:
http://localhost:5000/api/v1/travel-buddies/history
- Endpoint: GET /api/v1/travel-buddies/buddies
User Only
- Request Headers:
Authorization: <JWT_TOKEN>
- Searchable Field:
searchTerm
apply withdestination
,description
,buddys name
,buddy email
,buddy username
,buddy mobile
- Example URL:
http://localhost:5000/api/v1/travel-buddies/buddies