{"id":25171283,"url":"https://github.com/basemax/travelplannergraphqlts","last_synced_at":"2025-05-05T20:41:32.085Z","repository":{"id":189734279,"uuid":"673700625","full_name":"BaseMax/TravelPlannerGraphQLTS","owner":"BaseMax","description":"The Travel Planner App is a web application that allows users to plan and organize their trips efficiently. It utilizes GraphQL as the API layer and is implemented using TypeScript for a more robust and type-safe development experience. With this app, users can create trip itineraries, search for points of interest, and share their travel plans wit","archived":false,"fork":false,"pushed_at":"2025-04-11T19:33:08.000Z","size":2597,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-04T21:45:55.909Z","etag":null,"topics":["gql","graphql","javascript","js","travel-api","travel-graphql","travel-planner","travel-planner-api","travel-planner-graphql","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-02T08:20:46.000Z","updated_at":"2025-05-04T14:31:33.000Z","dependencies_parsed_at":"2024-02-21T09:34:48.342Z","dependency_job_id":"c708161c-119d-4a73-9f21-8466e3187893","html_url":"https://github.com/BaseMax/TravelPlannerGraphQLTS","commit_stats":null,"previous_names":["basemax/travelplannergraphqlts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FTravelPlannerGraphQLTS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FTravelPlannerGraphQLTS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FTravelPlannerGraphQLTS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FTravelPlannerGraphQLTS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/TravelPlannerGraphQLTS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252573009,"owners_count":21770128,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gql","graphql","javascript","js","travel-api","travel-graphql","travel-planner","travel-planner-api","travel-planner-graphql","ts","typescript"],"created_at":"2025-02-09T09:19:45.731Z","updated_at":"2025-05-05T20:41:32.067Z","avatar_url":"https://github.com/BaseMax.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Travel Planner App - GraphQL-based in TypeScript\n\nThe Travel Planner App is a web application that allows users to plan and organize their trips efficiently. It utilizes GraphQL as the API layer and is implemented using TypeScript for a more robust and type-safe development experience. With this app, users can create trip itineraries, search for points of interest, and share their travel plans with others.\n\n## Features\n\n- **User Authentication:** Users can sign up, log in, and manage their accounts.\n- **Trip Creation:** Users can create new trips, specifying the destination, dates, and other details.\n- **Itinerary Management:** Users can add, remove, and update notes within their trip itinerary.\n- **Collaboration:** Users can share their trip plans with other registered users.\n- **Real-time Updates:** Utilize GraphQL subscriptions for real-time updates when collaborating on a trip.\n\n## Technologies Used\n\n- **GraphQL:** For the API layer, enabling efficient data retrieval and mutation.\n- **TypeScript:** For a type-safe and more maintainable codebase.\n- **Apollo Client:** For handling GraphQL queries, mutations, and subscriptions on the client-side.\n- **Node.js:** For the backend server implementation.\n- **Nestjs:** a popular open-source, back-end framework for Node. js and TypeScript-based, server-side applications.\n- **MongoDB:** As the database for storing user accounts, trips, and other data.\n- **Mongoose:** For modeling the MongoDB data and performing database operations.\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js and npm should be installed on your machine.\n\n- MongoDB server should be running locally or have a connection to a remote MongoDB instance.\n\n### Installation\n\n- Clone the repository: `git clone https://github.com/basemax/TravelPlannerGraphQLTS.git`\n- Navigate to the project directory: `cd TravelPlannerGraphQLTS`\n- Install dependencies for the server:\n\n```bash\ncd server\nnpm install\n```\n\n**Configure the environment variables:**\n\nCreate a .env file in the server directory and provide the necessary configuration, such as MongoDB connection URL and JWT secret key.\n\n**Seed the database (optional):**\n\nIf you want to add some sample data to the database, you can use the provided seed script:\n\n```bash\ncd server\nnpm run seed\n```\n\n```\nnpm start\n```\n\nAccess the app in your browser at `http://localhost:3000`.\n\n## GraphQL\n\n### Queries:\n\n- `getUser`: Get user details by user ID or username.\n- `getTrip`: Get trip details by trip ID.\n- `getTripsByUser`: Get all trips associated with a specific user.\n- `getCollaborators`: Get a list of users who are collaborators on a specific trip.\n- `getCollaboratorTrips`: Get all trips where the current user is a collaborator.\n- `searchTrips`: Search for trips based on destination, date range, or other criteria.\n- `getPopularDestinations`: Get a list of popular destinations based on the number of trips created.\n- `getTripsByDateRange`: Get trips that fall within a specified date range.\n- `getTripsByDestination`: Get all trips with a specific destination.\n- `getTripsByDate`: Get all trips that occur on a particular date.\n- `getTripsByCollaborator`: Get all trips where a specific user is a collaborator.\n\n### Mutations:\n\n- `signup`: Create a new user account with username, email, and password.\n- `login`: Log in the user and return a JWT token for authentication.\n- `createTrip`: Create a new trip with destination, dates, and other details.\n- `updateUser`: Update user details, such as name, email, or profile picture.\n- `updateTrip`: Update trip details, such as destination, dates, or other information.\n- `addCollaborator`: Invite a user to collaborate on a trip by adding them to the list of collaborators.\n- `removeCollaborator`: Remove a collaborator from a trip.\n- `deleteUser`: Delete the user account along with all associated data (trips, activities, etc.).\n- `deleteTrip`: Delete a trip along with its itinerary and associated data.\n- `addCollaboratorNote`: Allow collaborators to add notes or comments to a specific trip.\n- `editCollaboratorNote`: Allow collaborators to edit their notes or comments on a trip.\n- `deleteCollaboratorNote`: Allow collaborators to delete their notes or comments on a trip.\n\n### Subscriptions (Real-time Updates):\n\n- `tripUpdated`: Subscribe to real-time updates when a trip is modified (e.g., itinerary changes, new collaborators).\n- `collaboratorAdded`: Subscribe to real-time updates when a new collaborator is added to a trip.\n- `collaboratorRemoved`: Subscribe to real-time updates when a collaborator is removed from a trip.\n- `tripDeleted`: Subscribe to real-time updates when a trip is deleted.\n- `activityUpdated`: Subscribe to real-time updates when an activity is modified (e.g., details changed, time updated).\n- `tripDeleted`: Subscribe to real-time updates when a trip is deleted, notifying collaborators.\n- `collaboratorNoteAdded`: Subscribe to real-time updates when a collaborator adds a note to a trip.\n- `collaboratorNoteEdited`: Subscribe to real-time updates when a collaborator edits their note on a trip.\n- `collaboratorNoteDeleted`: Subscribe to real-time updates when a collaborator deletes their note on a trip.\n\nSure, here are more examples for the remaining queries, mutations, and subscriptions:\n\n## GraphQL Examples\n\n### **getCollaboratorTrips**: Get all trips where the current user is a collaborator.\n\n```graphql\nquery UserTrips {\n  userTrips {\n    _id\n    destination\n    toDate\n    collaborators\n  }\n}\n```\n\n![get user trips](./screenshots/getCurrentUserTrips.png)\n\n### **searchTrips**: Search for trips based on destination, date range, or other criteria.\n\n```graphql\nquery {\n  searchTrips(\n    searchInput: {\n      destination: \"Italy\"\n      fromDate: \"2023-09-01\"\n      toDate: \"2023-09-30\"\n    }\n  ) {\n    searchTrip(searchInput: $searchInput) {\n      _id\n      destination\n      fromDate\n      toDate\n      collaborators\n    }\n  }\n}\n```\n\n![get user trips](./screenshots/searchTrip.png)\n\n### getCollaboratorTrips: Get all trips where the current user is a collaborator.\n\n```graphql\nquery {\n  getCollaboratorTrips {\n    id\n    destination\n    dates\n  }\n}\n```\n\n### getPopularDestinations: Get a list of popular destinations based on the number of trips created.\n\n```graphql\nquery PopularDestination {\n  PopularDestination {\n    tripsCount\n    destination\n  }\n}\n```\n\n![get popular destination](./screenshots/getPopularDestination.png)\n\n### getTripsByDateRange: Get trips that fall within a specified date range.\n\n```graphql\nquery GetTripsByDateRange($dateRange: SearchTripInput!) {\n  getTripsByDateRange(dateRange: $dateRange) {\n    _id\n    destination\n    fromDate\n    toDate\n    collaborators\n  }\n}\n```\n\n![search trips](./screenshots/searchTrip.png)\n\n### collaboratorAdded: Subscribe to real-time updates when a new collaborator is added to a trip.\n\n```graphql\nsubscription {\n  collaboratorAdded(tripId: \"456\") {\n    _id\n    collaborators\n  }\n}\n```\n\n![collaborator added](./screenshots/addCollaboratorSubscription.png)\n\n### collaboratorRemoved: Subscribe to real-time updates when a collaborator is removed from a trip.\n\n```graphql\nsubscription {\n  collaboratorRemoved(tripId: \"456\") {\n    id\n    collaborators\n  }\n}\n```\n\n![collaborator removed](./screenshots/collaboratorRemovedSubscription.png)\n\n### getTripsByDestination: Get all trips with a specific destination.\n\n```graphql\nquery {\n  getTripsByDestination(destination: \"London\") {\n    id\n    destination\n    dates\n  }\n}\n```\n\n![search trips](./screenshots/searchTrip.png)\n\n### getTripsByDate: Get all trips that occur on a particular date.\n\n```graphql\nquery {\n  getTripsByDate(date: \"2023-09-15\") {\n    id\n    destination\n    dates\n  }\n}\n```\n\n### addCollaboratorNote: Allow collaborators to add notes or comments to a specific trip.\n\n```graphql\nmutation CreateNote($CreateNoteInput: CreateNoteInput!) {\n  createNote(createNoteInput: $CreateNoteInput) {\n    _id\n    notes {\n      _id\n      collaboratorId\n      content\n      createdAt\n    }\n    collaborators\n    toDate\n    fromDate\n    destination\n  }\n}\n```\n\n![create note](./screenshots/addNoteMutation.png)\n\n### collaboratorNoteAdded: Subscribe to real-time updates when a collaborator adds a note to a trip.\n\n```graphql\nsubscription {\n  collaboratorNoteAdded(tripId: \"456\") {\n    id\n    notes {\n      id\n      content\n    }\n  }\n}\n```\n\n![create note](./screenshots/addNoteSubscription.png)\n\n### updateCollaboratorNote: Allow collaborators to edit their notes or comments on a trip.\n\n```graphql\nmutation UpdateNote($UpdateNoteInput: UpdateNoteInput!) {\n  updateNote(updateNoteInput: $UpdateNoteInput) {\n    _id\n    collaborators\n    notes {\n      _id\n      content\n      collaboratorId\n    }\n    destination\n    toDate\n  }\n}\n```\n\n![update note](./screenshots/updateNoteMutation.png)\n\n### collaboratorNoteEdited: Subscribe to real-time updates when a collaborator edits their note on a trip.\n\n```graphql\nsubscription {\n  collaboratorNoteEdited(tripId: \"456\") {\n    id\n    notes {\n      id\n      content\n    }\n  }\n}\n```\n\n![update note](./screenshots/addNoteSubscription.png)\n\n### removeCollaboratorNote: Allow collaborators to delete their notes or comments on a trip.\n\n```graphql\nmutation RemoveNote {\n  removeNote(\n    tripId: \"64d314d7306ec85324ee2a94\"\n    noteId: \"64d314d7306ec85324ee2a94\"\n  ) {\n    _id\n    destination\n    fromDate\n    toDate\n    collaborators\n  }\n}\n```\n\n![remove note](./screenshots/removeNoteMutation.png)\n\n### collaboratorNoteDeleted: Subscribe to real-time updates when a collaborator deletes their note on a trip.\n\n```graphql\nsubscription {\n  collaboratorNoteDeleted(tripId: \"456\") {\n    id\n    notes {\n      id\n      content\n    }\n  }\n}\n```\n\n![remove note](./screenshots/removeNoteSubscription.png)\n\n### removeTrip: remove a specific trip\n\n```graphql\nmutation RemoveTrip {\n  removeTrip(id: \"64d08726a580a984fb673d64\") {\n    _id\n    destination\n    fromDate\n    toDate\n    collaborators\n  }\n}\n```\n\n![remove trip](./screenshots/removeTripMutation.png)\n\n### tripRemoved: Subscribe to real-time updates when a trip is deleted.\n\n```graphql\nsubscription {\n  tripRemoved(tripId: \"456\") {\n    id\n    destination\n    dates\n  }\n}\n```\n\n![removed trip subscription](./screenshots/removeTripSubscription.png)\n\n### getTripsByDate: Get all trips that occur on a particular date.\n\n```graphql\nquery {\n  getTripsByDate(date: \"2023-09-15\") {\n    id\n    destination\n    dates\n  }\n}\n```\n\n### addCollaborator: Invite a user to collaborate on a trip by adding them to the list of collaborators.\n\n```graphql\nmutation {\n  addCollaborator(tripId: \"trip456\", userId: \"user789\") {\n    id\n    destination\n    collaborators {\n      id\n      username\n    }\n  }\n}\n```\n\n![add collaborator](./screenshots/addCollaboratorMutation.png)\n\n### collaboratorAdded: Subscribe to real-time updates when a new collaborator is added to a trip.\n\n```graphql\nsubscription {\n  collaboratorAdded(tripId: \"trip456\") {\n    id\n    destination\n    collaborators {\n      id\n      username\n    }\n  }\n}\n```\n\n![remove collaborator ](./screenshots/collaboratorRemoved.png)\n\n### collaboratorRemoved: Subscribe to real-time updates when a collaborator is removed from a trip.\n\n```graphql\nsubscription {\n  collaboratorRemoved(tripId: \"trip456\") {\n    id\n    destination\n    collaborators {\n      id\n      username\n    }\n  }\n}\n```\n\n![removed collaborator subscription](./screenshots/removeNoteSubscription.png)\n\n## GraphQL Schema\n\n```graphql\ntype User {\n  id: ID!\n  name: String!\n  email: String!\n}\n\ntype Trip {\n  id: ID!\n  destination: String!\n  toDate: Date!\n  fromDate : Date!\n  notes: [User!]!\n  notes: [CollaboratorNote!]!\n}\n\n\ntype notes {\n  id: ID!\n  content: String!\n  userId: String!\n}\n\ntype Query {\n  getUser(userId: ID!): User\n  getTrip(tripId: ID!): Trip\n  getCollaborators(tripId: ID!): [User!]!\n  getCollaboratorTrips: [Trip!]!\n  searchTrips(destination: String, fromDate: String, toDate: String): [Trip!]!\n  getPopularDestinations: [Tag!]!\n  getTripsByDateRange(fromDate: String!, toDate: String!): [Trip!]!\n  getTripsByDestination(destination: String!): [Trip!]!\n  getTripsByDate(date: String!): [Trip!]!\n  getTripsByCollaborator(collaboratorId: ID!): [Trip!]!\n}\n\ntype Mutation {\n  signup(username: String!, email: String!, password: String!): User\n  login(username: String!, password: String!): AuthPayload\n  createTrip(input: CreateTripInput!): Trip\n  addCollaborator(tripId: ID!, userId: ID!): Trip\n  removeCollaborator(tripId: ID!, collaboratorId: ID!): Trip\n  deleteTrip(tripId: ID!): Trip\n  addCollaboratorNote(tripId: ID!, note: String!): Trip\n  editCollaboratorNote(noteId: ID!, content: String!): CollaboratorNote\n  deleteCollaboratorNote(noteId: ID!): CollaboratorNote\n}\n\ntype Subscription {\n  collaboratorAdded(tripId: ID!): User\n  collaboratorRemoved(tripId: ID!): User\n  tripDeleted(tripId: ID!): Trip\n  collaboratorNoteAdded(tripId: ID!): CollaboratorNote\n  collaboratorNoteEdited(tripId: ID!): CollaboratorNote\n  collaboratorNoteDeleted(tripId: ID!): CollaboratorNote\n}\n\ntype AuthPayload {\n  token: String!\n  name : String!\n}\n```\n\n## Contributing\n\nWe welcome contributions to improve this Travel Planner App! To contribute, please follow these steps:\n\n- Fork the repository.\n- Create a new branch for your feature or bug fix: git checkout -b my-feature\n- Make your changes, and ensure the code passes the tests (if available).\n- Commit your changes: git commit -m \"Add my feature\"\n- Push to your branch: git push origin my-feature\n- Submit a pull request to the main branch of the original repository.\n\n## License\n\nThis project is licensed under the GPL-3.0 License. See the LICENSE file for more details.\n\n## Acknowledgments\n\nSpecial thanks to the GraphQL and TypeScript communities for providing great tools and resources.\n\nCopyright 2023, Max Base\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Ftravelplannergraphqlts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Ftravelplannergraphqlts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Ftravelplannergraphqlts/lists"}