This is the official repository for the Travora internship project. The project consists of a frontend and backend working together to provide a travel booking platform.
- Backend: Node.js with Express, PostgreSQL (via Prisma), Clerk for authentication.
- Frontend: See
/frontendfor details. - Main features:
- User signup/login (with agent and customer roles)
- Trip booking for customers
- Agent profile management
cd frontend
npm install
npm run devcd backend
npm install
npm run devEnsure you have a .env file configured with your PostgreSQL credentials, Clerk keys, and any other required secrets.
To migrate and generate the Prisma client:
npx prisma migrate dev --name init- URL:
POST /api/auth/signup - Body (example for agent):
{
"email": "[email protected]",
"fullName": "Agent Name",
"mobileNumber": "9711100481",
"password": "yourpassword",
"role": "agent",
"profileImage": "https://example.com/profile.jpg",
"dateOfBirth": "1995-08-15",
"agencyName": "Travora Explorers",
"agencyAddress": "123, MG Road, Delhi",
"bankAccountNumber": "123456789012",
"bankIfsc": "SBIN0001234",
"bankAccountHolderName": "Adarsh Kumar"
}- Body (for customer):
{
"email": "[email protected]",
"password": "yourpassword",
"fullName": "John Doe",
"mobileNumber": "9835630055",
"role": "customer",
"address": "123 Main Street",
"city": "Delhi",
"state": "Delhi",
"country": "India"
}- URL:
POST /api/auth/login - Body:
{
"mobileNumber": "9835630055",
"password": "yourpassword"
}- URL:
POST /api/booking - Authorization: Bearer JWT token required (customer role only)
- Body:
{
"tripId": "TRIP_ID"
}- Response:
{
"message": "Trip booked successfully",
"booking": {
"_id": "BOOKING_ID",
"tripId": "TRIP_ID",
"userId": "USER_ID",
"createdAt": "2025-07-20T12:34:56.789Z"
}
}Add documentation for additional endpoints here as your backend grows, e.g., agent profile update, trip CRUD, etc.
- Uses Express for API.
- PostgreSQL via Prisma ORM.
- Clerk for authentication and user management.
- Agent and customer roles are handled distinctly.
- All environment-specific configuration is managed via
.envfiles.
curl -X POST http://localhost:PORT/api/auth/signup \
-H 'Content-Type: application/json' \
-d '{ ... }'curl -X POST http://localhost:PORT/api/auth/login \
-H 'Content-Type: application/json' \
-d '{ ... }'curl -X POST http://localhost:PORT/api/booking \
-H 'Authorization: Bearer <JWT_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{ "tripId": "TRIP_ID" }'If you are new to this project, please read through this README and familiarize yourself with the API and project structure before contributing.
Include your license here if applicable.